@@ -187,7 +187,7 @@ If the value is a function, call it with no arguments."
187
187
:initialize 'custom-initialize-default
188
188
:set (lambda (sym val )
189
189
(set-default sym val)
190
- (force-mode-line-update ))
190
+ (force-mode-line-update t ))
191
191
:group 'tab-line
192
192
:version " 27.1" )
193
193
@@ -228,7 +228,7 @@ If nil, don't show it at all."
228
228
:initialize 'custom-initialize-default
229
229
:set (lambda (sym val )
230
230
(set-default sym val)
231
- (force-mode-line-update ))
231
+ (force-mode-line-update t ))
232
232
:group 'tab-line
233
233
:version " 27.1" )
234
234
@@ -295,7 +295,8 @@ If nil, don't show it at all."
295
295
" Function to get a tab name.
296
296
The function is called with one or two arguments: the buffer or
297
297
another object whose tab's name is requested, and, optionally,
298
- the list of all tabs."
298
+ the list of all tabs. The result of this function is cached
299
+ using `tab-line-cache-key-function' ."
299
300
:type '(choice (const :tag " Buffer name"
300
301
tab-line-tab-name-buffer)
301
302
(const :tag " Truncated buffer name"
@@ -304,7 +305,7 @@ the list of all tabs."
304
305
:initialize 'custom-initialize-default
305
306
:set (lambda (sym val )
306
307
(set-default sym val)
307
- (force-mode- line-update ))
308
+ (tab- line-force- update t ))
308
309
:group 'tab-line
309
310
:version " 27.1" )
310
311
@@ -348,7 +349,9 @@ buffers always keep the original order after switching buffers.
348
349
When `tab-line-tabs-mode-buffers' , return a list of buffers
349
350
with the same major mode as the current buffer.
350
351
When `tab-line-tabs-buffer-groups' , return a list of buffers
351
- grouped by `tab-line-tabs-buffer-group-function' ."
352
+ grouped by `tab-line-tabs-buffer-group-function' .
353
+ The result of this function is cached using
354
+ `tab-line-cache-key-function' ."
352
355
:type '(choice (const :tag " Window buffers"
353
356
tab-line-tabs-window-buffers)
354
357
(const :tag " Window buffers with fixed order"
@@ -361,7 +364,7 @@ grouped by `tab-line-tabs-buffer-group-function'."
361
364
:initialize 'custom-initialize-default
362
365
:set (lambda (sym val )
363
366
(set-default sym val)
364
- (force-mode- line-update ))
367
+ (tab- line-force- update t ))
365
368
:group 'tab-line
366
369
:version " 27.1" )
367
370
@@ -404,7 +407,7 @@ as a group name."
404
407
:initialize 'custom-initialize-default
405
408
:set (lambda (sym val )
406
409
(set-default sym val)
407
- (force-mode- line-update ))
410
+ (tab- line-force- update t ))
408
411
:group 'tab-line
409
412
:version " 30.1" )
410
413
@@ -418,7 +421,7 @@ as a group name."
418
421
:initialize 'custom-initialize-default
419
422
:set (lambda (sym val )
420
423
(set-default sym val)
421
- (force-mode- line-update ))
424
+ (tab- line-force- update t ))
422
425
:group 'tab-line
423
426
:version " 30.1" )
424
427
@@ -433,7 +436,7 @@ as a group name."
433
436
:initialize 'custom-initialize-default
434
437
:set (lambda (sym val )
435
438
(set-default sym val)
436
- (force-mode- line-update ))
439
+ (tab- line-force- update t ))
437
440
:group 'tab-line
438
441
:version " 30.1" )
439
442
@@ -568,12 +571,13 @@ The function will be called two arguments: the tab whose name to format,
568
571
and the list of all the tabs; it should return the formatted tab name
569
572
to display in the tab line.
570
573
The first argument could also be a different object, for example the buffer
571
- which the tab will represent."
574
+ which the tab will represent. The result of this function is cached
575
+ using `tab-line-cache-key-function' ."
572
576
:type 'function
573
577
:initialize 'custom-initialize-default
574
578
:set (lambda (sym val )
575
579
(set-default sym val)
576
- (force-mode- line-update ))
580
+ (tab- line-force- update t ))
577
581
:group 'tab-line
578
582
:version " 28.1" )
579
583
@@ -689,6 +693,18 @@ For use in `tab-line-tab-face-functions'."
689
693
690
694
(defvar tab-line-auto-hscroll )
691
695
696
+ (defun tab-line-force-update (all )
697
+ " Force redisplay of the current buffer’s tab line.
698
+ This function also clears the tab-line cache. With optional non-nil ALL,
699
+ it clears the tab-line cache of all tab lines and forces their redisplay."
700
+ (if all
701
+ (walk-windows
702
+ (lambda (window )
703
+ (set-window-parameter window 'tab-line-cache nil ))
704
+ 'no-mini t )
705
+ (set-window-parameter nil 'tab-line-cache nil ))
706
+ (force-mode-line-update all))
707
+
692
708
(defun tab-line-cache-key-default (tabs )
693
709
" Return default list of cache keys."
694
710
(list
@@ -708,7 +724,8 @@ For use in `tab-line-tab-face-functions'."
708
724
(defvar tab-line-cache-key-function #'tab-line-cache-key-default
709
725
" Function that adds more cache keys.
710
726
It is called with one argument, a list of tabs, and should return a list
711
- of cache keys. You can use `add-function' to add more cache keys." )
727
+ of cache keys. You can use `add-function' to add more cache keys.
728
+ Also there is the function `tab-line-force-update' that clears the cache." )
712
729
713
730
(defun tab-line-format ()
714
731
" Format for displaying the tab line of the selected window."
0 commit comments