From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: xdisp.c: Suggestion to delete a few unused lines of code ... Date: Tue, 28 Apr 2020 22:15:24 +0300 Message-ID: <83pnbr1kxf.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="57716"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Keith David Bershatsky Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Apr 28 21:17:36 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jTVjb-000Eux-TC for ged-emacs-devel@m.gmane-mx.org; Tue, 28 Apr 2020 21:17:35 +0200 Original-Received: from localhost ([::1]:46062 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTVja-0006ox-Nu for ged-emacs-devel@m.gmane-mx.org; Tue, 28 Apr 2020 15:17:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57090) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTVhq-0004zW-7p for emacs-devel@gnu.org; Tue, 28 Apr 2020 15:15:51 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:38751) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTVhp-0004yB-Gu; Tue, 28 Apr 2020 15:15:45 -0400 Original-Received: from [176.228.60.248] (port=4252 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jTVho-0002dJ-Kb; Tue, 28 Apr 2020 15:15:45 -0400 In-Reply-To: (message from Keith David Bershatsky on Tue, 28 Apr 2020 11:46:26 -0700) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:248041 Archived-At: > Date: Tue, 28 Apr 2020 11:46:26 -0700 > From: Keith David Bershatsky > > 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.