1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

* vc.el (vc-dired-hook): Speed tuning. Replace a vc-backend call

with vc-state.
This commit is contained in:
Eric S. Raymond 2008-01-01 11:17:37 +00:00
parent 1fb7205b01
commit c59a24425b
3 changed files with 36 additions and 29 deletions

View file

@ -2393,27 +2393,25 @@ Called by dired after any portion of a vc-dired buffer has been read in."
(t
(vc-dired-reformat-line nil)
(forward-line 1))))
;; try to head off calling the expensive state query -
;; Try to head off calling the expensive state query -
;; ignore object files, TeX intermediate files, and so forth.
((vc-dired-ignorable-p filename)
(dired-kill-line))
;; ordinary file -- call the (possibly expensive) state query
(t
(let ((backend (vc-backend filename)))
(cond
;; Not registered
((not backend)
(if vc-dired-terse-mode
(dired-kill-line)
(vc-dired-reformat-line "?")
(forward-line 1)))
;; Either we're in non-terse mode or it's out of date
((not (and vc-dired-terse-mode (vc-up-to-date-p filename)))
(vc-dired-reformat-line (vc-call dired-state-info filename))
(forward-line 1))
;; Remaining cases are under version control but uninteresting
(t
(dired-kill-line)))))))
;; Ordinary file -- call the (possibly expensive) state query
;;
;; First case: unregistered or unknown. (Unknown shouldn't happen here)
((member (vc-state filename) '(nil unregistered))
(if vc-dired-terse-mode
(dired-kill-line)
(vc-dired-reformat-line "?")
(forward-line 1)))
;; Either we're in non-terse mode or it's out of date
((not (and vc-dired-terse-mode (vc-up-to-date-p filename)))
(vc-dired-reformat-line (vc-call dired-state-info filename))
(forward-line 1))
;; Remaining cases are under version control but uninteresting
(t
(dired-kill-line))))
;; any other line
(t (forward-line 1))))
(vc-dired-purge))