emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-26 ee512e9: Ignore buffers whose name begins with a


From: Eric Abrahamsen
Subject: [Emacs-diffs] emacs-26 ee512e9: Ignore buffers whose name begins with a space in save-some-buffers
Date: Mon, 18 Sep 2017 16:29:54 -0400 (EDT)

branch: emacs-26
commit ee512e9a825a6dbdf438a432b75b7e18d9a983c7
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>

    Ignore buffers whose name begins with a space in save-some-buffers
    
    * lisp/files.el (save-some-buffers): Consider these buffers
      "internal", and don't prompt the user to save them.
    * doc/lispref/files.texi: Document.
---
 doc/lispref/files.texi | 9 ++++++---
 lisp/files.el          | 1 +
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index 6be998f..b1b858a 100644
--- a/doc/lispref/files.texi
+++ b/doc/lispref/files.texi
@@ -332,7 +332,9 @@ in the list @code{find-file-hook}.
 that is visiting that file---that is, the contents of the file are
 copied into the buffer and the copy is what you edit.  Changes to the
 buffer do not change the file until you @dfn{save} the buffer, which
-means copying the contents of the buffer into the file.
+means copying the contents of the buffer into the file.  Buffers which
+are not visiting a file can still be ``saved'', in a sense, using
+functions in the buffer-local @code{write-contents-functions} hook.
 
 @deffn Command save-buffer &optional backup-option
 This function saves the contents of the current buffer in its visited
@@ -365,8 +367,9 @@ With an argument of 0, unconditionally do @emph{not} make 
any backup file.
 @anchor{Definition of save-some-buffers}
 This command saves some modified file-visiting buffers.  Normally it
 asks the user about each buffer.  But if @var{save-silently-p} is
address@hidden, it saves all the file-visiting buffers without querying
-the user.
address@hidden, it saves all the file-visiting buffers without
+querying the user.  Additionally, buffers whose name begins with a
+space (``internal'' buffers) will not be offered for save.
 
 @vindex save-some-buffers-default-predicate
 The optional @var{pred} argument provides a predicate that controls
diff --git a/lisp/files.el b/lisp/files.el
index 133fed9..ff0ab70 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -5188,6 +5188,7 @@ change the additional actions you can take on files."
               (and (buffer-live-p buffer)
                    (buffer-modified-p buffer)
                     (not (buffer-base-buffer buffer))
+                    (not (eq (aref (buffer-name buffer) 0) ?\s))
                     (or
                      (buffer-file-name buffer)
                      (and pred



reply via email to

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