[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [BUG] org-copy-subtree in a file with local variables marks buffer a
From: |
Ihor Radchenko |
Subject: |
Re: [BUG] org-copy-subtree in a file with local variables marks buffer as modified [9.5.3 (release_9.5.3-6-gef41f3 @ /home/ignacio/repos/emacs/lisp/org/)] |
Date: |
Tue, 14 Jun 2022 22:05:21 +0800 |
Ignacio Casso <ignaciocasso@hotmail.com> writes:
>>> + (setq buffer-undo-list
>>> + (seq-drop-while 'identity buffer-undo-list)))))))
>>
>> This looks fragile and can be disasterous when buffer-undo-list is
>> large.
>
> I agree that it is very fragile, but could you explain why is it also
> problematic with a large `buffer-undo-list'? I guess you mean
> efficiency-wise, but it would only iterate through the few items added
> since the call to (undo-boundary). Is there something else I'm not seeing?
Simply because I saw iteration over a potentially large list. Looking
closer, you are indeed right and performance should not be a problem in
this particular scenario.
>> Maybe just use with-silent-modifications or some ideas from there (for
>> example, wrapping modifications inside let-bound (buffer-undo-list t))?
>> We should not inhibit modification hooks though. Otherwise, it will mess
>> up with caching code.
>
> Done. I attach the new patch:
LGTM!
Applied onto main via aa789b89d.
Best,
Ihor