summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2018-06-26 12:35:39 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2018-06-26 12:40:52 +0100
commit1d8185af13108f55ca1f87d9f1843653714cb85a (patch)
tree0c0e5201a9df7586002be03624bed00418903bfa
parent7c04ac1e27ccf05c9c537f974287d16c0d348fb4 (diff)
downloadgeiser-1d8185af13108f55ca1f87d9f1843653714cb85a.tar.gz
geiser-1d8185af13108f55ca1f87d9f1843653714cb85a.tar.bz2
Not killing partial outputs when leaving the REPL
Since this job is done in the process sentinel, the clean up is also triggered when the Scheme process exits unexpectedly, deleting any traces the dying guy might have left. I added a flag to control the behaviour, but upon reflection the old behaviour seems wrong and i've defaulted to the new one. This one should fix #251.
-rw-r--r--elisp/geiser-repl.el12
1 files changed, 9 insertions, 3 deletions
diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el
index ab101e0..f61aba5 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 Jose Antonio Ortega Ruiz
+;; Copyright (C) 2009, 2010, 2011, 2012, 2013, 2015, 2016, 2018 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
@@ -128,6 +128,11 @@ second.
:type 'boolean
:group 'geiser-repl)
+(geiser-custom--defcustom geiser-repl-delete-last-output-on-exit-p nil
+ "Whether to delete partial outputs when the REPL's process exits."
+ :type 'boolean
+ :group 'geiser-repl)
+
(geiser-custom--defcustom geiser-repl-query-on-kill-p t
"Whether to prompt for confirmation when killing a REPL buffer with
a life process."
@@ -542,9 +547,10 @@ If SAVE-HISTORY is non-nil, save CMD in the REPL history."
(geiser-repl--on-quit)
(push pb geiser-repl--closed-repls)
(goto-char (point-max))
- (comint-kill-region comint-last-input-start (point))
+ (when geiser-repl-delete-last-output-on-exit-p
+ (comint-kill-region comint-last-input-start (point)))
(insert "\nIt's been nice interacting with you!\n")
- (insert "Press C-c C-z to bring me back.\n" ))))))
+ (insert "Press C-c C-z to bring me back.\n"))))))
(defun geiser-repl--on-kill ()
(geiser-repl--on-quit)