]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/tab-line.el (tab-line-format): Add face-modified to the cache key.
authorJuri Linkov <juri@linkov.net>
Sun, 3 Oct 2021 17:13:29 +0000 (20:13 +0300)
committerJuri Linkov <juri@linkov.net>
Sun, 3 Oct 2021 17:13:29 +0000 (20:13 +0300)
When tab-line-tab-face-functions contains tab-line-tab-face-modified,
add 'buffer-modified-p' status to the cache-key, so the cache will expire
when the buffer modification status will change.
https://lists.gnu.org/archive/html/emacs-devel/2021-10/msg00129.html

lisp/tab-line.el

index 4a751b384e50fe96dec290885bbec22b4f90239c..890d1243e73d5d3836bf7fe35f5896008584dfb8 100644 (file)
@@ -574,7 +574,10 @@ For use in `tab-line-tab-face-functions'."
                           ;; handle tab-line scrolling
                           (window-parameter nil 'tab-line-hscroll)
                           ;; for setting face 'tab-line-tab-current'
-                          (eq (selected-window) (old-selected-window))))
+                          (eq (selected-window) (old-selected-window))
+                          (and (memq 'tab-line-tab-face-modified
+                                     tab-line-tab-face-functions)
+                               (buffer-file-name) (buffer-modified-p))))
          (cache (window-parameter nil 'tab-line-cache)))
     ;; Enable auto-hscroll again after it was disabled on manual scrolling.
     ;; The moment to enable it is when the window-buffer was updated.