GNU bug report logs - #59311
29.0.50; tab-bar global-mode-string affected by global-display-line-numbers

Previous Next

Package: emacs;

Reported by: Gabriel <gabriel376 <at> hotmail.com>

Date: Wed, 16 Nov 2022 16:11:02 UTC

Severity: normal

Found in version 29.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Gabriel <gabriel376 <at> hotmail.com>
Subject: bug#59311: closed (Re: bug#59311: 29.0.50; tab-bar
 global-mode-string affected by global-display-line-numbers)
Date: Sun, 20 Nov 2022 18:05:03 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#59311: 29.0.50; tab-bar global-mode-string affected by global-display-line-numbers

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 59311 <at> debbugs.gnu.org.

-- 
59311: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59311
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 59311-done <at> debbugs.gnu.org, gabriel376 <at> hotmail.com
Subject: Re: bug#59311: 29.0.50; tab-bar global-mode-string affected by
 global-display-line-numbers
Date: Sun, 20 Nov 2022 20:02:51 +0200
>> I still don't understand why string-pixel-width should handle line-numbers
>> that also degrades its performance.
>
> Because string-pixel-width uses a temporary buffer as its internal
> implementation detail.  (And why do you think this degrades performance? any
> measurements?)

Any additional code makes it slower.  How much slower is a separate question.

>> I think it should be sufficient only
>> to disable line-numbers in internal buffers.
>
> I think it's too late for that, since display-line-numbers-mode is with us
> for the last 2 major releases.

Leaving it as is means waiting for more trouble in other places.

>> @@ -324,7 +324,8 @@ string-pixel-width
>>      (with-current-buffer (get-buffer-create " *string-pixel-width*")
>>        (delete-region (point-min) (point-max))
>>        (insert string)
>> -      (car (buffer-text-pixel-size nil nil t)))))
>> +      (- (car (buffer-text-pixel-size nil nil t))
>> +         (line-number-display-width t)))))
>
> This is fine by me.  (Or you could turn off display-line-numbers-mode
> instead, right after with-current-buffer.)

Ok, fixed with the latter, and closed.

[Message part 3 (message/rfc822, inline)]
From: Gabriel <gabriel376 <at> hotmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50; tab-bar global-mode-string affected by
 global-display-line-numbers
Date: Wed, 16 Nov 2022 13:10:07 -0300
[Message part 4 (text/plain, inline)]
Description:

The global-mode-string is incorrectly right-aligned in the tab-bar when
global-display-line-numbers-mode is enabled.  The issue actually depends
on the order of execution of global-display-line-numbers-mode.  I could
not find an offending commit, so I am not sure for how long this issue
exists.  I am currently debugging the Emacs internals to find the root
cause.

Steps:

1) emacs -Q (master 690f7ac86ad9a9d714b1107d05c5e856a43bb18d)

2) Eval the following to enable global-display-line-numbers-mode:

(progn
  (global-display-line-numbers-mode 1))

3) Eval the following to enable display-time-mode, which at this moment
will be displayed in the mode-line:

(progn
  (setopt display-time-interval 1
          display-time-string-forms '((format-time-string "%d/%m/%Y %H:%M:%S" now)))
  (display-time-mode 1))

4) Eval the following to add global-mode-line to tab-bar, right-aligned:

(progn
  (setopt tab-bar-format '(tab-bar-format-tabs-groups
                           tab-bar-separator
                           tab-bar-format-align-right
                           tab-bar-format-global))
  (tab-bar-mode 1))

Result: the global-mode-line is displayed in the tab-bar, right-aligned,
as expected.

5) Run step 2) again

Result: the global-mode-line is displayed in the tab-bar, right-aligned,
with an incorrect padding on the right. See attached video.

[bug.mp4 (video/mp4, attachment)]
[Message part 6 (text/plain, inline)]
---
Gabriel

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

Previous Next


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