Variable: enable-local-variables

enable-local-variables is a customizable variable defined in files.el.gz.

Value

t

Documentation

Control use of local variables in files you visit.

The value can be t, nil, :safe, :all, or something else.

A value of t means file local variables specifications are obeyed if all the specified variable values are safe; if any values are not safe, Emacs queries you, once, whether to set them all.
(When you say yes to certain values, they are remembered as safe.)

:safe means set the safe variables, and ignore the rest.
:all means set all variables, whether safe or not.
 (Don't set it permanently to :all.)
A value of nil means always ignore the file local variables.

Any other value means always query you once whether to set them all.
(When you say yes to certain values, they are remembered as safe, but
this has no effect when enable-local-variables is "something else".)

This variable also controls use of major modes specified in a -*- line.

The command M-x normal-mode (normal-mode), when used interactively, always obeys file local variable specifications and the -*- line, and ignores this variable.

Also see the permanently-enabled-local-variables and safe-local-variable-directories variables.

View in manual

Probably introduced at or before Emacs version 19.1.

Source Code

;; Defined in /usr/src/emacs/lisp/files.el.gz
(defcustom enable-local-variables t
  "Control use of local variables in files you visit.
The value can be t, nil, :safe, :all, or something else.

A value of t means file local variables specifications are obeyed
if all the specified variable values are safe; if any values are
not safe, Emacs queries you, once, whether to set them all.
\(When you say yes to certain values, they are remembered as safe.)

:safe means set the safe variables, and ignore the rest.
:all means set all variables, whether safe or not.
 (Don't set it permanently to :all.)
A value of nil means always ignore the file local variables.

Any other value means always query you once whether to set them all.
\(When you say yes to certain values, they are remembered as safe, but
this has no effect when `enable-local-variables' is \"something else\".)

This variable also controls use of major modes specified in
a -*- line.

The command \\[normal-mode], when used interactively,
always obeys file local variable specifications and the -*- line,
and ignores this variable.

Also see the `permanently-enabled-local-variables' and
`safe-local-variable-directories' variables."
  :risky t
  :type '(choice (const :tag "Query Unsafe" t)
		 (const :tag "Safe Only" :safe)
		 (const :tag "Do all" :all)
		 (const :tag "Ignore" nil)
		 (other :tag "Query" other))
  :group 'find-file)