GNU bug report logs - #56393
Actually fix the long lines display bug

Previous Next

Package: emacs;

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

Date: Tue, 5 Jul 2022 08:50:02 UTC

Severity: normal

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

Bug is archived. No further changes may be made.

Full log


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

From: Gregory Heytings <gregory <at> heytings.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: gerd.moellmann <at> gmail.com, larsi <at> gnus.org, 56393 <at> debbugs.gnu.org
Subject: Re: bug#56393: Actually fix the long lines display bug
Date: Mon, 18 Jul 2022 14:00:41 +0000
[Message part 1 (text/plain, inline)]
>> Well, this happens only in buffers with long lines, and only when we 
>> are inside a long line
>
> Is the last part really guaranteed?  AFAIU, the detection of long lines 
> scans the entire buffer, so if there's a long line _anywhere_ in the 
> buffer, the narrowing is applied, even if point is in no-so-long lines.
>

That's correct, but the narrowing starts well before the visually first 
element.  So when point is inside a not-so-long line, 
get_visually_first_element will work as usual: it will not stop at a 
narrowed BOB while searching for the visually first element, or IOW it 
will never need to search until the narrowed BOB to do its job.

>
> "As expected" in what sense?  Suppose we really are in a long line, the 
> Isearch match is really outside the window, but if we use point-10000 as 
> BEGV point seems to be _inside_ the window -- in this case the feature 
> implemented in isearch-update for slow terminals will not do its thing, 
> right?
>

I just tried

emacs -Q
(setq search-slow-speed most-positive-fixnum)
C-x C-f dictionary.json
C-s aan zich

and everything worked as expected.

>> Would the following be better from your point of view?
>>
>> [...]
>
> I guess it's better, as it reduces the number of cases where the problem 
> could happen, at the price of making those cases slower.
>

Okay, I'll push that.  It seems to work as well.

>> I understand.  But note that temporarily narrowing the buffer happens 
>> only at a few well-chosen places, which are situated rather low in the 
>> abstraction layers, so the effect on other parts of the code is nil.
>
> I think I agree with everything except the "nil" part ;-)
>

There is alas no "near-nil" value in Elisp. 😉

This bug report was last modified 3 years and 33 days ago.

Previous Next


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