unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#51558: Long mode-line-compact breaks tab-line tabs
@ 2021-11-01 19:59 Juri Linkov
  2021-11-02 13:02 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Juri Linkov @ 2021-11-01 19:59 UTC (permalink / raw)
  To: 51558

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?





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#51558: Long mode-line-compact breaks tab-line tabs
  2021-11-01 19:59 bug#51558: Long mode-line-compact breaks tab-line tabs Juri Linkov
@ 2021-11-02 13:02 ` Eli Zaretskii
  2021-11-03  8:45   ` Juri Linkov
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2021-11-02 13:02 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 51558

> From: Juri Linkov <juri@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);





^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#51558: Long mode-line-compact breaks tab-line tabs
  2021-11-02 13:02 ` Eli Zaretskii
@ 2021-11-03  8:45   ` Juri Linkov
  2021-11-03 12:59     ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Juri Linkov @ 2021-11-03  8:45 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 51558

>> 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.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#51558: Long mode-line-compact breaks tab-line tabs
  2021-11-03  8:45   ` Juri Linkov
@ 2021-11-03 12:59     ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2021-11-03 12:59 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 51558-done

> From: Juri Linkov <juri@linkov.net>
> Cc: 51558@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.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-11-03 12:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-01 19:59 bug#51558: Long mode-line-compact breaks tab-line tabs Juri Linkov
2021-11-02 13:02 ` Eli Zaretskii
2021-11-03  8:45   ` Juri Linkov
2021-11-03 12:59     ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).