[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/kotlin-mode a2c2628d55 104/162: Merge pull request #27 fro
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/kotlin-mode a2c2628d55 104/162: Merge pull request #27 from trevorsummerssmith/more-focus |
Date: |
Sat, 29 Jan 2022 08:25:27 -0500 (EST) |
branch: elpa/kotlin-mode
commit a2c2628d55c4e8b018ffe9f55ca38d89302a1bbc
Merge: ebcf6f3730 734b08408c
Author: Gregg Hernandez <greggory.hz@gmail.com>
Commit: GitHub <noreply@github.com>
Merge pull request #27 from trevorsummerssmith/more-focus
Add send-{block,buffer,line,region}-and-focus functions
---
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 d801f5c5cf 020/162: kotlin-mode: Define keywords, (continued)
- [nongnu] elpa/kotlin-mode d801f5c5cf 020/162: kotlin-mode: Define keywords, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode d2436b8763 013/162: Cask: Use rx, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 56cfb15910 029/162: kotlin-mode: Highlight function names, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 6cfa5b71cf 032/162: kotlin-mode: Define property keywords, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 70d36a45c9 051/162: Add comment syntax, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode ffd69308ab 056/162: Handle all typedecl keywords the same way, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 04aa6eab91 068/162: handles parens while indenting, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 81b869a98c 075/162: consistent naming, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 34d89566b4 084/162: First stab at a README., ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 9e2e4c11fe 090/162: Merge pull request #13 from gregghz/whitespace-indent, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode a2c2628d55 104/162: Merge pull request #27 from trevorsummerssmith/more-focus,
ELPA Syncer <=
- [nongnu] elpa/kotlin-mode 5d83221994 109/162: 1x indent inside parenthesis, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 41eaed3e38 116/162: Remove overwritten <tab> key mapping so that region indentation works, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 5e9aff2ae9 122/162: Fix tests to run in the expected test environment., ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 7de9cc101a 133/162: Add *.elc to .gitignore, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 42fa1402a1 150/162: Merge pull request #49 from taku0/fix-warnings, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 0e4bafb31d 156/162: Merge pull request #57 from taku0/fix-backquote, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 3b10a6a97f 030/162: kotlin-mode: Highlight modifier, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 34947b6b35 045/162: Added 'data class' as a keyword, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode b2c51ab7ba 057/162: Merge pull request #2 from gergoerdi/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode e45a8f73e7 061/162: Declare dependency on Emacs 24.3, for setq-local, ELPA Syncer, 2022/01/29