aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/tab-line.el17
1 files changed, 10 insertions, 7 deletions
diff --git a/lisp/tab-line.el b/lisp/tab-line.el
index d080da1867d..914cf13246a 100644
--- a/lisp/tab-line.el
+++ b/lisp/tab-line.el
@@ -417,8 +417,7 @@ variable `tab-line-tabs-function'."
417 417
418(defun tab-line-format-template (tabs) 418(defun tab-line-format-template (tabs)
419 "Template for displaying tab line for selected window." 419 "Template for displaying tab line for selected window."
420 (let* ((window (selected-window)) 420 (let* ((selected-buffer (window-buffer))
421 (selected-buffer (window-buffer window))
422 (separator (or tab-line-separator (if window-system " " "|"))) 421 (separator (or tab-line-separator (if window-system " " "|")))
423 (hscroll (window-parameter nil 'tab-line-hscroll)) 422 (hscroll (window-parameter nil 'tab-line-hscroll))
424 (strings 423 (strings
@@ -471,11 +470,15 @@ variable `tab-line-tabs-function'."
471 470
472(defun tab-line-format () 471(defun tab-line-format ()
473 "Template for displaying tab line for selected window." 472 "Template for displaying tab line for selected window."
474 (let ((tabs (funcall tab-line-tabs-function)) 473 (let* ((tabs (funcall tab-line-tabs-function))
475 (cache (window-parameter nil 'tab-line-cache))) 474 (cache-key (list tabs
476 (or (and cache (equal (car cache) tabs) (cdr cache)) 475 (window-buffer)
477 (cdr (set-window-parameter nil 'tab-line-cache 476 (window-parameter nil 'tab-line-hscroll)))
478 (cons tabs (tab-line-format-template tabs))))))) 477 (cache (window-parameter nil 'tab-line-cache)))
478 (or (and cache (equal (car cache) cache-key) (cdr cache))
479 (cdr (set-window-parameter
480 nil 'tab-line-cache
481 (cons cache-key (tab-line-format-template tabs)))))))
479 482
480 483
481(defcustom tab-line-auto-hscroll t 484(defcustom tab-line-auto-hscroll t