summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorJoão Távora <joaotavora@gmail.com>2018-06-27 14:19:00 +0100
committerJoão Távora <joaotavora@gmail.com>2018-06-27 14:19:38 +0100
commitce54573dacaeb234ac006b71cbaafe1c543515f1 (patch)
tree84c0b236691dcd5174b9c22fc4e118dbd3d1f13f /lisp
parent5924259f152260551e2d153e1273ab600ccda293 (diff)
downloademacs-ce54573dacaeb234ac006b71cbaafe1c543515f1.tar.gz
Respect s-s-b-default-predicate when killing terminal
Fixes: Bug#31951 * lisp/server.el (server-save-buffers-kill-terminal): Only pass PRED=t to save-some-bufers if ARG in non-nil.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/server.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/server.el b/lisp/server.el
index 9eedc293a7d..87942e84191 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -1673,13 +1673,15 @@ only these files will be asked to be saved."
(save-buffers-kill-emacs arg)))
((processp proc)
(let ((buffers (process-get proc 'buffers)))
- ;; If client is bufferless, emulate a normal Emacs exit
- ;; and offer to save all buffers. Otherwise, offer to
- ;; save only the buffers belonging to the client.
(save-some-buffers
arg (if buffers
+ ;; Only files from emacsclient file list.
(lambda () (memq (current-buffer) buffers))
- t))
+ ;; No emacsclient file list: don't override
+ ;; `save-some-buffers-default-predicate' (unless
+ ;; ARG is non-nil), since we're not killing
+ ;; Emacs (unlike `save-buffers-kill-emacs').
+ (and arg t)))
(server-delete-client proc)))
(t (error "Invalid client frame")))))