summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2014-05-31 23:52:26 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2014-06-01 00:18:40 +0200
commita2120ff0d5aa960e53f7fc858640d96f21b65d04 (patch)
tree930b31b4febec94119a2c66e49459fdd4815b86a
parent103fbc2b4ba5b9d48713c084aae452e70af6bf65 (diff)
downloadgeiser-a2120ff0d5aa960e53f7fc858640d96f21b65d04.tar.gz
geiser-a2120ff0d5aa960e53f7fc858640d96f21b65d04.tar.bz2
Almost redundant REPL command to interrupt evaluation
Works almost identically to the stock C-c C-c, with just marginally better output aaand being well behaved when interrupting infinitely looping functions such as (define (f) (newline) (let loop () (loop))) -- cf. issue #29 on github. We like it so much that it replaces the old one.
-rw-r--r--doc/cheat.texi3
-rw-r--r--elisp/geiser-repl.el8
2 files changed, 11 insertions, 0 deletions
diff --git a/doc/cheat.texi b/doc/cheat.texi
index f027b64..3dd0f8d 100644
--- a/doc/cheat.texi
+++ b/doc/cheat.texi
@@ -130,6 +130,9 @@ third key not modified by @key{Control}; e.g.,
@item C-c M-o
@tab @code{geiser-repl-clear-buffer}
@tab Clear REPL buffer
+@item C-c C-k
+@tab @code{geiser-repl-interrupt}
+@tab Interrupt REPL evaluation (signalling inferior scheme)
@item C-c C-q
@tab @code{geiser-repl-exit}
@tab Kill Scheme process
diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el
index adc8872..9ecbd25 100644
--- a/elisp/geiser-repl.el
+++ b/elisp/geiser-repl.el
@@ -452,6 +452,11 @@ module command as a string")
(let ((comint-input-filter (lambda (x) nil)))
(comint-send-input nil t))))
+(defun geiser-repl-interrupt ()
+ (interactive)
+ (when (get-buffer-process (current-buffer))
+ (interrupt-process nil comint-ptyp)))
+
;;; REPL history
@@ -685,6 +690,9 @@ buffer."
("Previous input" "\C-c\M-p" comint-previous-input)
("Next input" "\C-c\M-n" comint-next-input)
--
+ ("Interrupt evaluation" ("\C-c\C-k" "\C-c\C-c" "\C-ck")
+ geiser-repl-interrupt)
+ --
(mode "Autodoc mode" ("\C-c\C-da" "\C-c\C-d\C-a") geiser-autodoc-mode)
("Symbol documentation" ("\C-c\C-dd" "\C-c\C-d\C-d")
geiser-doc-symbol-at-point