unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* tab-bar-switch-to-tab removes custom tab data?
@ 2021-09-19 22:40 Adam Porter
  2021-09-20  6:45 ` Juri Linkov
  0 siblings, 1 reply; 5+ messages in thread
From: Adam Porter @ 2021-09-19 22:40 UTC (permalink / raw)
  To: emacs-devel

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




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-09-21 17:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-19 22:40 tab-bar-switch-to-tab removes custom tab data? Adam Porter
2021-09-20  6:45 ` Juri Linkov
2021-09-20 15:28   ` Juri Linkov
2021-09-20 23:20     ` Adam Porter
2021-09-21 17:46       ` Juri Linkov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).