From: Marcin Borkowski <mbork@mbork.pl>
To: Emanuel Berg <moasenwood@zoho.eu>
Cc: help-gnu-emacs@gnu.org
Subject: Re: A strange issue with buffer-undo-list
Date: Mon, 08 Mar 2021 22:43:15 +0100 [thread overview]
Message-ID: <87a6rdiaoc.fsf@mbork.pl> (raw)
In-Reply-To: <874ki090ms.fsf@zoho.eu>
On 2021-02-25, at 06:28, Emanuel Berg via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> wrote:
> Marcin Borkowski wrote:
>
>>>> Is there a way to get the "state" of the change group to
>>>> only cancel it if it was not finished?
>>>
>>> I think yes, it's called `atomic-change-group' - see how
>>> that macro is implemented.
>>
>> Ah, that's simple and clever. Thank you.
>>
>> Still, these "change groups" seem a strange feature to me -
>> they are hardly ever used in Emacs itself, right?
>
> Maybe people just don't understand the docstring:
>
> Like ‘progn’ but perform BODY as an atomic change group.
> This means that if BODY exits abnormally, all of its changes
> to the current buffer are undone. This works regardless of
> whether undo is enabled in the buffer.
>
> This mechanism is transparent to ordinary use of undo;
> if undo is enabled in the buffer and BODY succeeds, the
> user can undo the change normally.
Well, I understand that. But isn't it strange that almost no code in
Emacs itself uses this?
Best,
--
Marcin Borkowski
http://mbork.pl
next prev parent reply other threads:[~2021-03-08 21:43 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-23 5:19 A strange issue with buffer-undo-list Marcin Borkowski
2021-02-24 0:43 ` Michael Heerdegen
2021-02-25 5:16 ` Marcin Borkowski
2021-02-25 5:28 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-02-25 14:19 ` Stefan Monnier
2021-02-25 15:58 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-03-08 21:43 ` Marcin Borkowski [this message]
2021-02-26 0:53 ` Michael Heerdegen
2021-03-08 21:42 ` Marcin Borkowski
2021-03-09 0:32 ` Michael Heerdegen
2021-03-09 21:22 ` Marcin Borkowski
2021-02-24 2:11 ` Michael Heerdegen
2021-02-24 3:33 ` Michael Heerdegen
2021-02-24 4:49 ` Stefan Monnier
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a6rdiaoc.fsf@mbork.pl \
--to=mbork@mbork.pl \
--cc=help-gnu-emacs@gnu.org \
--cc=moasenwood@zoho.eu \
/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.
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).