diff options
author | jao <jao@gnu.org> | 2021-11-21 18:01:55 +0000 |
---|---|---|
committer | jao <jao@gnu.org> | 2021-11-21 18:01:55 +0000 |
commit | 122564229f068b13493db75b4521017e242f007c (patch) | |
tree | a2c3a6ed42a5823a3d9fb2dc8697a5dc8ec75e9b | |
parent | 68e0991c96b1e5bc9a1d748a05a96127c6204987 (diff) | |
download | geiser-122564229f068b13493db75b4521017e242f007c.tar.gz geiser-122564229f068b13493db75b4521017e242f007c.tar.bz2 |
New geiser-mode command: geiser-exit-repl
Useful specially for REPLs including a debugger, where you might want
to exit it from a scheme buffer. Bound by default to C-c C-q.
-rw-r--r-- | elisp/geiser-mode.el | 6 | ||||
-rw-r--r-- | elisp/geiser-repl.el | 7 |
2 files changed, 12 insertions, 1 deletions
diff --git a/elisp/geiser-mode.el b/elisp/geiser-mode.el index 4a524fd..4af9095 100644 --- a/elisp/geiser-mode.el +++ b/elisp/geiser-mode.el @@ -273,6 +273,11 @@ With prefix, try to enter the current buffer's module." (goto-char (point-max)) (pop-to-buffer b))) +(defun geiser-exit-repl () + "Issues the command `geiser-repl-exit' in this buffer's associated REPL." + (interactive) + (geiser-repl--call-in-repl #'geiser-repl-exit)) + ;;; Keys: @@ -312,6 +317,7 @@ With prefix, try to enter the current buffer's module." ("Switch to REPL and enter module" "\C-c\C-a" geiser-mode-switch-to-repl-and-enter) ("Set Scheme..." "\C-c\C-s" geiser-set-scheme) + ("Exit REPL or debugger" "\C-c\C-q" geiser-exit-repl) -- ("Edit symbol at point" "\M-." geiser-edit-symbol-at-point :enable (geiser--symbol-at-point)) diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el index 73a2f39..6f28ae8 100644 --- a/elisp/geiser-repl.el +++ b/elisp/geiser-repl.el @@ -1,6 +1,6 @@ ;;; geiser-repl.el --- Geiser's REPL -;; Copyright (C) 2009, 2010, 2011, 2012, 2013, 2015, 2016, 2018, 2019, 2020 Jose Antonio Ortega Ruiz +;; Copyright (C) 2009, 2010, 2011, 2012, 2013, 2015, 2016, 2018, 2019, 2020, 2021 Jose Antonio Ortega Ruiz ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the Modified BSD License. You should @@ -956,6 +956,11 @@ over a Unix-domain socket." (defun geiser-repl--get-arglist (impl) (or geiser-repl--arglist (geiser-repl--arglist impl))) +(defun geiser-repl--call-in-repl (cmd) + (when-let (b (geiser-repl--repl/impl geiser-impl--implementation)) + (save-window-excursion + (with-current-buffer b (funcall cmd))))) + (defun switch-to-geiser (&optional ask impl buffer) "Switch to running Geiser REPL. |