summaryrefslogtreecommitdiff
path: root/cider-client.el
diff options
context:
space:
mode:
authorTimo Freiberg <timo.freiberg@novatec-gmbh.de>2018-06-29 14:44:15 +0200
committerBozhidar Batsov <bozhidar.batsov@gmail.com>2018-06-30 00:09:31 +0200
commit0ca47cbb044a5a7f904064440179785fafd43b5e (patch)
treef53424be38e6b45a613fc31fb90ce43f77ac2db9 /cider-client.el
parent571036e9d092d6773dfd1885763821a793d1f1ce (diff)
[Fix #2317] Allow cancelling stdin prompt
Add handler for the `quit` signal which sends an empty message to nREPL Add C-c C-c binding for `abort-recursive-edit` (which sends a `quit` signal)
Diffstat (limited to 'cider-client.el')
-rw-r--r--cider-client.el12
1 files changed, 9 insertions, 3 deletions
diff --git a/cider-client.el b/cider-client.el
index 9e4d260c..3824a6aa 100644
--- a/cider-client.el
+++ b/cider-client.el
@@ -561,9 +561,15 @@ The result entries are relative to the classpath."
(defun cider-need-input (buffer)
"Handle an need-input request from BUFFER."
(with-current-buffer buffer
- (nrepl-request:stdin (concat (read-from-minibuffer "Stdin: ") "\n")
- (cider-stdin-handler buffer)
- (cider-current-repl))))
+ (let ((map (make-sparse-keymap)))
+ (set-keymap-parent map minibuffer-local-map)
+ (define-key map (kbd "C-c C-c") 'abort-recursive-edit)
+ (let ((stdin (condition-case nil
+ (concat (read-from-minibuffer "Stdin: " nil map) "\n")
+ (quit nil))))
+ (nrepl-request:stdin stdin
+ (cider-stdin-handler buffer)
+ (cider-current-repl))))))
(provide 'cider-client)