GNU bug report logs - #28854
line-number-display-width erroneously returns 0 when ...

Previous Next

Package: emacs;

Reported by: Keith David Bershatsky <esq <at> lawlist.com>

Date: Sun, 15 Oct 2017 23:32:02 UTC

Severity: normal

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 28854 in the body.
You can then email your comments to 28854 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#28854; Package emacs. (Sun, 15 Oct 2017 23:32:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Keith David Bershatsky <esq <at> lawlist.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 15 Oct 2017 23:32:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Keith David Bershatsky <esq <at> lawlist.com>
To: Emacs Bug Reports <bug-gnu-emacs <at> gnu.org>
Subject: line-number-display-width erroneously returns 0 when ...
Date: Sun, 15 Oct 2017 16:31:03 -0700
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




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Mon, 16 Oct 2017 15:55:03 GMT) Full text and rfc822 format available.

Notification sent to Keith David Bershatsky <esq <at> lawlist.com>:
bug acknowledged by developer. (Mon, 16 Oct 2017 15:55:04 GMT) Full text and rfc822 format available.

Message #10 received at 28854-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Keith David Bershatsky <esq <at> lawlist.com>
Cc: 28854-done <at> debbugs.gnu.org
Subject: Re: bug#28854: line-number-display-width erroneously returns 0 when
 ...
Date: Mon, 16 Oct 2017 18:53:44 +0300
> Date: Sun, 15 Oct 2017 16:31:03 -0700
> From: Keith David Bershatsky <esq <at> lawlist.com>
> 
> 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.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 14 Nov 2017 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 220 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.