From: Richard Stallman <rms@gnu.org>
To: emacs-devel@gnu.org
Subject: Change in files.el
Date: Fri, 27 Jan 2017 21:16:05 -0500 [thread overview]
Message-ID: <E1cXIYf-00017w-CO@fencepost.gnu.org> (raw)
[[[ 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.
next reply other threads:[~2017-01-28 2:16 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-28 2:16 Richard Stallman [this message]
2017-01-28 2:46 ` Change in files.el 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1cXIYf-00017w-CO@fencepost.gnu.org \
--to=rms@gnu.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.