aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Gutov2024-06-17 22:51:23 +0300
committerDmitry Gutov2024-06-17 22:53:35 +0300
commitf7953a0eef4bf6505352c199a2f8ae8f3563fdfa (patch)
tree0dcff4b0ce154cdbbe07d98ac3c64daf45c02e5f
parentb26270ae94329131966bf2d836cf6c90b90e5cdd (diff)
downloademacs-f7953a0eef4bf6505352c199a2f8ae8f3563fdfa.tar.gz
emacs-f7953a0eef4bf6505352c199a2f8ae8f3563fdfa.zip
diff-mode: Optimize source language syntax highlighting
* lisp/vc/diff-mode.el (diff--get-revision-properties): Never pass FILE to 'diff-syntax-fontify-props'; assume that 'vc-find-revision-no-save' has called the major mode function already (bug#71604).
-rw-r--r--lisp/vc/diff-mode.el6
1 files changed, 2 insertions, 4 deletions
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index c0269d882b9..81e8b23ee33 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -2883,9 +2883,6 @@ and the position in MAX."
2883 (buffer (cdr entry))) 2883 (buffer (cdr entry)))
2884 (if (buffer-live-p buffer) 2884 (if (buffer-live-p buffer)
2885 (progn 2885 (progn
2886 ;; Don't re-initialize the buffer (which would throw
2887 ;; away the previous fontification work).
2888 (setq file nil)
2889 (setq diff--cached-revision-buffers 2886 (setq diff--cached-revision-buffers
2890 (cons entry 2887 (cons entry
2891 (delq entry diff--cached-revision-buffers)))) 2888 (delq entry diff--cached-revision-buffers))))
@@ -2905,7 +2902,8 @@ and the position in MAX."
2905 (diff--cache-schedule-clean) 2902 (diff--cache-schedule-clean)
2906 (and buffer 2903 (and buffer
2907 (with-current-buffer buffer 2904 (with-current-buffer buffer
2908 (diff-syntax-fontify-props file text line-nb))))) 2905 ;; Major mode is set in vc-find-revision-no-save already.
2906 (diff-syntax-fontify-props nil text line-nb)))))
2909 2907
2910(defun diff-syntax-fontify-hunk (beg end old) 2908(defun diff-syntax-fontify-hunk (beg end old)
2911 "Highlight source language syntax in diff hunk between BEG and END. 2909 "Highlight source language syntax in diff hunk between BEG and END.