]> git.eshelyaron.com Git - emacs.git/commitdiff
Respect s-s-b-default-predicate when killing terminal
authorJoão Távora <joaotavora@gmail.com>
Wed, 27 Jun 2018 13:19:00 +0000 (14:19 +0100)
committerJoão Távora <joaotavora@gmail.com>
Wed, 27 Jun 2018 13:19:38 +0000 (14:19 +0100)
Fixes: Bug#31951
* lisp/server.el (server-save-buffers-kill-terminal): Only pass
PRED=t to save-some-bufers if ARG in non-nil.

lisp/server.el

index 9eedc293a7d4b436bcaefca2b9f41da9bd4c2f6c..87942e84191b41ab289d78d81030bdaa78be0753 100644 (file)
@@ -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")))))