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 #64 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: Fri, 11 Jul 2025 19:11:21 +0300
[Message part 1 (text/plain, inline)]
> But I understand that disabling the overall wrap around is more
> difficult since it has to be implement on a deeper level of the
> display engine.

Indeed, the required change is on a deeper level of the display engine,
but it's quite simple like in the attached patch.  I wonder is it
appropriate to reuse the existing option 'auto-resize-tab-bars'
whose new value 'truncate' will force tab-bar truncation:

[auto-resize-tab-bars-truncate.patch (text/x-diff, inline)]
diff --git a/src/xdisp.c b/src/xdisp.c
index 15a88f0868a..b3520be234f 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 (EQ (Vauto_resize_tab_bars, Qtruncate))
     {
       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.  */
@@ -37810,6 +37818,7 @@ syms_of_xdisp (void)
   DEFSYM (Qinhibit_menubar_update, "inhibit-menubar-update");
 
   DEFSYM (Qgrow_only, "grow-only");
+  DEFSYM (Qtruncate, "truncate");
   DEFSYM (Qinhibit_eval_during_redisplay, "inhibit-eval-during-redisplay");
   DEFSYM (Qposition, "position");
   DEFSYM (Qbuffer_position, "buffer-position");
@@ -38173,7 +38182,9 @@ syms_of_xdisp (void)
 that is needed to make all tab-bar items visible.
 If value is `grow-only', the tab-bar's height is only increased
 automatically; to decrease the tab-bar height, use \\[recenter],
-after setting `recenter-redisplay' to the value of t.  */);
+after setting `recenter-redisplay' to the value of t.
+If value is `truncate', the tab-bar is truncated, and only
+the first line of a long tab-bar is displayed.  */);
   Vauto_resize_tab_bars = Qt;
 
   DEFVAR_BOOL ("auto-raise-tab-bar-buttons", auto_raise_tab_bar_buttons_p,

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.