1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-15 17:00:26 +00:00

* lisp/tab-line.el (tab-line-format): Use composite cache key (bug#38522)

This commit is contained in:
Juri Linkov 2019-12-09 00:08:53 +02:00
parent 37d801a19a
commit fe7ae74c0b

View File

@ -417,8 +417,7 @@ variable `tab-line-tabs-function'."
(defun tab-line-format-template (tabs)
"Template for displaying tab line for selected window."
(let* ((window (selected-window))
(selected-buffer (window-buffer window))
(let* ((selected-buffer (window-buffer))
(separator (or tab-line-separator (if window-system " " "|")))
(hscroll (window-parameter nil 'tab-line-hscroll))
(strings
@ -471,11 +470,15 @@ variable `tab-line-tabs-function'."
(defun tab-line-format ()
"Template for displaying tab line for selected window."
(let ((tabs (funcall tab-line-tabs-function))
(cache (window-parameter nil 'tab-line-cache)))
(or (and cache (equal (car cache) tabs) (cdr cache))
(cdr (set-window-parameter nil 'tab-line-cache
(cons tabs (tab-line-format-template tabs)))))))
(let* ((tabs (funcall tab-line-tabs-function))
(cache-key (list tabs
(window-buffer)
(window-parameter nil 'tab-line-hscroll)))
(cache (window-parameter nil 'tab-line-cache)))
(or (and cache (equal (car cache) cache-key) (cdr cache))
(cdr (set-window-parameter
nil 'tab-line-cache
(cons cache-key (tab-line-format-template tabs)))))))
(defcustom tab-line-auto-hscroll t