GNU bug report logs - #47893
27.1; `display-line-numbers-mode`, line numbers hidden with multiline overlays

Previous Next

Package: emacs;

Reported by: Daniel Mendler <mail <at> daniel-mendler.de>

Date: Mon, 19 Apr 2021 14:47:02 UTC

Severity: normal

Found in version 27.1

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 47893 in the body.
You can then email your comments to 47893 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#47893; Package emacs. (Mon, 19 Apr 2021 14:47:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Daniel Mendler <mail <at> daniel-mendler.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 19 Apr 2021 14:47:02 GMT) Full text and rfc822 format available.

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

From: Daniel Mendler <mail <at> daniel-mendler.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.1; `display-line-numbers-mode`, line numbers hidden with multiline
 overlays
Date: Mon, 19 Apr 2021 16:46:16 +0200
When putting an overlay over multiple lines, the line numbers of
`display-line-numbers-mode` are hidden.

(defun bug ()
  (display-line-numbers-mode)
  (goto-char (point-min))
  (let ((ov (make-overlay (line-beginning-position)
                          (save-excursion (forward-line 4)
                                          (line-beginning-position)))))
    (overlay-put ov 'invisible t)
    (overlay-put ov 'before-string "line1\nline2\nline3\line3\nline4\n")))

I've also observed the issue with Emacs 28.

In GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.5, 
cairo version 1.16.0)
 of 2021-02-09, modified by Debian built on 3df710f593d9
Repository revision: b0229d4bbaea7fcddffced393512c650212830db
Repository branch: deb/emacs/d/sid/master
Windowing system distributor 'The X.Org Foundation', version 11.0.12004000
System Description: Debian GNU/Linux 10 (buster)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47893; Package emacs. (Mon, 19 Apr 2021 14:56:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Daniel Mendler <mail <at> daniel-mendler.de>
Cc: 47893 <at> debbugs.gnu.org
Subject: Re: bug#47893: 27.1;
 `display-line-numbers-mode`, line numbers hidden with multiline
 overlays
Date: Mon, 19 Apr 2021 17:55:14 +0300
> From: Daniel Mendler <mail <at> daniel-mendler.de>
> Date: Mon, 19 Apr 2021 16:46:16 +0200
> 
> When putting an overlay over multiple lines, the line numbers of
> `display-line-numbers-mode` are hidden.
> 
> (defun bug ()
>    (display-line-numbers-mode)
>    (goto-char (point-min))
>    (let ((ov (make-overlay (line-beginning-position)
>                            (save-excursion (forward-line 4)
>                                            (line-beginning-position)))))
>      (overlay-put ov 'invisible t)
>      (overlay-put ov 'before-string "line1\nline2\nline3\line3\nline4\n")))

What do you mean by "hidden"?  With the above recipe, I see all the
line numbers starting from 5, as expected.  What is "hidden" here?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47893; Package emacs. (Mon, 19 Apr 2021 15:12:02 GMT) Full text and rfc822 format available.

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

From: Daniel Mendler <mail <at> daniel-mendler.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 47893 <at> debbugs.gnu.org
Subject: Re: bug#47893: 27.1; `display-line-numbers-mode`, line numbers hidden
 with multiline overlays
Date: Mon, 19 Apr 2021 17:10:59 +0200
On 4/19/21 4:55 PM, Eli Zaretskii wrote:
> What do you mean by "hidden"?  With the above recipe, I see all the
> line numbers starting from 5, as expected.  What is "hidden" here?

When I have a buffer with the following content:

1 a
2 b
3 c
4 d
5 e
6 f
7 g
8 h
9 i

And run the given function, I see the following:

5 line1
  line2
  line3
  line4
  e
6 f
7 g
8 h
9 i

I suppose this is expected since the overlay hides all the lines in 
between? You can close this issue then as invalid, since the display 
line numbers don't reflect the visual lines but the lines in the buffer. 
Sorry for the noise!




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Mon, 19 Apr 2021 15:30:02 GMT) Full text and rfc822 format available.

Notification sent to Daniel Mendler <mail <at> daniel-mendler.de>:
bug acknowledged by developer. (Mon, 19 Apr 2021 15:30:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Daniel Mendler <mail <at> daniel-mendler.de>
Cc: 47893-done <at> debbugs.gnu.org
Subject: Re: bug#47893: 27.1; `display-line-numbers-mode`, line numbers hidden
 with multiline overlays
Date: Mon, 19 Apr 2021 18:29:28 +0300
> Cc: 47893 <at> debbugs.gnu.org
> From: Daniel Mendler <mail <at> daniel-mendler.de>
> Date: Mon, 19 Apr 2021 17:10:59 +0200
> 
> On 4/19/21 4:55 PM, Eli Zaretskii wrote:
> > What do you mean by "hidden"?  With the above recipe, I see all the
> > line numbers starting from 5, as expected.  What is "hidden" here?
> 
> When I have a buffer with the following content:
> 
> 1 a
> 2 b
> 3 c
> 4 d
> 5 e
> 6 f
> 7 g
> 8 h
> 9 i
> 
> And run the given function, I see the following:
> 
> 5 line1
>    line2
>    line3
>    line4
>    e
> 6 f
> 7 g
> 8 h
> 9 i

Right, and this is expected.

> I suppose this is expected since the overlay hides all the lines in 
> between?

Yes, exactly.  We only show the line numbers for lines that are
displayed.  Compare with, for example, Org buffers, where we don't
show line numbers for lines that are invisible.

> You can close this issue then as invalid, since the display line
> numbers don't reflect the visual lines but the lines in the buffer.

You can have the visual line numbers as well: just set the line-number
style to 'visual'.

Closing.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 18 May 2021 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 337 days ago.

Previous Next


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