1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-09 15:50:40 -08:00

New user option: vc-allow-async-diff

Centralize the control for whether 'vc-diff' is asynchronous
across the backends, while also allowing 'vc-BACKEND-diff' to be
called asynchronously when needed.  Previously in bug#21969.

* lisp/vc/vc.el (vc-allow-async-diff): New user option.

* lisp/vc/vc.el (vc-version-diff, vc-diff, vc-diff-mergebase)
(vc-root-diff): Obey it.

* lisp/vc/log-view.el (log-view-diff-common): Same.

* lisp/vc/vc-annotate.el
(vc-annotate-show-diff-revision-at-line-internal): Same.

* lisp/vc/vc-git.el (vc-git-diff): Follow the ASYNC argument.

* lisp/vc/vc-hg.el (vc-hg-diff): Same.

* lisp/vc/vc-rcs.el (vc-rcs-diff): Same.
This commit is contained in:
Dmitry Gutov 2025-06-13 06:00:17 +03:00
parent 76f422da26
commit bec823b107
6 changed files with 34 additions and 23 deletions

View file

@ -1805,7 +1805,7 @@ This requires git 1.8.4 or later, for the \"-L\" option of \"git log\"."
samp coding-system-for-read t)))
(setq coding-system-for-read 'undecided)))
(defun vc-git-diff (files &optional rev1 rev2 buffer _async)
(defun vc-git-diff (files &optional rev1 rev2 buffer async)
"Get a difference report using Git between two revisions of FILES."
(let (process-file-side-effects
(command "diff-tree"))
@ -1817,7 +1817,7 @@ This requires git 1.8.4 or later, for the \"-L\" option of \"git log\"."
(unless rev1 (setq rev1 "HEAD")))
(if vc-git-diff-switches
(apply #'vc-git-command (or buffer "*vc-diff*")
1 ; bug#21969
(if async 'async 1)
files
command
"--exit-code"