From 1bdd966a4fbe0c8bd5bcb04dad5213e47a1534e6 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Tue, 26 Jun 2018 12:35:39 +0100 Subject: 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. --- elisp/geiser-repl.el | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'elisp') 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) -- cgit v1.2.3