GNU bug report logs -
#42052
28.0.50; tab-bar-mode should be frame-local
Previous Next
Reported by: "James N. V. Cash" <james.nvc <at> gmail.com>
Date: Thu, 25 Jun 2020 21:53:02 UTC
Severity: wishlist
Tags: fixed
Fixed in version 28.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
Message #20 received at 42052 <at> debbugs.gnu.org (full text, mbox):
Juri Linkov <juri <at> linkov.net> writes:
> Please don't forget to remove this debugging message in the final patch.
Oh oops, sorry about that.
> Unlike other places that simply use (set-frame-parameter nil 'tab-bar-lines 0)
> this code is more complex. But it seems it should work with just
> (set-frame-parameter nil 'tab-bar-lines 0) as well.
Ah, right. I was thinking that
> BTW, I see a problem in the old code: the variable 'tabs' is not always updated
> and sometimes contains obsolete data. It should help to replace
>
> (<= (length tabs) tab-bar-show)
>
> with
>
> (<= (length (funcall tab-bar-tabs-function)) tab-bar-show)
>
> that gets fresh data.
That makes sense.
Here's another patch that addresses this issues, although as you say, it
still doesn't address the issue of loading the button images or changing
keybindings.
--- /home/james/src/emacs/lisp/tab-bar.el 2020-06-20 10:16:57.177037735 -0400
+++ /home/james/tmp/tab-bar.el 2020-06-28 20:15:46.073203151 -0400
@@ -799,11 +799,14 @@
(run-hook-with-args 'tab-bar-tab-post-open-functions
(nth to-index tabs)))
- (when (and (not tab-bar-mode)
- (or (eq tab-bar-show t)
- (and (natnump tab-bar-show)
- (> (length tabs) tab-bar-show))))
+ (cond
+ (tab-bar-mode)
+ ((eq tab-bar-show t)
(tab-bar-mode 1))
+ ((and (natnump tab-bar-show)
+ (> (length (funcall tab-bar-tabs-function)) tab-bar-show)
+ (zerop (frame-parameter nil 'tab-bar-lines)))
+ (set-frame-parameter nil 'tab-bar-lines 1)))
(force-mode-line-update)
(unless tab-bar-mode
@@ -936,10 +939,11 @@
tab-bar-closed-tabs)
(set-frame-parameter nil 'tabs (delq close-tab tabs)))
- (when (and tab-bar-mode
- (and (natnump tab-bar-show)
- (<= (length tabs) tab-bar-show)))
- (tab-bar-mode -1))
+ (when (and (not (zerop (frame-parameter nil 'tab-bar-lines)))
+ (natnump tab-bar-show)
+ (<= (length (funcall tab-bar-tabs-function))
+ tab-bar-show))
+ (set-frame-parameter nil 'tab-bar-lines 0))
(force-mode-line-update)
(unless tab-bar-mode
@@ -975,10 +979,11 @@
(run-hook-with-args 'tab-bar-tab-pre-close-functions (nth index tabs) nil)))
(set-frame-parameter nil 'tabs (list (nth current-index tabs)))
- (when (and tab-bar-mode
- (and (natnump tab-bar-show)
- (<= 1 tab-bar-show)))
- (tab-bar-mode -1))
+ (when (and (not (zerop (frame-parameter nil 'tab-bar-lines)))
+ (natnump tab-bar-show)
+ (<= (length (funcall tab-bar-tabs-function))
+ tab-bar-show))
+ (set-frame-parameter nil 'tab-bar-lines 0))
(force-mode-line-update)
(unless tab-bar-mode
This bug report was last modified 4 years and 138 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.