aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/files.el
diff options
context:
space:
mode:
authorAlan Mackenzie2017-02-12 10:59:03 +0000
committerAlan Mackenzie2017-02-12 10:59:03 +0000
commitf4d5b687150810129b7a1d5b006e31ccf82b691b (patch)
tree4229b13800349032697daae3904dc3773e6b7a80 /lisp/files.el
parentd5514332d4a6092673ce1f78fadcae0c57f7be64 (diff)
parent148100d98319499f0ac6f57b8be08cbd14884a5c (diff)
downloademacs-f4d5b687150810129b7a1d5b006e31ccf82b691b.tar.gz
emacs-f4d5b687150810129b7a1d5b006e31ccf82b691b.zip
Merge branch 'master' into comment-cachecomment-cache
Diffstat (limited to 'lisp/files.el')
-rw-r--r--lisp/files.el18
1 files changed, 16 insertions, 2 deletions
diff --git a/lisp/files.el b/lisp/files.el
index f60282b775a..b7d104853c3 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -3723,7 +3723,8 @@ Return the new variables list."
3723 (let* ((file-name (or (buffer-file-name) 3723 (let* ((file-name (or (buffer-file-name)
3724 ;; Handle non-file buffers, too. 3724 ;; Handle non-file buffers, too.
3725 (expand-file-name default-directory))) 3725 (expand-file-name default-directory)))
3726 (sub-file-name (if file-name 3726 (sub-file-name (if (and file-name
3727 (file-name-absolute-p file-name))
3727 ;; FIXME: Why not use file-relative-name? 3728 ;; FIXME: Why not use file-relative-name?
3728 (substring file-name (length root))))) 3729 (substring file-name (length root)))))
3729 (condition-case err 3730 (condition-case err
@@ -5133,6 +5134,14 @@ Before and after saving the buffer, this function runs
5133 "Non-nil means `save-some-buffers' should save this buffer without asking.") 5134 "Non-nil means `save-some-buffers' should save this buffer without asking.")
5134(make-variable-buffer-local 'buffer-save-without-query) 5135(make-variable-buffer-local 'buffer-save-without-query)
5135 5136
5137(defcustom save-some-buffers-default-predicate nil
5138 "Default predicate for `save-some-buffers'.
5139This allows you to stop `save-some-buffers' from asking
5140about certain files that you'd usually rather not save."
5141 :group 'auto-save
5142 :type 'function
5143 :version "26.1")
5144
5136(defun save-some-buffers (&optional arg pred) 5145(defun save-some-buffers (&optional arg pred)
5137 "Save some modified file-visiting buffers. Asks user about each one. 5146 "Save some modified file-visiting buffers. Asks user about each one.
5138You can answer `y' to save, `n' not to save, `C-r' to look at the 5147You can answer `y' to save, `n' not to save, `C-r' to look at the
@@ -5148,10 +5157,13 @@ If PRED is nil, all the file-visiting buffers are considered.
5148If PRED is t, then certain non-file buffers will also be considered. 5157If PRED is t, then certain non-file buffers will also be considered.
5149If PRED is a zero-argument function, it indicates for each buffer whether 5158If PRED is a zero-argument function, it indicates for each buffer whether
5150to consider it or not when called with that buffer current. 5159to consider it or not when called with that buffer current.
5160PRED defaults to the value of `save-some-buffers-default-predicate'.
5151 5161
5152See `save-some-buffers-action-alist' if you want to 5162See `save-some-buffers-action-alist' if you want to
5153change the additional actions you can take on files." 5163change the additional actions you can take on files."
5154 (interactive "P") 5164 (interactive "P")
5165 (unless pred
5166 (setq pred save-some-buffers-default-predicate))
5155 (save-window-excursion 5167 (save-window-excursion
5156 (let* (queried autosaved-buffers 5168 (let* (queried autosaved-buffers
5157 files-done abbrevs-done) 5169 files-done abbrevs-done)
@@ -6571,7 +6583,7 @@ normally equivalent short `-D' option is just passed on to
6571 (unless (equal switches "") 6583 (unless (equal switches "")
6572 ;; Split the switches at any spaces so we can 6584 ;; Split the switches at any spaces so we can
6573 ;; pass separate options as separate args. 6585 ;; pass separate options as separate args.
6574 (split-string switches))) 6586 (split-string-and-unquote switches)))
6575 ;; Avoid lossage if FILE starts with `-'. 6587 ;; Avoid lossage if FILE starts with `-'.
6576 '("--") 6588 '("--")
6577 (progn 6589 (progn
@@ -6811,6 +6823,8 @@ asks whether processes should be killed.
6811Runs the members of `kill-emacs-query-functions' in turn and stops 6823Runs the members of `kill-emacs-query-functions' in turn and stops
6812if any returns nil. If `confirm-kill-emacs' is non-nil, calls it." 6824if any returns nil. If `confirm-kill-emacs' is non-nil, calls it."
6813 (interactive "P") 6825 (interactive "P")
6826 ;; Don't use save-some-buffers-default-predicate, because we want
6827 ;; to ask about all the buffers before killing Emacs.
6814 (save-some-buffers arg t) 6828 (save-some-buffers arg t)
6815 (let ((confirm confirm-kill-emacs)) 6829 (let ((confirm confirm-kill-emacs))
6816 (and 6830 (and