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: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Juri Linkov <juri <at> linkov.net>
Cc: 39190 <at> debbugs.gnu.org, Felician Nemeth <felician.nemeth <at> gmail.com>
Subject: bug#39190: 28.0.50; two buffers with same buffer-file-name (diff-syntax-fontify-props)
Date: Wed, 25 Mar 2020 17:13:09 -0400
> is presented in diff context without the terminating
> "End:" then opening such attachment patch raises the error:
>
>    "Local variables list is not properly terminated"

Really?  AFAICT the code does:

		  (unless (let ((case-fold-search t))
			    (re-search-forward
			     (concat prefix "[ \t]*End:[ \t]*" suffix)
			     nil t))
		    ;; This used to be an error, but really all it means is
		    ;; that this may simply not be a local-variables section,
		    ;; so just ignore it.
		    (message "Local variables list is not properly terminated"))

so it shouldn't signal an error but just emit a message.

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

I think we should try and arrange for errors to really be "not normal",
and then use `with-demoted-errors`, yes.

But w.r.t file-local variables and diff-hunk, I think obeying "file-local
variables" doesn't make much sense when we only have a hunk to go on
since it's more common for the hunk not to include the actual file-local
vars, so if we find something it's likely to be a false-positive.


        Stefan


> 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.