summaryrefslogtreecommitdiff
path: root/lisp/files.el
diff options
context:
space:
mode:
authorVibhav Pant <vibhavp@gmail.com>2017-02-05 23:08:53 +0530
committerVibhav Pant <vibhavp@gmail.com>2017-02-05 23:08:53 +0530
commitad70ca1dad26da79f0a95cc0ec687902ef20fa9b (patch)
tree732e8e9ace1fdd7aaf982f0fa5ac6c8e4eb5f7c7 /lisp/files.el
parent2db473bda8be72cf3c1e4694d70ce48f60492b0e (diff)
parent148100d98319499f0ac6f57b8be08cbd14884a5c (diff)
downloademacs-ad70ca1dad26da79f0a95cc0ec687902ef20fa9b.tar.gz
Merge remote-tracking branch 'origin/master' into feature/byte-switch
Diffstat (limited to 'lisp/files.el')
-rw-r--r--lisp/files.el15
1 files changed, 14 insertions, 1 deletions
diff --git a/lisp/files.el b/lisp/files.el
index 25392fdcc71..b7d104853c3 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -5134,6 +5134,14 @@ Before and after saving the buffer, this function runs
"Non-nil means `save-some-buffers' should save this buffer without asking.")
(make-variable-buffer-local 'buffer-save-without-query)
+(defcustom save-some-buffers-default-predicate nil
+ "Default predicate for `save-some-buffers'.
+This allows you to stop `save-some-buffers' from asking
+about certain files that you'd usually rather not save."
+ :group 'auto-save
+ :type 'function
+ :version "26.1")
+
(defun save-some-buffers (&optional arg pred)
"Save some modified file-visiting buffers. Asks user about each one.
You can answer `y' to save, `n' not to save, `C-r' to look at the
@@ -5149,10 +5157,13 @@ If PRED is nil, all the file-visiting buffers are considered.
If PRED is t, then certain non-file buffers will also be considered.
If PRED is a zero-argument function, it indicates for each buffer whether
to consider it or not when called with that buffer current.
+PRED defaults to the value of `save-some-buffers-default-predicate'.
See `save-some-buffers-action-alist' if you want to
change the additional actions you can take on files."
(interactive "P")
+ (unless pred
+ (setq pred save-some-buffers-default-predicate))
(save-window-excursion
(let* (queried autosaved-buffers
files-done abbrevs-done)
@@ -6572,7 +6583,7 @@ normally equivalent short `-D' option is just passed on to
(unless (equal switches "")
;; Split the switches at any spaces so we can
;; pass separate options as separate args.
- (split-string switches)))
+ (split-string-and-unquote switches)))
;; Avoid lossage if FILE starts with `-'.
'("--")
(progn
@@ -6812,6 +6823,8 @@ asks whether processes should be killed.
Runs the members of `kill-emacs-query-functions' in turn and stops
if any returns nil. If `confirm-kill-emacs' is non-nil, calls it."
(interactive "P")
+ ;; Don't use save-some-buffers-default-predicate, because we want
+ ;; to ask about all the buffers before killing Emacs.
(save-some-buffers arg t)
(let ((confirm confirm-kill-emacs))
(and