From 7b1638f27b130ed7088a7e6dee9e67396bab84b7 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 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