GNU bug report logs - #56682
Fix the long lines font locking related slowdowns

Previous Next

Package: emacs;

Reported by: Gregory Heytings <gregory <at> heytings.org>

Date: Thu, 21 Jul 2022 18:01:01 UTC

Severity: normal

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Gregory Heytings <gregory <at> heytings.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 56682 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca, akrl <at> sdf.org
Subject: bug#56682: feature/improved-locked-narrowing 9dee6df39c: Reworked locked narrowing.
Date: Tue, 14 Feb 2023 14:59:22 +0000
>> 1. There are three places (indent.c:line_number_display_width, 
>> xdisp.c:display_count_lines_logically, fileio.c:write_region) where we 
>> currently use
>>
>> record_unwind_protect (save_restriction_restore, save_restriction_save ());
>> Fwiden ();
>
> I'm not sure these should be subject to locked narrowing.  They don't 
> present performance problems with very long lines, AFAIK.
>
>> 2. In another place (process.c:Finternal_default_process_filter) we 
>> currently have:
>>
>> /* If the output marker is outside of the visible region, save
>>     the restriction and widen.  */
>> if (! (BEGV <= PT && PT <= ZV))
>>    Fwiden ();
>>
>> (without the "save the restriction" mentioned in the comment).
>
> This should be fixed to use unwind-protect of some kind, I think, and 
> that's orthogonal to locked narrowing.
>
>> 3. Also, in Ferase_buffer, we do Fwiden to "delete the entire contents 
>> of the current buffer".
>>
>> These five places probably need to be adapted to handle labeled 
>> narrowings correctly.  If you agree with that, I'll write a patch to 
>> that effect.
>
> I'm not sure what you mean by "adapt to".  Please tell more.
>

Fwiden in the functions above (which are AFAICS the only places in Emacs 
where Fwiden is called) is not prepared to the possibility of them being 
called inside a labeled narrowing, either one installed by the long lines 
code, or another one.  Basically we need to use a variant of 
reset_outermost_narrowings (for the current buffer only) where we use

record_unwind_protect (save_restriction_restore, save_restriction_save ());





This bug report was last modified 2 years and 8 days ago.

Previous Next


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