unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Tweaking save-some-buffers-action-alist
@ 2021-06-17 16:12 Sergey Organov
  2021-06-17 21:55 ` Daniel Martín
  0 siblings, 1 reply; 5+ messages in thread
From: Sergey Organov @ 2021-06-17 16:12 UTC (permalink / raw
  To: emacs-devel

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



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-06-19 12:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-17 16:12 Tweaking save-some-buffers-action-alist Sergey Organov
2021-06-17 21:55 ` Daniel Martín
2021-06-18 19:16   ` Sergey Organov
2021-06-18 23:02     ` Stefan Monnier
2021-06-19 12:31       ` Sergey Organov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).