GNU bug report logs - #79291
bug when using frameset register + tab-bar

Previous Next

Package: emacs;

Reported by: Gabriel do Nascimento Ribeiro <gabriel376 <at> hotmail.com>

Date: Fri, 22 Aug 2025 15:59:01 UTC

Severity: normal

Fixed in version 31.0.50

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

To reply to this bug, email your comments to 79291 AT debbugs.gnu.org.
There is no need to reopen the bug first.

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#79291; Package emacs. (Fri, 22 Aug 2025 15:59:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Gabriel do Nascimento Ribeiro <gabriel376 <at> hotmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 22 Aug 2025 15:59:02 GMT) Full text and rfc822 format available.

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

From: Gabriel do Nascimento Ribeiro <gabriel376 <at> hotmail.com>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: bug when using frameset register + tab-bar
Date: Fri, 22 Aug 2025 15:52:59 +0000
Recipe 1: success
01) emacs -Q (commit ab577467e4feb681246a8d28afde729c6040dfc7)
02) 'M-x tab-bar-mode'
03) split some windows with 'C-x 2' and 'C-x 3'
04) save frameset to register with 'C-x r f a'
05) change window layout with 'C-x 1' and 'C-x <left>'
06) restore frameset with 'C-x r j a'
07) frameset is successfully restored
08) change window layout with 'C-x 1' and 'C-x <left>'
09) create some tabs with 'C-x t 2' and 'C-x t 2'
10) restore frameset with 'C-x r j a'
11) frameset is successfully restored

Recipe 2: bug
01) emacs -Q (commit ab577467e4feb681246a8d28afde729c6040dfc7)
02) 'M-x tab-bar-mode'
03) split some windows with 'C-x 2' and 'C-x 3'
04) save frameset to register with 'C-x r f a'
05) change window layout with 'C-x 1' and 'C-x <left>'
06) create some tabs with 'C-x t 2' and 'C-x t 2'
07) restore frameset with 'C-x r j a'
08) BUG: it shows 03 tabs, must should show only 1
09) close other tabs with 'C-x t 1'
10) change window layout with 'C-x 1' and 'C-x <left>'
11) restore frameset with 'C-x r j a'
12) BUG: it shows 03 tabs, must should show only 1

---
Gabriel




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79291; Package emacs. (Fri, 22 Aug 2025 17:13:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Gabriel do Nascimento Ribeiro <gabriel376 <at> hotmail.com>
Cc: 79291 <at> debbugs.gnu.org
Subject: Re: bug#79291: bug when using frameset register + tab-bar
Date: Fri, 22 Aug 2025 20:11:45 +0300
> From: Gabriel do Nascimento Ribeiro <gabriel376 <at> hotmail.com>
> Date: Fri, 22 Aug 2025 15:52:59 +0000
> msip_labels: 
> 
> Recipe 1: success
> 01) emacs -Q (commit ab577467e4feb681246a8d28afde729c6040dfc7)
> 02) 'M-x tab-bar-mode'
> 03) split some windows with 'C-x 2' and 'C-x 3'
> 04) save frameset to register with 'C-x r f a'
> 05) change window layout with 'C-x 1' and 'C-x <left>'
> 06) restore frameset with 'C-x r j a'
> 07) frameset is successfully restored
> 08) change window layout with 'C-x 1' and 'C-x <left>'
> 09) create some tabs with 'C-x t 2' and 'C-x t 2'
> 10) restore frameset with 'C-x r j a'
> 11) frameset is successfully restored
> 
> Recipe 2: bug
> 01) emacs -Q (commit ab577467e4feb681246a8d28afde729c6040dfc7)
> 02) 'M-x tab-bar-mode'
> 03) split some windows with 'C-x 2' and 'C-x 3'
> 04) save frameset to register with 'C-x r f a'
> 05) change window layout with 'C-x 1' and 'C-x <left>'
> 06) create some tabs with 'C-x t 2' and 'C-x t 2'
> 07) restore frameset with 'C-x r j a'
> 08) BUG: it shows 03 tabs, must should show only 1
> 09) close other tabs with 'C-x t 1'
> 10) change window layout with 'C-x 1' and 'C-x <left>'
> 11) restore frameset with 'C-x r j a'
> 12) BUG: it shows 03 tabs, must should show only 1

