GNU bug report logs - #22166
24.5; Mixing up Local Variables declarations

Previous Next

Package: emacs;

Reported by: PEDRO ANDRES ARANDA GUTIERREZ <pedroa.aranda <at> telefonica.com>

Date: Mon, 14 Dec 2015 16:37:01 UTC

Severity: minor

Tags: notabug

Found in version 24.5

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Glenn Morris <rgm <at> gnu.org>
To: PEDRO ANDRES ARANDA GUTIERREZ <pedroa.aranda <at> telefonica.com>
Cc: 22166 <at> debbugs.gnu.org
Subject: bug#22166: 24.5; Mixing up Local Variables declarations
Date: Mon, 14 Dec 2015 11:57:19 -0500
PEDRO ANDRES ARANDA GUTIERREZ wrote:

> <--- cut here
> #include <stdio.h>
>
> int main(int argc,char **argv)
> {
> printf("\
> %%%% Local Variables:\n\
> %%%% mode: LaTeX\n\
> %%%% TeX-PDF-mode: t\n\
> %%%% TeX-master: \"main\"\n\
> %%%% End:\n\
> ")
> }
> <--- cut here
>
> The mode is changed from C mode to LaTEX mode and that should not
> happen.

That's the correct, documented behavior (see "set-auto-mode" in the
Elisp manual). Local Variables lines may have prefixes and suffixes, and
"mode:" override auto-mode-alist. You'll have to disguise the Local
Variables section if you don't want Emacs to act on it in this case. Eg
you could write it out in two chunks, or simply add

/*
^L
/*

at the very end of the file, since Emacs only searches in the last
"page" for Local Variables.





This bug report was last modified 9 years and 158 days ago.

Previous Next


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