]> git.eshelyaron.com Git - emacs.git/commitdiff
Do not message for repeated enable/disable of tab-line-mode
authorJared Finder <jared@finder.org>
Tue, 21 May 2024 02:21:29 +0000 (19:21 -0700)
committerEshel Yaron <me@eshelyaron.com>
Thu, 23 May 2024 08:29:21 +0000 (10:29 +0200)
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.

(cherry picked from commit 70e7620843a22128de86e494cfe09d8e8c63f42f)

lisp/tab-line.el

index 316c87fb3ade5f1bdb8e96bf2e1233d77b533ffe..fa52ccd81aa6f12a64e88d2a00745db075853023 100644 (file)
@@ -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)