emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 70e7620843a: Do not message for repeated enable/disable of tab-li


From: Juri Linkov
Subject: master 70e7620843a: Do not message for repeated enable/disable of tab-line-mode
Date: Tue, 21 May 2024 02:11:46 -0400 (EDT)

branch: master
commit 70e7620843a22128de86e494cfe09d8e8c63f42f
Author: Jared Finder <jared@finder.org>
Commit: Juri Linkov <juri@linkov.net>

    Do not message for repeated enable/disable of tab-line-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 (bug#68765).
    
    * 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 @@ However, return the correct mouse position list if 
EVENT is a
   "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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]