unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [BUG] Tabs and mode/header/frame-title update
@ 2019-10-20 14:26 Ingo Lohmar
  2019-10-20 16:31 ` Juri Linkov
  0 siblings, 1 reply; 4+ messages in thread
From: Ingo Lohmar @ 2019-10-20 14:26 UTC (permalink / raw)
  To: emacs-devel


Tabs are working great, but here is one minor thing I stumbled about,
and that eventually led me to a bug:

1) The bug is: at the end of `tab-bar-rename-tab`, it should read

@@ -687,7 +687,7 @@ tab-bar-rename-tab
                          (funcall tab-bar-tab-name-function))))
     (setf (cdr (assq 'name tab-to-rename)) tab-new-name
           (cdr (assq 'explicit-name tab-to-rename)) tab-explicit-name)
-    (if (tab-bar-mode)
+    (if tab-bar-mode
         (force-mode-line-update)
       (message "Renamed tab to '%s'" tab-new-name))))
 
so as not to turn on `tab-bar-mode`, but only to check its status.

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.



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

* Re: [BUG] Tabs and mode/header/frame-title update
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Juri Linkov @ 2019-10-20 16:31 UTC (permalink / raw)
  To: Ingo Lohmar; +Cc: emacs-devel

> so as not to turn on `tab-bar-mode`, but only to check its status.

This is fixed now.

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

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



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

* Re: [BUG] Tabs and mode/header/frame-title update
  2019-10-20 16:31 ` Juri Linkov
@ 2019-10-20 16:49   ` Ingo Lohmar
  2019-10-20 20:55     ` Juri Linkov
  0 siblings, 1 reply; 4+ messages in thread
From: Ingo Lohmar @ 2019-10-20 16:49 UTC (permalink / raw)
  To: emacs-devel

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



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

* Re: [BUG] Tabs and mode/header/frame-title update
  2019-10-20 16:49   ` Ingo Lohmar
@ 2019-10-20 20:55     ` Juri Linkov
  0 siblings, 0 replies; 4+ messages in thread
From: Juri Linkov @ 2019-10-20 20:55 UTC (permalink / raw)
  To: Ingo Lohmar; +Cc: emacs-devel

> Possibly relevant settings:

Thanks, frame-title-format was relevant
that helped to reproduce the problem.

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

I confirm that only 'C-x t 2' reproduces the problem, but not 'M-x tab-new'.

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

So I removed conditions from all these 6 `force-mode-line-update` calls.



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

end of thread, other threads:[~2019-10-20 20:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2019-10-20 20:55     ` 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).