emacs-devel
[Top][All Lists]
Advanced

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

Tweaking save-some-buffers-action-alist


From: Sergey Organov
Subject: Tweaking save-some-buffers-action-alist
Date: Thu, 17 Jun 2021 19:12:17 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Hello,

In this discussion:

https://lists.gnu.org/archive/html/help-gnu-emacs/2021-06/msg00165.html

I was pointed by Eli to `some-some-buffers-action-alist` as possible way
to get the feature I've asked for (revert buffer from `same-some-buffers`
prompt). I believe that this capability is really missing when
`enable-recursive-minibuffers` is nil, that is now the default.

This doesn't seem to have direct support for user-level customization,
so I came-up with the following tweak to my init.el that "works" for me,
but I'm not sure I actually do it right, so please help me with this:

#+BEGIN_SRC emacs-lisp
(nconc
 save-some-buffers-action-alist
 '((?\C-\M-g
    (lambda (buf)
      (with-current-buffer buf
        (revert-buffer)))
    "revert this buffer")))
#+END_SRC

I'm concerned as I use `nconc` that sounds unsafe, and then original
definition has some ",(" and ",(purecopy" tricks that I dunno if I need
to follow, and if so, how?

And to finally justify posting to 'emacs-devel', does it make sense to
add this capability to the default value of
`save-some-buffers-action-alist`?

To give you some more context for thoughts, not only I'm often get
annoyed myself by the absence of the feature, but I recently got this
question: "how do I discard changes to the buffer when I run `compile`
and Emacs asks me if I want to save some?" from a relatively novice
Emacs user I'm trying to help, and I really hate to answer: "no way."

Thanks,
-- Sergey Organov



reply via email to

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