When I move around the buffer *vc-diff* from vc-root-diff I experience lags.

GNU Emacs 27.1 (build 1, x86_64-pc-cygwin) of 2020-10-29.

With procmon I detected lots of:

C:\opt\cygwin64\bin\git.exe --no-pager ls-files -z --full-name -- application.yml
C:\opt\cygwin64\bin\git.exe --no-pager cat-file blob 4f6e63900c275c7c53519ac0a2f6bc1cdd65abf8:application.yml

that generated for each new file in diff...

It is from vc-git-find-revision.

Even though I enabled debugging on entering that function Emacs didn't stop there, so I cannot get stack trace which hook is responsible to process spawning.

I want to disable that "feature".

UPDATE 2023-04-10 Bug report: Emacs keeps opening related file from vc-diff buffer

1 Answer 1


I already had an issue with hunk refinement, that fixed by:

;; Since 27.1 it is enabled during font-lock. Need to disable explicitly.
(setq diff-refine nil)

So I checked /usr/share/emacs/27.1/lisp/vc/diff-mode.el.gz again and found:

(defcustom diff-font-lock-syntax t)                          

So basically Emacs opens file behind in order to build proper syntax highlighting. That triggers slow VC commands. Yes, Cygwin is slow on fork().


(setq diff-font-lock-syntax 'hunk-only)

I think it is a bug that Emacs tries to do vc-git-find-revision behind the scene when diff-font-lock-syntax it t. Exhausted to report it ((

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.