From 2cc18f93820ae22c59a038c556d3e5d8f89482cc Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Fri, 22 Nov 2013 17:50:41 +0800 Subject: [PATCH] * progmodes/octave.el (octave-kill-process): Don't ask twice Fixes: debbugs:10564 --- lisp/ChangeLog | 1 + lisp/progmodes/octave.el | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d865af7cda1..51cd2e898d1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -5,6 +5,7 @@ (octave-help-mode): Adapt to change to help-mode-finish to use derived-mode-p on 2013-09-17. (inferior-octave-prompt): Also match octave-gui. + (octave-kill-process): Don't ask twice. (Bug#10564) 2013-11-22 Leo Liu diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el index 49b5a2970d7..475f4d8d316 100644 --- a/lisp/progmodes/octave.el +++ b/lisp/progmodes/octave.el @@ -1445,12 +1445,14 @@ entered without parens)." (defun octave-kill-process () "Kill inferior Octave process and its buffer." (interactive) - (or (yes-or-no-p "Kill the inferior Octave process and its buffer? ") - (user-error "Aborted")) - (when (inferior-octave-process-live-p) - (process-send-string inferior-octave-process "quit;\n") - (accept-process-output inferior-octave-process)) - (when inferior-octave-buffer + (when (and (buffer-live-p (get-buffer inferior-octave-buffer)) + (or (yes-or-no-p (format "Kill %S and its buffer? " + inferior-octave-process)) + (user-error "Aborted"))) + (when (inferior-octave-process-live-p) + (set-process-query-on-exit-flag inferior-octave-process nil) + (process-send-string inferior-octave-process "quit;\n") + (accept-process-output inferior-octave-process)) (kill-buffer inferior-octave-buffer))) (defun octave-show-process-buffer () -- 2.39.2