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


Message #152 received at 39190 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 39190 <at> debbugs.gnu.org, Felician Nemeth <felician.nemeth <at> gmail.com>
Subject: Re: bug#39190: 28.0.50; two buffers with same buffer-file-name
 (diff-syntax-fontify-props)
Date: Wed, 25 Mar 2020 22:39:59 +0200
>> (defun conf-guess-mode ()
>>   (funcall (conf--guess-mode)))
>
> That shouldn't be needed!
> [ I.e. the right fix should arrange for that not to be necessary.
>   I'm looking into it, thanks.  ]

BTW, I noticed another problem related to diff-syntax-fontify:
when diff-font-lock-syntax is customized to 'hunk-also',
and a patch displayed by Gnus contains a truncated
local variables list, e.g. only the first line

 ;; Local Variables:

is presented in diff context without the terminating
"End:" then opening such attachment patch raises the error:

   "Local variables list is not properly terminated"

Not sure if this is the right way to fix this, but it works:

diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index 8171a58515..96baea8526 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -2724,7 +2724,7 @@ diff-syntax-fontify-props
           (buffer-file-name file))
       ;; Don't run hooks that might assume buffer-file-name
       ;; really associates buffer with a file (bug#39190).
-      (delay-mode-hooks (set-auto-mode))
+      (delay-mode-hooks (ignore-errors (set-auto-mode)))
       ;; FIXME: Is this really worth the trouble?
       (when (and (fboundp 'generic-mode-find-file-hook)
                  (memq #'generic-mode-find-file-hook




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.