emacs-devel
[Top][All Lists]
Advanced

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

Re: disabling undo boundaries


From: Phillip Lord
Subject: Re: disabling undo boundaries
Date: Sat, 08 Aug 2015 11:01:36 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Davis Herring <address@hidden> writes:

> [I'm late to this thread, but after reading the more recent portion,
> this still seems a useful reply.]
>
>> For self-insert-command, it's more tricky, and you'd probably need to do
>> the extra manual work.  E.g. add a post-self-insert-hook which checks if
>> this self-insert-command removed the previous undo-boundary and then
>> remove it as well in the sibling buffer.  I can't see how undo.c could
>> do that for you magically, since it doesn't know that the insertions in
>> the sibling buffer are "clones" of the insertions in the main buffer,
>> nor that it's done by self-insert-command.  Another approach would be
>> for you to arrange such that your a-f-c uses self-insert-command rather
>> than `insert' when cloning the insertion from a self-insert-command, but
>> that's probably just as hard if not harder.
>
> Shouldn't it be easy to write a function (callable from Lisp) that
> emulates self-insert-command (and its special behavior w.r.t. undo),
> except that it takes a character as an argument?

That would help a little in my use case, although the
self-insert-command behaviour is a tweak for me, not a main concern.

I think that the main issue is the use of "nil" for an undo-boundary.
This makes all undo-boundaries equivalent and impossible to tag.
Something like

'(:boundary)

or

(:boundary :reason)

would be far easier, at the cost of two cons cells rather than one, at
least for a naive implementation.

Phil



reply via email to

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