GNU bug report logs -
#56682
Fix the long lines font locking related slowdowns
Previous Next
Full log
Message #2076 received at 56682 <at> debbugs.gnu.org (full text, mbox):
[Moved to the bug tracker.]
Thanks for your comments, Stefan!
>
> - I don't see any mention of those new features in etc/NEWS.
>
Yes, that's something I still need to do.
>
> - I can't think of a case where a piece of code could/should make use of
> `narrowing-unlock`.
>
I don't understand what you mean by that. 'narrowing-lock' locks a
narrowing, and is used e.g. in the 'with-narrowing' macro.
'narrowing-unlock' can be used to unlock a narrowing.
>
> - In `nlinum--line-number-at-pos`, I want to circumvent the narrowing
> lock due to long lines (since its performance is only affected by buffer
> size but not by line length), but I can't see how to do that. The only
> primitive I see which would let me get out of the locked narrowing is
> `narrowing-unlock` but:
>
> - I don't know which tag(s) to use.
>
That depends on the place where 'nlinum--line-number-at-pos' is called, or
IOW where/by which function the narrowing was locked, or IOW again which
tag was used to unlock the narrowing.
>
> - I don't want to remove the lock, I only want to circumvent it
> temporarily, and I can't see how to re-install a lock after removing it
> (`narrowing-lock` doesn't fit the bill because I don't know the bounds
> of the lock and because that would not preserve the stacking order of
> locks).
>
That's part of the improvements you suggested, and I implemented. Simply
do a:
(save-restriction
(narrowing-unlock 'the-appropriate-tag)
(widen)
... your code ...)
Upon return from the save-restriction, the narrowing locks are restored.
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.