From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.devel Subject: Re: xdisp.c: Suggestion to delete a few unused lines of code ... Date: Tue, 28 Apr 2020 12:34:31 -0700 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="22695"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Apr 28 21:39:48 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 1jTW55-0005nl-NN for ged-emacs-devel@m.gmane-mx.org; Tue, 28 Apr 2020 21:39:47 +0200 Original-Received: from localhost ([::1]:47382 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTW54-0003Lr-Kh for ged-emacs-devel@m.gmane-mx.org; Tue, 28 Apr 2020 15:39:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60644) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTW40-0001XO-ON for emacs-devel@gnu.org; Tue, 28 Apr 2020 15:38:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jTW03-00047M-Hg for emacs-devel@gnu.org; Tue, 28 Apr 2020 15:38:39 -0400 Original-Received: from gateway20.websitewelcome.com ([192.185.45.27]:46905) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jTW02-000479-Oj for emacs-devel@gnu.org; Tue, 28 Apr 2020 15:34:35 -0400 Original-Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway20.websitewelcome.com (Postfix) with ESMTP id E193D400CCC97 for ; Tue, 28 Apr 2020 13:17:00 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id TW00jWFc8EfyqTW00jLxZL; Tue, 28 Apr 2020 14:34:32 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=0+CmQub/AEozfWsE0T0eCMkkWPCyITpJsPOPcWrKRNU=; b=nM0LDZfp/ZRsqwbJOMimze3zIm YF2uzS4xKqPBA0XkbNgmPkY5hkweYcaJ+etxrX9qf8yLijNHqt6VLj2clh3AFCJ8j8dBL4VEF0wIn IqtZUHOZpkpOcfa2W2KQzbyNkIjd3BUJteX7OSs8CqnILQurPkgw6O7S7eH3UKS7xQD8cU4E0Y0IN BW0d2nNLQUFtZXzOkXSuH1Mcno25P4QaxAH2ouz2Y4Eike9sAoceVH8RSkIXyaBQwY/d6iPLjUoEM unUoT23YZmTJWGycxeiLL5Q8IGYQje40loEAFRw1ydlkFp7/oDbXqAJKlUkrMzmSjV3t/n5LHVXv4 mCjszBQA==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:50315 helo=server.private) by gator3053.hostgator.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1jTW00-000pM6-3b; Tue, 28 Apr 2020 14:34:32 -0500 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1jTW00-000pM6-3b X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.private) [45.48.239.195]:50315 X-Source-Auth: lawlist X-Email-Count: 1 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes Received-SPF: pass client-ip=192.185.45.27; envelope-from=esq@lawlist.com; helo=gateway20.websitewelcome.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/28 14:57:11 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Received-From: 192.185.45.27 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:248045 Archived-At: 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 > To: Keith David Bershatsky > Cc: emacs-devel@gnu.org > 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 > > > > 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.