emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Change in files.el


From: Richard Stallman
Subject: Change in files.el
Date: Fri, 27 Jan 2017 21:16:05 -0500

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

Would someone please install this for me so that I don't have to
struggle with git?


log entry

Allow a default predicate for save-some-buffers.
* files.el (save-some-buffers-default-predicate): New defcustom.
(save-some-buffers): Use that predicate when nil specified.

NEWS:

** `save-some-buffers' now uses `save-some-buffers-default-predicate'
to decide which buffers to ask about, PRED is nil.

diff -u /home/rms/emacs-git/build-dec-29/lisp/files.el.\~1\~ 
/home/rms/emacs-git/build-dec-29/lisp/files.el
--- /home/rms/emacs-git/build-dec-29/lisp/files.el.~1~  2016-12-29 
05:00:58.335998032 -0500
+++ /home/rms/emacs-git/build-dec-29/lisp/files.el      2017-01-27 
09:29:16.747005021 -0500
@@ -5132,6 +5132,13 @@
   "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)
+
 (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
@@ -5147,10 +5154,13 @@
 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)
@@ -6810,6 +6820,8 @@
 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

Diff finished.  Fri Jan 27 09:29:25 2017

-- 
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]