[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: xdisp.c: Suggestion to delete a few unused lines of code ...
From: |
Keith David Bershatsky |
Subject: |
Re: xdisp.c: Suggestion to delete a few unused lines of code ... |
Date: |
Tue, 28 Apr 2020 12:34:31 -0700 |
Thank you Eli for taking the time to review and respond to this particular
thread.
You are absolutely correct!
I should have studied the code more ....
As always, your help is greatly appreciated!
Keith
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> Date: [04-28-2020 12:15:24] <28 Apr 2020 22:15:24 +0300>
> From: Eli Zaretskii <address@hidden>
> To: Keith David Bershatsky <address@hidden>
> Cc: address@hidden
> Subject: Re: xdisp.c: Suggestion to delete a few unused lines of code ...
>
> > Date: Tue, 28 Apr 2020 11:46:26 -0700
> > From: Keith David Bershatsky <address@hidden>
> >
> > In the function display_line within xdisp.c, there is the following code
> > set forth below. Inasmuch as the first main condition is whether
> > (line_number_needed), the second test within the ELSE IF statement for
> > whether (line_number_needed) will always be negative; i.e., it would have
> > to be negative or else we would never have gotten to the ELSE IF statement
> > ... since the test will always be negative, Emacs will never call
> > maybe_produce_line_number within the ELSE IF section of this code.
>
> I don't understand why you think the test will always be negative in
> the second case. The code is really
>
> bool line_number_needed = should_produce_line_number (it);
>
> if (it->current_x < it->first_visible_x + x_incr)
> {
> [...]
> if (line_number_needed)
> maybe_produce_line_number (it);
> }
> else if (it->area == TEXT_AREA)
> {
> if (line_number_needed)
> maybe_produce_line_number (it);
> [...]
> }
>
> What this says that we may need to produce the line numbers both when
> we start outside of the visible portion of the window (the 'if'
> clause) and when we start inside the visible portion.