@item .
Save this buffer, then exit @code{save-some-buffers} without even asking
about other buffers.
+@item M-~
+Don't save this buffer, and also mark it as unmodified.
+This is like the @code{not-modified} command (@pxref{Save Commands}).
@item C-r
View the buffer that you are currently being asked about. When you exit
View mode, you get back to @code{save-some-buffers}, which asks the
other matching delimiters at once with Electric Pair mode, by providing
a prefix argument when inserting one of the delimiters.
++++
+** You can now use M-~ during C-x s ('save-some-buffers').
+Typing M-~ while saving some buffers means not to save the buffer and
+also to mark it as unmodified. This is an alternative way to mark a
+buffer as unmodified which doesn't require switching to that buffer.
\f
* Changes in Specialized Modes and Packages in Emacs 31.1
(defvar save-some-buffers--switch-window-callback nil)
(defvar save-some-buffers-action-alist
- `((?\C-r
+ `((?\M-~ ,(lambda (buf)
+ (with-current-buffer buf
+ (set-buffer-modified-p nil))
+ ;; Return t not to ask about BUF again.
+ t)
+ ,(purecopy "skip this buffer and mark it unmodified"))
+ (?\C-r
,(lambda (buf)
(view-buffer buf (lambda (_) (exit-recursive-edit)))
(recursive-edit)
(defun save-some-buffers (&optional arg pred)
"Save some modified file-visiting buffers. Asks user about each one.
-You can answer \\`y' or \\`SPC' to save, \\`n' or \\`DEL' not to save, \\`C-r'
+You can answer \\`y' or \\`SPC' to save, \\`n' or \\`DEL' not to save,
+\\`M-~' not to save and also mark the buffer as unmodified, \\`C-r'
to look at the buffer in question with `view-buffer' before
deciding, \\`d' to view the differences using
`diff-buffer-with-file', \\`!' to save the buffer and all remaining