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

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

bug#1501: Emacs 22 loses undo buffer


From: Stefan Kangas
Subject: bug#1501: Emacs 22 loses undo buffer
Date: Tue, 19 Oct 2021 18:01:43 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

tags 1501 + patch
thanks

Noam Postavsky <npostavs@gmail.com> writes:

> Stefan Kangas <stefan@marxist.se> writes:
>
>> Noam Postavsky <npostavs@gmail.com> writes:
>>
>>> Stefan Kangas <stefan@marxist.se> writes:
>>>
>>> > increase in the memory usage of each undo record, especially when
>>> > using font-lock-mode.  I'm not sure that is a serious problem, since
>>> > memory is only getting cheaper, but it might be worth investigating.
>>> > On the other hand, we could just decide that this is not worth the
>>> > effort and close this as wontfix.
>>>
>>> Hmm, it sounds like the problem might just be due to saving text
>>> properties in the undo records?  If so, maybe a simple fix is to just
>>> drop them (or drop only face and font-lock-face properties).
>>
>> Is it not worth saving also that information?
>
> Definitely not face, since it's overwritten as soon as font-lock runs.
> It's true font-lock-face can sometimes be set manually, though usually
> it's computed by font-lock rules.

This would be fairly simple to do, as in the attached patch.  But I'm
not sure that we should make this change, since both `face' and
`font-lock-face' could be used by a major mode at various times, without
getting automatically re-added by font-lock.

>From (info "(elisp) Precalculated Fontification"):

    But if the mode does not use the normal Font Lock machinery, it
    should not set the variable ‘font-lock-defaults’.  In this case the
    ‘face’ property will not be overridden, so using the ‘face’ property
    could work too.

IOW, I'm not sure that the proposed change won't introduce subtle bugs.

Other than that, we have doubled all undo limits in Emacs 27.1, so maybe
that's enough of a fix for now?

Any other opinions?

Attachment: 0001-Decrease-size-of-undo-entries.patch
Description: Text Data


reply via email to

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