emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tab-bar-switch-to-tab removes custom tab data?


From: Adam Porter
Subject: tab-bar-switch-to-tab removes custom tab data?
Date: Sun, 19 Sep 2021 17:40:51 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Hi Juri, et al,

I'm not sure if this is intended, or if what I'm doing is allowed, but I
noticed that after I add an association to the current tab and then use
tab-switch twice, to change tab and then change back, the association I
added is gone.

Here's the function I'm using to add the association:

  (defun burly-tab--windows-set-after-advice (&rest _ignore)
    "Set current tab's `burly-bookmark-name' to BOOKMARK-NAME.
  To be used as advice to `burly--windows-set'."
    (tab-rename burly-opened-bookmark-name)
    (let ((current-tab (tab-bar--current-tab-find)))
      (setf (alist-get 'burly-bookmark-name (cdr current-tab))
            burly-opened-bookmark-name)))

After that function is run, this:

  (tab-bar--current-tab-find)

Evaluates to:

  (current-tab
   (burly-bookmark-name .
    #("Burly: Burly.el" 0 15
      (face nil)))
   (name .
    #("Burly: Burly.el" 0 15
      (face nil)))
   (explicit-name . t))

Then after switching tabs and back, it evaluates to:

  (current-tab
   (name .
    #("Burly: Burly.el" 0 15
      (face nil)))
   (explicit-name . t))

I assumed that, since the tab is an alist, I could add my own data to
it, but maybe this is not intended.  If not, could it become so?  :)  I
could work around it by using the tab's name, but that would be less
flexible and robust.  I'd also like to store other data to tabs in the
future, and that wouldn't work as well with relying on the tab name.

--
Thanks,
Adam




reply via email to

[Prev in Thread] Current Thread [Next in Thread]