It's up to Juri, but up-front no one said a frameset saves also the
tab-bar configuration.  It only saves the configuration of each frame.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79291; Package emacs. (Sun, 24 Aug 2025 17:41:01 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Gabriel do Nascimento Ribeiro <gabriel376 <at> hotmail.com>
Cc: 79291 <at> debbugs.gnu.org
Subject: Re: bug#79291: bug when using frameset register + tab-bar
Date: Sun, 24 Aug 2025 20:39:13 +0300
> 01) emacs -Q (commit ab577467e4feb681246a8d28afde729c6040dfc7)
> 02) 'M-x tab-bar-mode'
> 03) split some windows with 'C-x 2' and 'C-x 3'
> 04) save frameset to register with 'C-x r f a'
> 05) change window layout with 'C-x 1' and 'C-x <left>'
> 06) create some tabs with 'C-x t 2' and 'C-x t 2'
> 07) restore frameset with 'C-x r j a'
> 08) BUG: it shows 03 tabs, must should show only 1

I don't understand where is bug?  Why should it show 1 tab?

> 09) close other tabs with 'C-x t 1'
> 10) change window layout with 'C-x 1' and 'C-x <left>'
> 11) restore frameset with 'C-x r j a'
> 12) BUG: it shows 03 tabs, must should show only 1

We need to clarify the semantics of 'C-x r f':
what it's expected for it to do with tabs?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79291; Package emacs. (Sun, 24 Aug 2025 18:09:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: gabriel376 <at> hotmail.com, 79291 <at> debbugs.gnu.org
Subject: Re: bug#79291: bug when using frameset register + tab-bar
Date: Sun, 24 Aug 2025 21:07:40 +0300
> Cc: 79291 <at> debbugs.gnu.org
> From: Juri Linkov <juri <at> linkov.net>
> Date: Sun, 24 Aug 2025 20:39:13 +0300
> 
> > 01) emacs -Q (commit ab577467e4feb681246a8d28afde729c6040dfc7)
> > 02) 'M-x tab-bar-mode'
> > 03) split some windows with 'C-x 2' and 'C-x 3'
> > 04) save frameset to register with 'C-x r f a'
> > 05) change window layout with 'C-x 1' and 'C-x <left>'
> > 06) create some tabs with 'C-x t 2' and 'C-x t 2'
> > 07) restore frameset with 'C-x r j a'
> > 08) BUG: it shows 03 tabs, must should show only 1
> 
> I don't understand where is bug?  Why should it show 1 tab?
> 
> > 09) close other tabs with 'C-x t 1'
> > 10) change window layout with 'C-x 1' and 'C-x <left>'
> > 11) restore frameset with 'C-x r j a'
> > 12) BUG: it shows 03 tabs, must should show only 1
> 
> We need to clarify the semantics of 'C-x r f':
> what it's expected for it to do with tabs?

Theoretically, tabs are not part of a frameset, so I think the
expectations here are incorrect.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79291; Package emacs. (Mon, 25 Aug 2025 06:34:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: gabriel376 <at> hotmail.com, 79291 <at> debbugs.gnu.org
Subject: Re: bug#79291: bug when using frameset register + tab-bar
Date: Mon, 25 Aug 2025 09:20:40 +0300
>> > 09) close other tabs with 'C-x t 1'
>> > 10) change window layout with 'C-x 1' and 'C-x <left>'
>> > 11) restore frameset with 'C-x r j a'
>> > 12) BUG: it shows 03 tabs, must should show only 1
>> 
>> We need to clarify the semantics of 'C-x r f':
>> what it's expected for it to do with tabs?
>
> Theoretically, tabs are not part of a frameset, so I think the
> expectations here are incorrect.

However, for example, in the desktop file tabs are part of a frameset,
and tabs are restored by restoring the frameset from the desktop file.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79291; Package emacs. (Mon, 25 Aug 2025 10:53:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: gabriel376 <at> hotmail.com, 79291 <at> debbugs.gnu.org
Subject: Re: bug#79291: bug when using frameset register + tab-bar
Date: Mon, 25 Aug 2025 13:51:45 +0300
> From: Juri Linkov <juri <at> linkov.net>
> Cc: gabriel376 <at> hotmail.com,  79291 <at> debbugs.gnu.org
> Date: Mon, 25 Aug 2025 09:20:40 +0300
> 
> >> > 09) close other tabs with 'C-x t 1'
> >> > 10) change window layout with 'C-x 1' and 'C-x <left>'
> >> > 11) restore frameset with 'C-x r j a'
> >> > 12) BUG: it shows 03 tabs, must should show only 1
> >> 
> >> We need to clarify the semantics of 'C-x r f':
> >> what it's expected for it to do with tabs?
> >
> > Theoretically, tabs are not part of a frameset, so I think the
> > expectations here are incorrect.
> 
> However, for example, in the desktop file tabs are part of a frameset,
> and tabs are restored by restoring the frameset from the desktop file.

