bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#13862: 24.3.50; File local-variables error: (error "Local variables


From: Eli Zaretskii
Subject: bug#13862: 24.3.50; File local-variables error: (error "Local variables entry is missing the prefix")
Date: Mon, 04 Mar 2013 18:07:27 +0200

> From: Jambunathan K <kjambunathan@gmail.com>
> Date: Mon, 04 Mar 2013 09:08:54 +0530
> Cc: 13862@debbugs.gnu.org
> 
> Glenn Morris <rgm@gnu.org> writes:
> 
> > Adding .diff and .patch to inhibit-local-variables-regexps would avoid
> > this.
> 
> ,----
> |  ;; Local variables:
> |  ;; generated-autoload-file: "org-loaddefs.el"
> | +;; coding: utf-8
> |  ;; End:
> `----
> 
> The question is: 
> 
> Is there are any local variables in the patch?  There isn't any.  So why
> should we inhibit something that is not there.
> 
> If `diff-mode' has no comment syntax defined, then by extension, it
> cannot specify file local variables.

File local variables never had anything to do with comment syntax; you
won't find that neither in the code nor in the documentation.  Which
is a Good Thing: if file local variables were supported only for modes
which have comment syntax defined, we couldn't have used them in all
the modes that don't.  For example, Text mode, or the tutorials, or the
ChangeLog files.  You name it.

In modes that do have comment syntax defined, it makes sense to put
these variables into comments, so as not to confuse the translator.
But that's about all these variables have in common with comments.
You will see in the code that Emacs deduces the prefix and suffix
heuristically, and that is how this is documented.

So I think Glenn is right about the solution.  Diffs don't have
contents of their own (well, except for the hunk headers), so looking
up diffs for file-local variables doesn't make much sense.

> ps: I am not sure why *.patch files are visited in diff-mode?

What else?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]