From: Eli Zaretskii <eliz@gnu.org>
To: Keith David Bershatsky <esq@lawlist.com>
Cc: emacs-devel@gnu.org
Subject: Re: xdisp.c: Suggestion to delete a few unused lines of code ...
Date: Tue, 28 Apr 2020 22:15:24 +0300 [thread overview]
Message-ID: <83pnbr1kxf.fsf@gnu.org> (raw)
In-Reply-To: <m2k11z30u5.wl%esq@lawlist.com> (message from Keith David Bershatsky on Tue, 28 Apr 2020 11:46:26 -0700)
> Date: Tue, 28 Apr 2020 11:46:26 -0700
> From: Keith David Bershatsky <esq@lawlist.com>
>
> 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.
next prev parent reply other threads:[~2020-04-28 19:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-28 18:46 xdisp.c: Suggestion to delete a few unused lines of code Keith David Bershatsky
2020-04-28 19:15 ` Eli Zaretskii [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-04-28 18:57 Keith David Bershatsky
2020-04-28 19:34 Keith David Bershatsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83pnbr1kxf.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=esq@lawlist.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.