From: Juri Linkov Date: Thu, 26 Mar 2020 23:44:17 +0000 (+0200) Subject: Disable enable-local-variables for hunk-only in diff-syntax-fontify-props X-Git-Tag: emacs-28.0.90~7714 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=10bedb75c915158b7662d4dfa4afa3a231714268;p=emacs.git 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) --- 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).