GNU bug report logs - #60467
30.0.50; primitive-undo: Changes to be undone by function different from announced

Previous Next

Package: emacs;

Reported by: Ihor Radchenko <yantar92 <at> posteo.net>

Date: Sun, 1 Jan 2023 13:40:01 UTC

Severity: normal

Found in version 30.0.50

Done: Gregory Heytings <gregory <at> heytings.org>

Bug is archived. No further changes may be made.

Full log


Message #59 received at 60467 <at> debbugs.gnu.org (full text, mbox):

From: Gregory Heytings <gregory <at> heytings.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 60467 <at> debbugs.gnu.org, Alan Mackenzie <acm <at> muc.de>,
 Eli Zaretskii <eliz <at> gnu.org>, yantar92 <at> posteo.net
Subject: Re: bug#60467: 30.0.50; primitive-undo: Changes to be undone by
 function different from announced
Date: Wed, 04 Jan 2023 00:16:39 +0000
>>> I don't even understand what this is supposed to do.
>> 
>> Yet you happily threw it away :-(
>
> Because there are no such precautions elsewhere in the code, and the 
> comment above ("In case garbage collection has removed OLD-BUL") does 
> not explain what its purpose is.  A few lines below, old-bul is used 
> without such a precaution.  Of course, if it has a purpose, it's okay to 
> keep it.
>

I didn't remember the main reason why I removed that (cdr ptr).  The 
reason is not only that the comment above it is wrong, but also that this 
(cdr ptr) condition itself is wrong: it makes that loop stop when the last 
element of the buffer-undo-list is reached.  When buffer-undo-list is 
initially nil, (funcall body) adds a number of entries in 
buffer-undo-list, and there is no reason to exit that loop without 
processing its last element.





This bug report was last modified 1 year and 334 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.