all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Sergey Organov <sorganov@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org, "Daniel Martín" <mardani29@yahoo.es>
Subject: Re: Tweaking save-some-buffers-action-alist
Date: Sat, 19 Jun 2021 15:31:44 +0300	[thread overview]
Message-ID: <87wnqqm3wv.fsf@osv.gnss.ru> (raw)
In-Reply-To: <jwv35teaiaf.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Fri, 18 Jun 2021 19:02:49 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> Is `nconc` safe here, or should I `copy-seq` the original and modify
>> that instead?
>
> The general rule is: If you don't know, then it's not safe.
> [ and indeed, it's not safe in this particular case.  ]

Nice, thanks for confirming!

So I ended-up adding new item at the beginning of the list rather than
at the end:

#+BEGIN_SRC emacs-lisp
(push
  '(?R
    (lambda (buf)
      (with-current-buffer buf
        (revert-buffer)))
    "revert this buffer")
  save-some-buffers-action-alist)
#+END_SRC

And then I had to change the KEY from C-M-g to just R, as on terminal it
seems to be impossible to generate the former key-sequence from
`map-y-or-n-p`, as "ESC C-g" doesn't work as expected (ESC is simply
ignored), – yet another surprising limitation of the mode.

Thanks,
-- 
Sergey Organov



      reply	other threads:[~2021-06-19 12:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wnqqm3wv.fsf@osv.gnss.ru \
    --to=sorganov@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=mardani29@yahoo.es \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.