Commit fe7ae74c authored by Juri Linkov's avatar Juri Linkov

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

parent 37d801a1
Pipeline #4271 failed with stage
in 78 minutes and 18 seconds
......@@ -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))
......@@ -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-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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment