[Top][All Lists]

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

Re: Undo manipulation

From: Bill Wohler
Subject: Re: Undo manipulation
Date: Thu, 14 Aug 2003 20:29:10 GMT
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.2 (gnu/linux)

Kevin Rodgers <address@hidden> writes:

> Bill Wohler wrote:
>> I don't want to add some manipulation to buffer-undo-list. For
>> example, let's say I have:
>>   1. blah
>>   2. blah
>>   xyz
>>   3. blah
>> and I want an undo to hit #3, then #2 and then #1, leaving xyz alone.
>> Are there normal ways to do this? Like inserting markers in
>> buffer-undo-list to later remove desired elements.
>> It just occurred to me that I could save buffer-undo-list into a
>> temporory variable, do my thing, and then restore the variable.
> Exactly:
> (let ((buffer-undo-list t))
>    (insert "xyz\n"))

Cool, thanks.

However, I was not pleased with the results in my case since the
ignored manipulations occurred near the top and near the bottom of the
buffer. So subsequent undos were very confused.

Here's a little more info. We have a radio button menu item that
performs these actions I've described. Currently, the undo will undo
the action stepwise, but the radio button will no longer represent
reality. Ideally, an undo would undo the entire set of actions in one
swoop, and set the radio button back to its previous setting. Is this

Otherwise, would it be better or worse for us to set buffer-undo-list
to nil to prevent the radio button from getting out of sync?

Bill Wohler <address@hidden>  GnuPG ID:610BD9AD
Maintainer of FAQ and MH-E. Vote Libertarian!
If you're passed on the right, you're in the wrong lane.

reply via email to

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