* lisp/tab-line.el (tab-line-cache-key-default): More cache keys (bug#60340).
Move more cache keys here from 'tab-line-format' to give users more freedom.
This commit is contained in:
parent
b164660260
commit
fd48201ffe
1 changed files with 7 additions and 7 deletions
|
@ -572,9 +572,14 @@ For use in `tab-line-tab-face-functions'."
|
||||||
|
|
||||||
(defvar tab-line-auto-hscroll)
|
(defvar tab-line-auto-hscroll)
|
||||||
|
|
||||||
(defun tab-line-cache-key-default (_tabs)
|
(defun tab-line-cache-key-default (tabs)
|
||||||
"Return default list of cache keys."
|
"Return default list of cache keys."
|
||||||
(list
|
(list
|
||||||
|
tabs
|
||||||
|
;; handle buffer renames
|
||||||
|
(buffer-name (window-buffer))
|
||||||
|
;; handle tab-line scrolling
|
||||||
|
(window-parameter nil 'tab-line-hscroll)
|
||||||
;; for setting face 'tab-line-tab-current'
|
;; for setting face 'tab-line-tab-current'
|
||||||
(mode-line-window-selected-p)
|
(mode-line-window-selected-p)
|
||||||
;; for `tab-line-tab-face-modified'
|
;; for `tab-line-tab-face-modified'
|
||||||
|
@ -591,12 +596,7 @@ of cache keys. You can use `add-function' to add more cache keys.")
|
||||||
(defun tab-line-format ()
|
(defun tab-line-format ()
|
||||||
"Format for displaying the tab line of the selected window."
|
"Format for displaying the tab line of the selected window."
|
||||||
(let* ((tabs (funcall tab-line-tabs-function))
|
(let* ((tabs (funcall tab-line-tabs-function))
|
||||||
(cache-key (append (list tabs
|
(cache-key (funcall tab-line-cache-key-function tabs))
|
||||||
;; handle buffer renames
|
|
||||||
(buffer-name (window-buffer))
|
|
||||||
;; handle tab-line scrolling
|
|
||||||
(window-parameter nil 'tab-line-hscroll))
|
|
||||||
(funcall tab-line-cache-key-function tabs)))
|
|
||||||
(cache (window-parameter nil 'tab-line-cache)))
|
(cache (window-parameter nil 'tab-line-cache)))
|
||||||
;; Enable auto-hscroll again after it was disabled on manual scrolling.
|
;; Enable auto-hscroll again after it was disabled on manual scrolling.
|
||||||
;; The moment to enable it is when the window-buffer was updated.
|
;; The moment to enable it is when the window-buffer was updated.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue