GNU bug report logs - #39190
28.0.50; two buffers with same buffer-file-name (diff-syntax-fontify-props)

Previous Next

Package: emacs;

Reported by: Felician Nemeth <felician.nemeth <at> gmail.com>

Date: Sun, 19 Jan 2020 11:15:02 UTC

Severity: normal

Found in version 28.0.50

Full log


View this message in rfc822 format

From: Felician Nemeth <felician.nemeth <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: 39190 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: bug#39190: 28.0.50; two buffers with same buffer-file-name (diff-syntax-fontify-props)
Date: Sun, 02 Feb 2020 10:42:26 +0100
Juri Linkov <juri <at> linkov.net> writes:

>>> Could you please try to reproduce the issue using Eglot with the
>>> following minimal patch.  If it really fixes the bug then it
>>> should be committed to Emacs 27 immediately, and more changes
>>> could be added later.
>>
>> Unfortunately the minimal patch doesn't fix the issue.
>>
>> Case 1. When Eglot is started manually, then the recipe fails in an
>> after-change-major-mode-hook where the buffer-file-name is non-nil for
>> the temporary diff buffer.
>
> Strange, when I tested the minimal patch, there were no errors anymore.

Maybe I wasn't clear enough.  I got no errors, but flymake incorrectly
fontified the buffer.  Anyway, I tried to look into why this happened
even after applying your patch and it turned out that
vc-find-revision-no-save also calls set-auto-mode.  So, I don't know if
the following patch is correct, but together with your patch it does
solve the original issue.

diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index f64b6c0631..c50ba132e7 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -2098,7 +2098,7 @@ vc-find-revision-no-save
                     ;; For non-interactive, skip any questions
                     (let ((enable-local-variables :safe) ;; to find `mode:'
                           (buffer-file-name file))
-                      (ignore-errors (set-auto-mode)))
+                      (ignore-errors (delay-mode-hooks (set-auto-mode))))
                   (normal-mode))
 	        (set-buffer-modified-p nil)
                 (setq buffer-read-only t))





This bug report was last modified 5 years and 83 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.