From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Change in files.el Date: Fri, 27 Jan 2017 21:16:05 -0500 Message-ID: Reply-To: rms@gnu.org NNTP-Posting-Host: blaine.gmane.org Content-Type: text/plain; charset=Utf-8 X-Trace: blaine.gmane.org 1485569842 13704 195.159.176.226 (28 Jan 2017 02:17:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 28 Jan 2017 02:17:22 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 28 03:17:17 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXIZI-0000Kb-GX for ged-emacs-devel@m.gmane.org; Sat, 28 Jan 2017 03:16:44 +0100 Original-Received: from localhost ([::1]:49638 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cXIZL-0000qq-PO for ged-emacs-devel@m.gmane.org; Fri, 27 Jan 2017 21:16:47 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42882) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cXIYh-0000qj-6F for emacs-devel@gnu.org; Fri, 27 Jan 2017 21:16:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cXIYg-0001pw-2M for emacs-devel@gnu.org; Fri, 27 Jan 2017 21:16:07 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58124) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cXIYf-0001pq-V1 for emacs-devel@gnu.org; Fri, 27 Jan 2017 21:16:05 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1cXIYf-00017w-CO; Fri, 27 Jan 2017 21:16:05 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:211667 Archived-At: [[[ 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.