I'm confused: if framesets support tabs and their restoration, then
why did you say that we need to clarify what "C-x r f" does with tabs?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79291; Package emacs. (Wed, 27 Aug 2025 19:56:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: gabriel376 <at> hotmail.com, 79291 <at> debbugs.gnu.org
Subject: Re: bug#79291: bug when using frameset register + tab-bar
Date: Wed, 27 Aug 2025 22:29:42 +0300
[Message part 1 (text/plain, inline)]
>> >> > 09) close other tabs with 'C-x t 1'
>> >> > 10) change window layout with 'C-x 1' and 'C-x <left>'
>> >> > 11) restore frameset with 'C-x r j a'
>> >> > 12) BUG: it shows 03 tabs, must should show only 1
>> >> 
>> >> We need to clarify the semantics of 'C-x r f':
>> >> what it's expected for it to do with tabs?
>> >
>> > Theoretically, tabs are not part of a frameset, so I think the
>> > expectations here are incorrect.
>> 
>> However, for example, in the desktop file tabs are part of a frameset,
>> and tabs are restored by restoring the frameset from the desktop file.
>
> I'm confused: if framesets support tabs and their restoration, then
> why did you say that we need to clarify what "C-x r f" does with tabs?

I don't use "C-x r f" and didn't know what it does,
so needed to look at 'frameset-to-register',
and surprisingly it uses the same 'frameset-save'
that is used by the desktop.  

But the problem is that its filters didn't use 'copy-tree'
for tabs, so any changes in tabs within the current session
also modified the data saved in the register too.

I didn't find a suitable existing filter in 'frameset-filter-params'
that uses 'copy-tree' on saving, so added a new filter ':copy-tree':

[frameset-tabs-copy-tree.patch (text/x-diff, inline)]
diff --git a/lisp/frameset.el b/lisp/frameset.el
index ee30f77c3ba..38b7e3e31a8 100644
--- a/lisp/frameset.el
+++ b/lisp/frameset.el
@@ -439,7 +439,8 @@ frameset-session-filter-alist
   (append
    '((left            . frameset-filter-iconified)
      (minibuffer      . frameset-filter-minibuffer)
-     (top             . frameset-filter-iconified))
+     (top             . frameset-filter-iconified)
+     (tabs            . :copy-tree))
    (mapcar (lambda (p) (cons p :never)) frame-internal-parameters))
   "Minimum set of parameters to filter for live (on-session) framesets.
 DO NOT MODIFY.  See `frameset-filter-alist' for a full description.")
@@ -515,6 +516,7 @@ frameset-filter-alist
 parameter), and ACTION can be:
 
  nil       The parameter is copied to FILTERED.
+ :copy-tree The parameter is copied to FILTERED with `copy-tree'.
  :never    The parameter is never copied to FILTERED.
  :save     The parameter is copied only when saving the frame.
  :restore  The parameter is copied only when restoring the frame.
@@ -686,6 +688,8 @@ frameset-filter-params
       (pcase (cdr (assq (car current) filter-alist))
 	('nil
 	 (push (if saving current (copy-tree current)) filtered))
+	(:copy-tree
+	 (push (copy-tree current) filtered))
 	(:never
 	 nil)
 	(:restore

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79291; Package emacs. (Thu, 28 Aug 2025 06:11:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: gabriel376 <at> hotmail.com, 79291 <at> debbugs.gnu.org
Subject: Re: bug#79291: bug when using frameset register + tab-bar
Date: Thu, 28 Aug 2025 09:09:29 +0300
close 79291 31.0.50
thanks

> But the problem is that its filters didn't use 'copy-tree'
> for tabs, so any changes in tabs within the current session
> also modified the data saved in the register too.
>
> I didn't find a suitable existing filter in 'frameset-filter-params'
> that uses 'copy-tree' on saving, so added a new filter ':copy-tree':

I pushed a better fix encapsulated to tab-bar.el only.




bug marked as fixed in version 31.0.50, send any further explanations to 79291 <at> debbugs.gnu.org and Gabriel do Nascimento Ribeiro <gabriel376 <at> hotmail.com> Request was from Juri Linkov <juri <at> linkov.net> to control <at> debbugs.gnu.org. (Thu, 28 Aug 2025 06:11:03 GMT) Full text and rfc822 format available.

This bug report was last modified 22 days ago.

Previous Next


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