mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2026-09-10 07:46:51 -04:00
vc-dir--count-outgoing: Check overlay still exists
* lisp/vc/vc-dir.el (vc-dir--count-outgoing): Check overlay still exists.
This commit is contained in:
parent
0791a547c0
commit
ed6366876c
|
|
@ -1521,14 +1521,19 @@ longer needed."
|
|||
See `vc-dir-async-header-values' for an explanation of how this function
|
||||
uses OVERLAY."
|
||||
(cl-flet ((set-overlay-text (text)
|
||||
(with-current-buffer (overlay-buffer overlay)
|
||||
;; If `vc-dir--set-header' was called again before our
|
||||
;; sentinel ran (either because we were still counting or
|
||||
;; Emacs just hadn't run the sentinel yet) then the
|
||||
;; overlay won't exist anymore.
|
||||
(when-let* ((buffer (overlay-buffer overlay)))
|
||||
(with-current-buffer buffer
|
||||
(save-excursion
|
||||
(let ((inhibit-read-only t)
|
||||
(start (overlay-start overlay)))
|
||||
(delete-region start (overlay-end overlay))
|
||||
(goto-char start)
|
||||
(insert text)
|
||||
(move-overlay overlay start (point)))))))
|
||||
(move-overlay overlay start (point))))))))
|
||||
(set-overlay-text (propertize "[counting ...]"
|
||||
'face 'vc-dir-header-value))
|
||||
;; `vc-incoming-outgoing-internal' invokes external processes
|
||||
|
|
|
|||
Loading…
Reference in a new issue