From 10bedb75c915158b7662d4dfa4afa3a231714268 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Fri, 27 Mar 2020 01:44:17 +0200 Subject: [PATCH] Disable enable-local-variables for hunk-only in diff-syntax-fontify-props * lisp/vc/diff-mode.el (diff-syntax-fontify-props): Let-bind enable-local-variables to nil when hunk-only is non-nil (bug#39190) --- lisp/vc/diff-mode.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index 8171a585158..da2d5ed50e4 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -2720,7 +2720,9 @@ hunk text is not found in the source file." ;; When initialization is requested, we should be in a brand new ;; temp buffer. (cl-assert (null buffer-file-name)) - (let ((enable-local-variables :safe) ;; to find `mode:' + ;; Use `:safe' to find `mode:'. In case of hunk-only, use nil because + ;; Local Variables list might be incomplete when context is truncated. + (let ((enable-local-variables (unless hunk-only :safe)) (buffer-file-name file)) ;; Don't run hooks that might assume buffer-file-name ;; really associates buffer with a file (bug#39190). -- 2.39.2