unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ingo Lohmar <ingo.lohmar@posteo.net>
To: emacs-devel@gnu.org
Subject: Re: [BUG] Tabs and mode/header/frame-title update
Date: Sun, 20 Oct 2019 18:49:17 +0200	[thread overview]
Message-ID: <87k18zjraq.fsf@kenko.localhost.com> (raw)
In-Reply-To: <87lftfjs4w.fsf@mail.linkov.net>

On Sun, Oct 20 2019 19:31 (+0300), Juri Linkov wrote:

>> 2) However, I use tabs w/o tab-bar-mode and only looked at the code
>> above because I wondered why my frame-title (where I put the current tab
>> info) was not reliably updated when, eg, adding a tab.
>>
>> IMO, such an update is *especially* relevant when you use the functions
>> without `tab-bar-mode`.  But all calls to `force-mode-line-update` (at
>> the end of various interactive functions) are conditioned on
>> `tab-bar-mode`.
>>
>> Since this is by no means a frequent operation, I strongly suggest
>> to update the modeline(/header/title) unconditionally.
>
> I tried to reproduce this, but without `tab-bar-mode` the frame-title
> is still updated.  Maybe this somehow depends on your settings?

Possibly relevant settings:

(setq tab-bar-close-tab-select 'left
      tab-bar-new-tab-choice nil  ;"clone"
      tab-bar-tab-name-function #'tab-bar-tab-name-all
      tab-bar-show nil)           ;never auto-show

(setq frame-title-format
      '("emacs --- "
        ((bound-and-true-p wconf-string) wconf-string)
        ((bound-and-true-p tab-bar-tab-name-function)
         (:eval (format "%d: %s"
                        (tab-bar--current-tab-index)
                        (funcall tab-bar-tab-name-function))))
        (multiple-frames " %b")         ;else too busy
        (global-mode-string             ;time, load, battery?
         (" " global-mode-string))
        " "))

> Please confirm that it really updates the frame-title when you call
> `force-mode-line-update` unconditionally.  Then I will remove that condition.

Just [re-]checked: The frame title is updated immediately when I delete
a tab, but not when I add a new one.  In the latter case, typing 'M-x'
already triggers the update, as does switching tabs (back and forth), of
course.

When I change all (6) `force-mode-line-update` calls from interactive
functions and `eval-buffer` tab-bar.el, creating a new tab updates my
frame title immediately, indeed.

Mind you, I do /not/ claim that all these calls are strictly necessary;
it could be that for some of the commands the update is implied (I
honestly don't know).  But I /do/ think that /if/ there is such a call
(as in the above 6 functions), it should definitely run
independent of `tar-bar-mode`.

Thanks for your quick fix and reply!
Ingo



  reply	other threads:[~2019-10-20 16:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-20 14:26 [BUG] Tabs and mode/header/frame-title update Ingo Lohmar
2019-10-20 16:31 ` Juri Linkov
2019-10-20 16:49   ` Ingo Lohmar [this message]
2019-10-20 20:55     ` 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=87k18zjraq.fsf@kenko.localhost.com \
    --to=ingo.lohmar@posteo.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).