GNU bug report logs - #78953
31.0.50; tab-bar-format-align-right alignment breaks if field widths change

Previous Next

Package: emacs;

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

Date: Fri, 4 Jul 2025 06:41:02 UTC

Severity: normal

Fixed in version 31.0.50

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

Full log


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

From: Juri Linkov <juri <at> linkov.net>
To: Daniel Mendler <mail <at> daniel-mendler.de>
Cc: 78953 <at> debbugs.gnu.org
Subject: Re: bug#78953: 31.0.50; tab-bar-format-align-right alignment breaks
 if field widths change
Date: Sun, 13 Jul 2025 20:12:17 +0300
[Message part 1 (text/plain, inline)]
>> Indeed, the patch seems simple enough. I am unsure about reusing the
>> option. If I understand correctly `auto-resize-tab-bars' is about
>> resizing the height according to the face? I think we want to control
>> both things separately, truncation and resizing of the height. Therefore
>> I would rather add another option `truncate-tab-bars'. What do you
>> think?
>
> The name `auto-resize-tab-bars' was created for compatibility
> with the `auto-resize-tool-bars'.  But for new variables better
> to use the prefix `tab-bar-'.  Then the name would be `tab-bar-truncate'.

Ok, I will push the patch with the new name:

[tab-bar-truncate.patch (text/x-diff, inline)]
diff --git a/src/xdisp.c b/src/xdisp.c
index 15a88f0868a..992d162f2e3 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -14739,11 +14739,19 @@ tab_bar_height (struct frame *f, int *n_rows, bool pixelwise)
   it.paragraph_embedding = L2R;
 
   clear_glyph_row (temp_row);
-  while (!ITERATOR_AT_END_P (&it))
+  if (tab_bar_truncate)
     {
       it.glyph_row = temp_row;
       display_tab_bar_line (&it, -1);
     }
+  else
+    {
+      while (!ITERATOR_AT_END_P (&it))
+	{
+	  it.glyph_row = temp_row;
+	  display_tab_bar_line (&it, -1);
+	}
+    }
   clear_glyph_row (temp_row);
 
   /* f->n_tab_bar_rows == 0 means "unknown"; -1 means no tab-bar.  */
@@ -38209,6 +38217,10 @@ syms_of_xdisp (void)
   DEFSYM (Qmake_window_start_visible, "make-window-start-visible");
   Fmake_variable_buffer_local (Qmake_window_start_visible);
 
+  DEFVAR_BOOL ("tab-bar-truncate", tab_bar_truncate,
+    doc: /* Non-nil means truncate tab-bar and show only one line.  */);
+  tab_bar_truncate = false;
+
   DEFSYM (Qclose_tab, "close-tab");
   DEFVAR_LISP ("tab-bar-border", Vtab_bar_border,
     doc: /* Border below tab-bar in pixels.

This bug report was last modified 13 days ago.

Previous Next


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