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

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

bug#8613: "mode:" for minor-mode breaks set-visited-file-name


From: Glenn Morris
Subject: bug#8613: "mode:" for minor-mode breaks set-visited-file-name
Date: Tue, 03 May 2011 19:00:14 -0400
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)

Package: emacs
Version: 23.3

The fact that "mode:" is allowed to indicate both major and minor modes
in file local variables is problematic. Things would be much simpler if
a different convention were used for minor modes.

There is bug#2355 (specifying a minor-mode in the first line breaks
major-mode detection); there is bug#5239 (major "mode:" specifications
only work right if they are at the start of the local variables list. It
might be nice to automatically move "mode:" to the front of the local
variables list, so that people don't have to worry about this; but since
"mode:" is also used for minor modes, and these probably need to come
AFTER setting of their relevant variables, this cannot be done.); there
is also bug#8586 (directory-local variables and files with "mode:"
cookies; I cannot see how to solve this given that "mode:" might mean
either a major or minor mode).

Here's another issue, affecting set-visited-file-name, caused by the
fact that the hack-local-variables MODE-ONLY feature cannot work right,
because all it does is check for a "mode:" cookie, and it has no way to
know if this is specifying a major-mode or a minor-mode:

>| foo.el
emacs -Q foo.el
M-x set-visited-file-name RET foo.f90 RET
  -> buffer switches to f90 mode

cat >| foo2.el <<EOF
;; Local Variables:
;; mode: outline-minor
;; End:
EOF

emacs -Q foo2.el
M-x set-visited-file-name RET foo2.f90 RET
  -> buffer stays in emacs-lisp-mode





reply via email to

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