diff options
Diffstat (limited to 'lisp/tab-line.el')
-rw-r--r-- | lisp/tab-line.el | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/lisp/tab-line.el b/lisp/tab-line.el index 37cfff17237..90eb84cfacd 100644 --- a/lisp/tab-line.el +++ b/lisp/tab-line.el @@ -495,6 +495,8 @@ which the tab will represent." (apply 'propertize (concat (propertize name 'keymap tab-line-tab-map + 'help-echo (if selected-p "Current tab" + "Click to select tab") ;; Don't turn mouse-1 into mouse-2 (bug#49247) 'follow-link 'ignore) (or (and (or buffer-p (assq 'buffer tab) (assq 'close tab)) @@ -798,7 +800,9 @@ Its effect is the same as using the `previous-buffer' command (if (eq tab-line-tabs-function #'tab-line-tabs-window-buffers) (switch-to-prev-buffer window) (with-selected-window (or window (selected-window)) - (let* ((tabs (funcall tab-line-tabs-function)) + (let* ((tabs (seq-filter + (lambda (tab) (or (bufferp tab) (assq 'buffer tab))) + (funcall tab-line-tabs-function))) (pos (seq-position tabs (current-buffer) (lambda (tab buffer) @@ -822,7 +826,9 @@ Its effect is the same as using the `next-buffer' command (if (eq tab-line-tabs-function #'tab-line-tabs-window-buffers) (switch-to-next-buffer window) (with-selected-window (or window (selected-window)) - (let* ((tabs (funcall tab-line-tabs-function)) + (let* ((tabs (seq-filter + (lambda (tab) (or (bufferp tab) (assq 'buffer tab))) + (funcall tab-line-tabs-function))) (pos (seq-position tabs (current-buffer) (lambda (tab buffer) @@ -899,7 +905,14 @@ sight of the tab line." (define-minor-mode tab-line-mode "Toggle display of tab line in the windows displaying the current buffer." :lighter nil - (setq tab-line-format (when tab-line-mode '(:eval (tab-line-format))))) + (let ((default-value '(:eval (tab-line-format)))) + (if tab-line-mode + ;; Preserve the existing tab-line set outside of this mode + (unless tab-line-format + (setq tab-line-format default-value)) + ;; Reset only values set by this mode + (when (equal tab-line-format default-value) + (setq tab-line-format nil))))) (defcustom tab-line-exclude-modes '(completion-list-mode) |