Subject: Re: bug#68765: 30.0.50; Adding window-tool-bar package.

From: Jared Finder <[email-masked]>
Date: Mon, 20 May 2024 19:25:49 -0700

On 2024-05-20 10:14, Juri Linkov wrote:
>>> I think after these patches are applied, the remaining work to 
>>> resolve this
>>> would be having the ELPA package added and me updating NEWS and the 
>>> manual.
>>> I can start on the updates.
>> 
>> Thanks, the changes in tab-line.el look nice.
> 
> Oh, for some reason now a lot of messages are displayed while restoring
> the desktop where tab-line-mode is saved for every buffer:
> 
> tab-line-format set outside of tab-line-mode, currently ‘(:eval 
> (tab-line-format))’
> ...
> tab-line-format set outside of tab-line-mode, currently ‘(:eval 
> (tab-line-format))’ [2 times]
> ...
> tab-line-format set outside of tab-line-mode, currently ‘(:eval 
> (tab-line-format))’
> ...
> tab-line-format set outside of tab-line-mode, currently ‘(:eval 
> (tab-line-format))’ [8 times]
> ...
> tab-line-format set outside of tab-line-mode, currently ‘(:eval 
> (tab-line-format))’ [35 times]

Sorry about that.  Fix attached.

   -- MJF

From 7b1638f27b130ed7088a7e6dee9e67396bab84b7 Mon Sep 17 00:00:00 2001
From: Jared Finder <[email-masked]>
Date: Mon, 20 May 2024 19:21:29 -0700
Subject: [PATCH] Do not message for repeated enable/disable of mode

tab-line-mode should not inform the user of an unexpected change
when enabling the mode if already enabled.  For example, when
running (tab-line-mode 1) repeatedly.
* lisp/tab-line.el (tab-line-mode): Modify case when user is
informed.
---
 lisp/tab-line.el | 19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/lisp/tab-line.el b/lisp/tab-line.el
index 316c87fb3ad..fa52ccd81aa 100644
--- a/lisp/tab-line.el
+++ b/lisp/tab-line.el
@@ -1122,19 +1122,14 @@ tab-line-mode
   "Toggle display of tab line in the windows displaying the current buffer."
   :lighter nil
   (let ((default-value '(:eval (tab-line-format))))
-    (if tab-line-mode
-        ;; Preserve the existing tab-line set outside of this mode
-        (if (null tab-line-format)
+    ;; Preserve the existing tab-line set outside of this mode
+    (if (or (null tab-line-format)
+            (equal tab-line-format default-value))
+        (if tab-line-mode
             (setq tab-line-format default-value)
-          (message
-           "tab-line-format set outside of tab-line-mode, currently `%S'"
-           tab-line-format))
-      ;; Reset only values set by this mode
-      (if (equal tab-line-format default-value)
-          (setq tab-line-format nil)
-        (message
-         "tab-line-format set outside of tab-line-mode, currently `%S'"
-         tab-line-format)))))
+          (setq tab-line-format nil))
+      (message "tab-line-format set outside of tab-line-mode, currently `%S'"
+               tab-line-format))))
 
 (defcustom tab-line-exclude-modes
   '(completion-list-mode)
-- 
2.39.2