emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: pending-undo-list is not buffer local


From: Lennart Borgman (gmail)
Subject: Re: pending-undo-list is not buffer local
Date: Sun, 22 Apr 2007 11:41:22 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070326 Thunderbird/2.0.0.0 Mnenhy/0.7.5.666

martin rudalics wrote:
 > If those calls are done in different buffers it looks like trouble to
 > me. Should not pending-undo-list be buffer local?

Not by default.  If you want to write a function which say, tries to
undo changes simultaneously in two or more buffers in some lock-step
fashion, you can always make it local yourself (and probably
`undo-in-region' as well).

 > I think for the reason above that it should be buffer local and I also
 > think that it should be permanent buffer local then.

I think this wouldn't make much sense since `buffer-undo-list' isn't
permanently buffer-local either.

Maybe this is a stupid test, but it looks like buffer-undo-list at least does not get killed by kill-all-local-variables, and that is what 'permanent-local is for:

 (let ((undo-list-copy (undo-copy-list buffer-undo-list)))
   (kill-all-local-variables)
   (equal undo-list-copy buffer-undo-list))

Too me it looks bad that pending-undo-list is not permanent buffer local. And of course all other variables that should reflect the undo state in the buffer. But it depends a bit on how they are used.

I can not think of any reason why they should not be permanent buffer local. Can anyone else?

Making the buffer local means that there is less chance mixing the values from different buffers up (though it will still be possible using with-current-buffer for example).

Making them 'permanent-local t means that they do not get killed when changing major mode. And that is good of course. Are there any other way of killing buffer local variables than calling kill-.*local-.*?




reply via email to

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