[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Misery with undo. Help, please!
From: |
Alan Mackenzie |
Subject: |
Re: Misery with undo. Help, please! |
Date: |
Tue, 21 Oct 2008 20:34:45 +0000 |
User-agent: |
Mutt/1.5.9i |
Hi, Andreas!
On Mon, Oct 20, 2008 at 11:49:23PM +0200, Andreas Schwab wrote:
> Alan Mackenzie <address@hidden> writes:
> > [*] Actually, it inserts an extra, spurious, nil too, or I've badly
> > misunderstood something. This seems to be a bug in the macro `push'.
> No, it isn't. The command loop automatically inserts an undo boundary.
> You should use ielm for your experiments.
Ah, thanks! How come I didn't know about ielm?
I understand what's been happening, now. While primitive-undo is busily
pulling stuff off pending-undo-list, it's piling stuff back onto
buffer-undo-list. That's not obvious from looking at the source code.
The problem, with a buffer-undo-list of (nil 6 nil ......) is that
primitive-undo piles nothing onto it, merely moving point to 6.
buffer-undo-list thus remains unaltered after C-_. This is a bug.
There seem two alternative ways to fix this:
(i) In the Elisp manual declare a buffer-undo-list of this form as
malformed, and not to be passed to `undo'.
(ii) In `undo', check for (not (car buffer-undo-list)), and strip off
the initial nil from b-u-l.
I think (ii) is better. What do others think?
> Andreas.
--
Alan Mackenzie (Nuremberg, Germany).