From unknown Sun Jun 22 11:45:53 2025 X-Loop: help-debbugs@gnu.org Subject: bug#28854: line-number-display-width erroneously returns 0 when ... Resent-From: Keith David Bershatsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Oct 2017 23:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 28854 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 28854@debbugs.gnu.org X-Debbugs-Original-To: Emacs Bug Reports Received: via spool by submit@debbugs.gnu.org id=B.150811029427003 (code B ref -1); Sun, 15 Oct 2017 23:32:02 +0000 Received: (at submit) by debbugs.gnu.org; 15 Oct 2017 23:31:34 +0000 Received: from localhost ([127.0.0.1]:42082 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3sNZ-00071R-4w for submit@debbugs.gnu.org; Sun, 15 Oct 2017 19:31:33 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46580) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3sNX-00071E-Oi for submit@debbugs.gnu.org; Sun, 15 Oct 2017 19:31:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3sNR-0004bM-JM for submit@debbugs.gnu.org; Sun, 15 Oct 2017 19:31:26 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_50,RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:46055) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e3sNR-0004b6-FW for submit@debbugs.gnu.org; Sun, 15 Oct 2017 19:31:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37549) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3sNQ-0000TQ-Dq for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2017 19:31:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3sNN-0004XJ-9r for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2017 19:31:24 -0400 Received: from gateway20.websitewelcome.com ([192.185.45.27]:15830) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e3sNN-0004Gq-1o for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2017 19:31:21 -0400 Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway20.websitewelcome.com (Postfix) with ESMTP id A7C7C400C3945 for ; Sun, 15 Oct 2017 18:31:04 -0500 (CDT) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id 3sN6eIAC7c72g3sN6eykwZ; Sun, 15 Oct 2017 18:31:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:To:From:Message-ID:Date: Sender:Reply-To:Cc: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=Lu7Vay7Frus6phvbsy/bcheik1R51/JNRDd1nFQHC1M=; b=DAaUb06abhREz2zW63ZKCj60rI fNSxKd9uqvajIh183XnXEIaG22pVAiVcT5dQPdcQIPxvldS0jdeXlYQ4KH0dOPgCyO8vf5VciKAgM OUzxfzgsXQrj9GikWdTIYpmq3rGmefV8D/4We9igHStYZdvDhQHEP+TVPD3CtY1LEOz1xrbtTkJe3 yh7PNu/UHhpSJDE4e+DEgftL46D0gk2VVjH7EOuljlKm8AsTvv7CuahKAcj1FSBcdxV/a256OzHaF SGCrjKiAeZyDJRtg9MzpYbeDzpp9UH9Nw/cEg62BpOR7yFavm3YstajwYSoeKWi85ijvK7gnjgRUt nXp0ouag==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:53189 helo=server.private) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.87) (envelope-from ) id 1e3sN5-002erg-RT for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2017 18:31:03 -0500 Date: Sun, 15 Oct 2017 16:31:03 -0700 Message-ID: From: Keith David Bershatsky MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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-Exim-ID: 1e3sN5-002erg-RT X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.private) [45.48.239.195]:53189 X-Source-Auth: lawlist X-Email-Count: 1 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.5 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.5 (----) line-number-display-width erroneously returns 0 when at the end of a very long line and `truncate-lines` is non-nil. STEP #1: Launch a current version of the master branch without any user configuration; i.e., emacs -q. STEP #2: (setq truncate-lines t) STEP #3: (display-line-numbers-mode 1) STEP #4: Create a long line that is about 3 times the width of the window. With point at the end of that line, evaluate: (line-number-display-width 'pixelwise) The result returned is 0, which is incorrect. BACKGROUND: I am working on developing crosshairs as part of feature requests #17684 and #22873, and I need the line number display width (pixelwise) to accurately calculate when the horizontal ruler should begin to draw -- i.e., it.current_x + lnum_pixel_width = start drawing ... I am also enabling compatibility with the fnctions scroll-right and scroll-left, and when horizontal scrolling the current line. Thanks, Keith From unknown Sun Jun 22 11:45:53 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Keith David Bershatsky Subject: bug#28854: closed (Re: bug#28854: line-number-display-width erroneously returns 0 when ...) Message-ID: References: <83r2u3f5rr.fsf@gnu.org> X-Gnu-PR-Message: they-closed 28854 X-Gnu-PR-Package: emacs Reply-To: 28854@debbugs.gnu.org Date: Mon, 16 Oct 2017 15:55:04 +0000 Content-Type: multipart/mixed; boundary="----------=_1508169304-10212-1" This is a multi-part message in MIME format... ------------=_1508169304-10212-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #28854: line-number-display-width erroneously returns 0 when ... which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 28854@debbugs.gnu.org. --=20 28854: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D28854 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1508169304-10212-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 28854-done) by debbugs.gnu.org; 16 Oct 2017 15:54:14 +0000 Received: from localhost ([127.0.0.1]:44053 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e47iY-0002df-G4 for submit@debbugs.gnu.org; Mon, 16 Oct 2017 11:54:14 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60887) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e47iW-0002dP-BC for 28854-done@debbugs.gnu.org; Mon, 16 Oct 2017 11:54:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e47iM-0002oe-Dw for 28854-done@debbugs.gnu.org; Mon, 16 Oct 2017 11:54:07 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:56678) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e47iM-0002oZ-9l; Mon, 16 Oct 2017 11:54:02 -0400 Received: from [176.228.60.248] (port=1990 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1e47iL-0003iQ-Kd; Mon, 16 Oct 2017 11:54:02 -0400 Date: Mon, 16 Oct 2017 18:53:44 +0300 Message-Id: <83r2u3f5rr.fsf@gnu.org> From: Eli Zaretskii To: Keith David Bershatsky In-reply-to: (message from Keith David Bershatsky on Sun, 15 Oct 2017 16:31:03 -0700) Subject: Re: bug#28854: line-number-display-width erroneously returns 0 when ... References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28854-done Cc: 28854-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > Date: Sun, 15 Oct 2017 16:31:03 -0700 > From: Keith David Bershatsky > > line-number-display-width erroneously returns 0 when at the end of a very long line and `truncate-lines` is non-nil. More accurately, when the first line visible in the window is completely hscrolled out of view. > STEP #1: Launch a current version of the master branch without any user configuration; i.e., emacs -q. > > STEP #2: (setq truncate-lines t) > > STEP #3: (display-line-numbers-mode 1) > > STEP #4: Create a long line that is about 3 times the width of the window. With point at the end of that line, evaluate: > > (line-number-display-width 'pixelwise) > > The result returned is 0, which is incorrect. Thanks, fixed on the release branch. ------------=_1508169304-10212-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 15 Oct 2017 23:31:34 +0000 Received: from localhost ([127.0.0.1]:42082 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3sNZ-00071R-4w for submit@debbugs.gnu.org; Sun, 15 Oct 2017 19:31:33 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46580) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3sNX-00071E-Oi for submit@debbugs.gnu.org; Sun, 15 Oct 2017 19:31:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3sNR-0004bM-JM for submit@debbugs.gnu.org; Sun, 15 Oct 2017 19:31:26 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_50,RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:46055) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e3sNR-0004b6-FW for submit@debbugs.gnu.org; Sun, 15 Oct 2017 19:31:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37549) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3sNQ-0000TQ-Dq for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2017 19:31:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3sNN-0004XJ-9r for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2017 19:31:24 -0400 Received: from gateway20.websitewelcome.com ([192.185.45.27]:15830) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e3sNN-0004Gq-1o for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2017 19:31:21 -0400 Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway20.websitewelcome.com (Postfix) with ESMTP id A7C7C400C3945 for ; Sun, 15 Oct 2017 18:31:04 -0500 (CDT) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id 3sN6eIAC7c72g3sN6eykwZ; Sun, 15 Oct 2017 18:31:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:To:From:Message-ID:Date: Sender:Reply-To:Cc: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=Lu7Vay7Frus6phvbsy/bcheik1R51/JNRDd1nFQHC1M=; b=DAaUb06abhREz2zW63ZKCj60rI fNSxKd9uqvajIh183XnXEIaG22pVAiVcT5dQPdcQIPxvldS0jdeXlYQ4KH0dOPgCyO8vf5VciKAgM OUzxfzgsXQrj9GikWdTIYpmq3rGmefV8D/4We9igHStYZdvDhQHEP+TVPD3CtY1LEOz1xrbtTkJe3 yh7PNu/UHhpSJDE4e+DEgftL46D0gk2VVjH7EOuljlKm8AsTvv7CuahKAcj1FSBcdxV/a256OzHaF SGCrjKiAeZyDJRtg9MzpYbeDzpp9UH9Nw/cEg62BpOR7yFavm3YstajwYSoeKWi85ijvK7gnjgRUt nXp0ouag==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:53189 helo=server.private) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.87) (envelope-from ) id 1e3sN5-002erg-RT for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2017 18:31:03 -0500 Date: Sun, 15 Oct 2017 16:31:03 -0700 Message-ID: From: Keith David Bershatsky To: Emacs Bug Reports Subject: line-number-display-width erroneously returns 0 when ... MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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-Exim-ID: 1e3sN5-002erg-RT X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.private) [45.48.239.195]:53189 X-Source-Auth: lawlist X-Email-Count: 1 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.5 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.5 (----) line-number-display-width erroneously returns 0 when at the end of a very long line and `truncate-lines` is non-nil. STEP #1: Launch a current version of the master branch without any user configuration; i.e., emacs -q. STEP #2: (setq truncate-lines t) STEP #3: (display-line-numbers-mode 1) STEP #4: Create a long line that is about 3 times the width of the window. With point at the end of that line, evaluate: (line-number-display-width 'pixelwise) The result returned is 0, which is incorrect. BACKGROUND: I am working on developing crosshairs as part of feature requests #17684 and #22873, and I need the line number display width (pixelwise) to accurately calculate when the horizontal ruler should begin to draw -- i.e., it.current_x + lnum_pixel_width = start drawing ... I am also enabling compatibility with the fnctions scroll-right and scroll-left, and when horizontal scrolling the current line. Thanks, Keith ------------=_1508169304-10212-1--