[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/kotlin-mode 734b08408c 103/162: Add send-{block, buffer, l
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/kotlin-mode 734b08408c 103/162: Add send-{block, buffer, line, region}-and-focus functions |
Date: |
Sat, 29 Jan 2022 08:25:27 -0500 (EST) |
branch: elpa/kotlin-mode
commit 734b08408c547fafbeaea575cf522b04aabb2b0c
Author: Trevor Summers Smith <trevorsummerssmith@gmail.com>
Commit: Trevor Summers Smith <trevorsummerssmith@gmail.com>
Add send-{block,buffer,line,region}-and-focus functions
These are all exactly like their counterparts, except they
execute then put the focus into the REPL
Closes #26
---
kotlin-mode.el | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/kotlin-mode.el b/kotlin-mode.el
index 2183f4998a..8b6e68e872 100644
--- a/kotlin-mode.el
+++ b/kotlin-mode.el
@@ -54,17 +54,31 @@
:type 'string
:group 'kotlin)
+(defun kotlin-do-and-repl-focus (f &rest args)
+ (apply f args)
+ (pop-to-buffer kotlin-repl-buffer))
+
(defun kotlin-send-region (start end)
"Send current region to Kotlin interpreter."
(interactive "r")
(comint-send-region kotlin-repl-buffer start end)
(comint-send-string kotlin-repl-buffer "\n"))
+(defun kotlin-send-region-and-focus (start end)
+ "Send current region to Kotlin interpreter and switch to it."
+ (interactive "r")
+ (kotlin-do-and-repl-focus 'kotlin-send-region start end))
+
(defun kotlin-send-buffer ()
"Send whole buffer to Kotlin interpreter."
(interactive)
(kotlin-send-region (point-min) (point-max)))
+(defun kotlin-send-buffer-and-focus ()
+ "Send whole buffer to Kotlin interpreter and switch to it."
+ (interactive)
+ (kotlin-do-and-repl-focus 'kotlin-send-buffer))
+
(defun kotlin-send-block ()
(interactive)
(let* ((p (point)))
@@ -72,12 +86,22 @@
(kotlin-send-region (region-beginning) (region-end))
(goto-char p)))
+(defun kotlin-send-block-and-focus ()
+ "Send block to Kotlin interpreter and switch to it."
+ (interactive)
+ (kotlin-do-and-repl-focus 'kotlin-send-block))
+
(defun kotlin-send-line ()
(interactive)
(kotlin-send-region
(line-beginning-position)
(line-end-position)))
+(defun kotlin-send-line-and-focus ()
+ "Send current line to Kotlin interpreter and switch to it."
+ (interactive)
+ (kotlin-do-and-repl-focus 'kotlin-send-line))
+
(defun kotlin-repl ()
"Launch a Kotlin REPL using `kotlin-command' as an inferior mode."
(interactive)
- [nongnu] elpa/kotlin-mode 1f57bb5a92 135/162: Fix test runner in .travis.yml, (continued)
- [nongnu] elpa/kotlin-mode 1f57bb5a92 135/162: Fix test runner in .travis.yml, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 96b37d211c 139/162: Merge pull request #45 from taku0/add_backup_to_gitignore, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode d9d77ed459 069/162: indentation logic handling lambdas, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 82db4dce0c 077/162: basic indentation test, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 49ef724e96 076/162: additional keywords and smarter highlighting, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 257647d5d6 083/162: handle chained method calls on multiple lines, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode e1540a5ddf 087/162: Merge pull request #10 from gregghz/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode ad16798e02 091/162: Set proper indentation for closing brackets preceded by a blank line, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode ebcf6f3730 102/162: switch to tab-width, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 1b6d311168 108/162: Merge pull request #31 from jojojames/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 734b08408c 103/162: Add send-{block, buffer, line, region}-and-focus functions,
ELPA Syncer <=
- [nongnu] elpa/kotlin-mode 472ae23d6a 113/162: Fix syntax highlighting of star-projected types, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 002dd1497c 112/162: Merge pull request #36 from mikegolod/issue-35, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode ea5f378e40 129/162: Merge pull request #43 from taku0/add-prefix-to-methods, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode b4b575ce3a 130/162: Merge pull request #41 from ppareit/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 5dbf5dbf5f 132/162: Add *~ to .gitignore, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode e8100a9070 137/162: Adds more emacs versions to test matrix, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 29730e7908 153/162: Add Makefile, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 5d2d7b4f5a 157/162: Make underscore and at sign as a part of a symbol, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 613539eedc 042/162: Fix trailing parentheses, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode b4b1ace8cc 043/162: In kotlin-mode.el: (c) -> ©, ELPA Syncer, 2022/01/29