unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Adam Porter <adam@alphapapa.net>
Cc: emacs-devel@gnu.org
Subject: Re: tab-bar-switch-to-tab removes custom tab data?
Date: Mon, 20 Sep 2021 09:45:22 +0300	[thread overview]
Message-ID: <871r5jpxed.fsf@mail.linkov.net> (raw)
In-Reply-To: <8735q089zg.fsf@alphapapa.net> (Adam Porter's message of "Sun, 19 Sep 2021 17:40:51 -0500")

> 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.

So you want to add more metadata to a tab?
Once in the past I proposed such a feature,
but no one needed it :)  Now this could be added.

> 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.

I completely agree, this should be supported asap.



  reply	other threads:[~2021-09-20  6:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-19 22:40 tab-bar-switch-to-tab removes custom tab data? Adam Porter
2021-09-20  6:45 ` Juri Linkov [this message]
2021-09-20 15:28   ` Juri Linkov
2021-09-20 23:20     ` Adam Porter
2021-09-21 17:46       ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871r5jpxed.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=adam@alphapapa.net \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).