GNU bug report logs - #76760
31.0.50; Tab bar not updating on text property changes

Previous Next

Package: emacs;

Reported by: Pengji Zhang <me <at> pengjiz.com>

Date: Wed, 5 Mar 2025 09:44:01 UTC

Severity: normal

Found in version 31.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Pengji Zhang <me <at> pengjiz.com>, Juri Linkov <juri <at> linkov.net>
Cc: 76760 <at> debbugs.gnu.org
Subject: Re: bug#76760: 31.0.50; Tab bar not updating on text property changes
Date: Wed, 05 Mar 2025 15:42:41 +0200
> From: Pengji Zhang <me <at> pengjiz.com>
> Date: Wed, 05 Mar 2025 17:43:15 +0800
> 
> I found that currently a frame does not update the tab bar on text
> property changes. For example:
> 
>   - Start *GUI* Emacs with 'emacs -Q'
>   - Evaluate the following snippet:
> 
> --8<---------------cut here---------------start------------->8---
> (push #'tab-bar-format-global tab-bar-format)
> (tab-bar-mode)
> (read-passwd "Prompt: ")
> --8<---------------cut here---------------end--------------->8---
> 
>   - Press TAB while in the minibuffer.
> 
> Notice that the eye icon at the beginning of the tab bar does not change
> at all, while it should switch to the other icon.
> 
> Presumably this is due to the check starting at L14369 of 'src/xdisp.c':
> 
>     /* Redisplay the tab-bar if we changed it.  */
>     if (new_n_tab_bar != f->n_tab_bar_items
>         || NILP (Fequal (new_tab_bar, f->tab_bar_items)))
>     {...}
> 
> Text properties of strings are not examined in 'Fequal', so the old and
> the new bars are considered the same.

This can be easily modified to use equal-including-properties, as
below, but I wonder whether this perhaps could cause too-eager
redisplay of the tab bar in some cases where we don't want.  Juri,
WDYT?

diff --git a/src/xdisp.c b/src/xdisp.c
index 55c764f..b18e193 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -14368,7 +14368,8 @@ update_tab_bar (struct frame *f, bool save_match_data)
 
 	  /* Redisplay the tab-bar if we changed it.  */
 	  if (new_n_tab_bar != f->n_tab_bar_items
-	      || NILP (Fequal (new_tab_bar, f->tab_bar_items)))
+	      || NILP (Fequal_including_properties (new_tab_bar,
+						    f->tab_bar_items)))
             {
               /* Redisplay that happens asynchronously due to an expose event
                  may access f->tab_bar_items.  Make sure we update both




This bug report was last modified 77 days ago.

Previous Next


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