GNU bug report logs - #51558
Long mode-line-compact breaks tab-line tabs

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Mon, 1 Nov 2021 20:11: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 51558 in the body.
You can then email your comments to 51558 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#51558; Package emacs. (Mon, 01 Nov 2021 20:11:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juri Linkov <juri <at> linkov.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 01 Nov 2021 20:11:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: bug-gnu-emacs <at> gnu.org
Subject: Long mode-line-compact breaks tab-line tabs
Date: Mon, 01 Nov 2021 21:59:42 +0200
0. emacs -Q
1. (setq mode-line-compact 'long)
2. (global-tab-line-mode)
3. Visit more buffers in the same window
4. Click on a non-first tab on the tab-line
5. It always selects the first tab only

The click event returns a string that contains all tabs,
whereas with the default value of mode-line-compact
the event correctly contains only one tab's string.

I don't know why mode-line-compact affects the tab-line,
but maybe it should have a condition to not apply to the tab-line?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51558; Package emacs. (Tue, 02 Nov 2021 13:03:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 51558 <at> debbugs.gnu.org
Subject: Re: bug#51558: Long mode-line-compact breaks tab-line tabs
Date: Tue, 02 Nov 2021 15:02:37 +0200
> From: Juri Linkov <juri <at> linkov.net>
> Date: Mon, 01 Nov 2021 21:59:42 +0200
> 
> 0. emacs -Q
> 1. (setq mode-line-compact 'long)
> 2. (global-tab-line-mode)
> 3. Visit more buffers in the same window
> 4. Click on a non-first tab on the tab-line
> 5. It always selects the first tab only
> 
> The click event returns a string that contains all tabs,
> whereas with the default value of mode-line-compact
> the event correctly contains only one tab's string.
> 
> I don't know why mode-line-compact affects the tab-line,
> but maybe it should have a condition to not apply to the tab-line?

I think it's indeed a bug that mode-line-compact affects anything but
the mode line.  Does the patch below give good results?

diff --git a/src/xdisp.c b/src/xdisp.c
index 436153b..c05e7ed 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -25592,7 +25592,8 @@ display_mode_line (struct window *w, enum face_id face_id, Lisp_Object format)
   push_kboard (FRAME_KBOARD (it.f));
   record_unwind_save_match_data ();
 
-  if (NILP (Vmode_line_compact))
+  if (NILP (Vmode_line_compact)
+      || face_id == HEADER_LINE_FACE_ID || face_id == TAB_LINE_FACE_ID)
     {
       mode_line_target = MODE_LINE_DISPLAY;
       display_mode_element (&it, 0, 0, 0, format, Qnil, false);




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51558; Package emacs. (Wed, 03 Nov 2021 08:46:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 51558 <at> debbugs.gnu.org
Subject: Re: bug#51558: Long mode-line-compact breaks tab-line tabs
Date: Wed, 03 Nov 2021 10:45:15 +0200
>> The click event returns a string that contains all tabs,
>> whereas with the default value of mode-line-compact
>> the event correctly contains only one tab's string.
>> 
>> I don't know why mode-line-compact affects the tab-line,
>> but maybe it should have a condition to not apply to the tab-line?
>
> I think it's indeed a bug that mode-line-compact affects anything but
> the mode line.  Does the patch below give good results?

I confirm the fix, there are no more problems with it.




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Wed, 03 Nov 2021 13:00:02 GMT) Full text and rfc822 format available.

Notification sent to Juri Linkov <juri <at> linkov.net>:
bug acknowledged by developer. (Wed, 03 Nov 2021 13:00:03 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 51558-done <at> debbugs.gnu.org
Subject: Re: bug#51558: Long mode-line-compact breaks tab-line tabs
Date: Wed, 03 Nov 2021 14:59:18 +0200
> From: Juri Linkov <juri <at> linkov.net>
> Cc: 51558 <at> debbugs.gnu.org
> Date: Wed, 03 Nov 2021 10:45:15 +0200
> 
> >> The click event returns a string that contains all tabs,
> >> whereas with the default value of mode-line-compact
> >> the event correctly contains only one tab's string.
> >> 
> >> I don't know why mode-line-compact affects the tab-line,
> >> but maybe it should have a condition to not apply to the tab-line?
> >
> > I think it's indeed a bug that mode-line-compact affects anything but
> > the mode line.  Does the patch below give good results?
> 
> I confirm the fix, there are no more problems with it.

Thanks, I installed on the emacs-28 branch, and am closing the bug.




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

This bug report was last modified 3 years and 202 days ago.

Previous Next


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