all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Aaron Jensen <aaronjensen@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 60340-done@debbugs.gnu.org, 60340@debbugs.gnu.org
Subject: bug#60340: 29.0.60; force-mode-line-update does not update tab line
Date: Mon, 26 Dec 2022 12:55:11 -0500	[thread overview]
Message-ID: <CAHyO48x1U4feTMduJgSOyFm0KaMkAAfwUq9NNZeB+vBBW4Ws=Q@mail.gmail.com> (raw)
In-Reply-To: <8335922j1a.fsf@gnu.org>

On Mon, Dec 26, 2022 at 12:04 PM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > From: Aaron Jensen <aaronjensen@gmail.com>
> > Date: Mon, 26 Dec 2022 11:40:33 -0500
> >
> >
> > (defun random-name (_buffer &optional _buffers)
> >   (format "tab %d" (random 1000)))
> > (setq tab-line-tab-name-function #'random-name)
> > (tab-line-mode)
> >
> > Then, eval:
> >
> > (force-mode-line-update)
> >
> > Every time that evals, I believe you should see the tab name update, but
> > it does not. This makes it impossible to change tab names without
> > changing buffer names as far as I can tell. There is likely something
> > I'm missing, but per the docs, I believe force-mode-line-update should
> > update tab lines. Passing `t' as ALL does not work either.
>
> force-mode-line-update updates what's displayed on the line, but it
> doesn't recompute tab-line-format.  And that is what you want to do:
> you customize tab-line-tab-name-function, which affects
> tab-line-format.
>
> IOW, if your format has %d, and %d formats some number which changes
> with time, then you can expect that force-mode-line-update will cause
> a different string be displayed instead of %d.  But you _cannot_
> expect that the format string which includes %d will be recalculated
> just because you called force-mode-line-update.
>
> If you want the displayed values to change when the line is
> redisplayed, you need to use :eval or somesuch.

It uses :eval out of the box. The problem was the cache as Juri pointed out.


On Mon, Dec 26, 2022 at 12:35 PM Juri Linkov <juri@linkov.net> wrote:
>
>
> (defun tab-line-cache-key-default (_tabs)
>   (list (random 1000)))

Thank you for the pointer! I can do this and it works great:

(set-window-parameter nil 'tab-line-cache nil)
(force-mode-line-update)





  reply	other threads:[~2022-12-26 17:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-26 16:40 bug#60340: 29.0.60; force-mode-line-update does not update tab line Aaron Jensen
2022-12-26 17:04 ` Eli Zaretskii
2022-12-26 17:55   ` Aaron Jensen [this message]
2022-12-28 17:49     ` Juri Linkov
2022-12-29 22:46       ` Aaron Jensen
2022-12-26 17:34 ` 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

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

  git send-email \
    --in-reply-to='CAHyO48x1U4feTMduJgSOyFm0KaMkAAfwUq9NNZeB+vBBW4Ws=Q@mail.gmail.com' \
    --to=aaronjensen@gmail.com \
    --cc=60340-done@debbugs.gnu.org \
    --cc=60340@debbugs.gnu.org \
    --cc=eliz@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.