From 425822a977be6f5c9c3e0775b5cf5212f90e388f Mon Sep 17 00:00:00 2001 From: Jared Finder Date: Mon, 20 May 2024 19:21:29 -0700 Subject: [PATCH] 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. (cherry picked from commit 70e7620843a22128de86e494cfe09d8e8c63f42f) --- 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) -- 2.39.2