unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Change in files.el
@ 2017-01-28  2:16 Richard Stallman
  2017-01-28  2:46 ` Stefan Monnier
  2017-02-04  9:18 ` Eli Zaretskii
  0 siblings, 2 replies; 33+ messages in thread
From: Richard Stallman @ 2017-01-28  2:16 UTC (permalink / raw)
  To: emacs-devel

[[[ 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.




^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2017-02-04 23:52 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-28  2:16 Change in files.el Richard Stallman
2017-01-28  2:46 ` Stefan Monnier
2017-01-28  9:10   ` Eli Zaretskii
2017-01-28 14:40     ` Stefan Monnier
2017-01-28 14:57       ` Eli Zaretskii
2017-01-28 15:31         ` Dmitry Gutov
2017-01-28 16:12           ` Eli Zaretskii
2017-01-28 15:40         ` Stefan Monnier
2017-01-28 16:08           ` Eli Zaretskii
2017-01-28 16:51             ` Stefan Monnier
2017-01-28 17:11               ` Eli Zaretskii
2017-01-28 17:22                 ` Stefan Monnier
2017-01-28 17:30                   ` Eli Zaretskii
2017-01-28 17:42                     ` Stefan Monnier
2017-01-28 17:53                       ` Eli Zaretskii
2017-01-29 18:59                         ` John Wiegley
2017-01-30  3:57                           ` Leo Liu
2017-01-30 15:58                             ` John Wiegley
2017-01-31  4:19                               ` Leo Liu
2017-01-31 14:01                                 ` John Wiegley
2017-01-31 14:46                               ` Stefan Monnier
2017-01-31 16:21                                 ` Kaushal Modi
2017-01-31 18:40                                   ` Default value of variables named `*-function' [was: Change in files.el] Drew Adams
2017-02-01  8:35                                     ` Andreas Röhler
2017-01-28 18:41                       ` Change in files.el Mark Oteiza
2017-01-28 19:37                         ` Eli Zaretskii
2017-02-01  3:49                           ` Mark Oteiza
2017-02-01  7:33                             ` Clément Pit-Claudel
2017-02-01 12:56                               ` Eli Zaretskii
2017-02-01 14:12                                 ` Kaushal Modi
2017-01-29  0:21       ` Richard Stallman
2017-02-04  9:18 ` Eli Zaretskii
2017-02-04 23:52   ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).