aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2022-12-28 19:47:52 +0200
committerJuri Linkov2022-12-28 19:47:52 +0200
commitfd48201ffe77d20729002abea63e1b6d8502d186 (patch)
tree4ef831cb379162d75b6c467917debb4ace4f87d8
parentb1646602602f40b263b2bfd5c0e5e94e8bbd412a (diff)
downloademacs-fd48201ffe77d20729002abea63e1b6d8502d186.tar.gz
emacs-fd48201ffe77d20729002abea63e1b6d8502d186.zip
* 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.
-rw-r--r--lisp/tab-line.el14
1 files changed, 7 insertions, 7 deletions
diff --git a/lisp/tab-line.el b/lisp/tab-line.el
index c4e4a688720..30612728bde 100644
--- a/lisp/tab-line.el
+++ b/lisp/tab-line.el
@@ -572,9 +572,14 @@ For use in `tab-line-tab-face-functions'."
572 572
573(defvar tab-line-auto-hscroll) 573(defvar tab-line-auto-hscroll)
574 574
575(defun tab-line-cache-key-default (_tabs) 575(defun tab-line-cache-key-default (tabs)
576 "Return default list of cache keys." 576 "Return default list of cache keys."
577 (list 577 (list
578 tabs
579 ;; handle buffer renames
580 (buffer-name (window-buffer))
581 ;; handle tab-line scrolling
582 (window-parameter nil 'tab-line-hscroll)
578 ;; for setting face 'tab-line-tab-current' 583 ;; for setting face 'tab-line-tab-current'
579 (mode-line-window-selected-p) 584 (mode-line-window-selected-p)
580 ;; for `tab-line-tab-face-modified' 585 ;; for `tab-line-tab-face-modified'
@@ -591,12 +596,7 @@ of cache keys. You can use `add-function' to add more cache keys.")
591(defun tab-line-format () 596(defun tab-line-format ()
592 "Format for displaying the tab line of the selected window." 597 "Format for displaying the tab line of the selected window."
593 (let* ((tabs (funcall tab-line-tabs-function)) 598 (let* ((tabs (funcall tab-line-tabs-function))
594 (cache-key (append (list tabs 599 (cache-key (funcall tab-line-cache-key-function tabs))
595 ;; handle buffer renames
596 (buffer-name (window-buffer))
597 ;; handle tab-line scrolling
598 (window-parameter nil 'tab-line-hscroll))
599 (funcall tab-line-cache-key-function tabs)))
600 (cache (window-parameter nil 'tab-line-cache))) 600 (cache (window-parameter nil 'tab-line-cache)))
601 ;; Enable auto-hscroll again after it was disabled on manual scrolling. 601 ;; Enable auto-hscroll again after it was disabled on manual scrolling.
602 ;; The moment to enable it is when the window-buffer was updated. 602 ;; The moment to enable it is when the window-buffer was updated.