Function: add-file-local-variable-prop-line
add-file-local-variable-prop-line is an autoloaded, interactive and
byte-compiled function defined in files-x.el.gz.
Signature
(add-file-local-variable-prop-line VARIABLE VALUE &optional INTERACTIVE)
Documentation
Add file-local VARIABLE with its VALUE to the -*- line.
This command deletes all existing settings of VARIABLE (except mode
and eval) and adds a new file-local VARIABLE with VALUE to
the -*- line at the beginning of the file.
If there is no -*- line at the beginning of the current file buffer then this function adds it.
To add variables to the Local Variables list at the end of the file,
use the add-file-local-variable command instead.
If optional variable INTERACTIVE is non-nil, display a message telling the user how to make the new value take effect.
Probably introduced at or before Emacs version 23.2.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/files-x.el.gz
;;;###autoload
(defun add-file-local-variable-prop-line (variable value &optional interactive)
"Add file-local VARIABLE with its VALUE to the -*- line.
This command deletes all existing settings of VARIABLE (except `mode'
and `eval') and adds a new file-local VARIABLE with VALUE to
the -*- line at the beginning of the file.
If there is no -*- line at the beginning of the current file buffer
then this function adds it.
To add variables to the Local Variables list at the end of the file,
use the `add-file-local-variable' command instead.
If optional variable INTERACTIVE is non-nil, display a message telling
the user how to make the new value take effect."
(interactive
(let ((variable (read-file-local-variable "Add -*- file-local variable")))
(list variable (read-file-local-variable-value variable) t)))
(modify-file-local-variable-prop-line variable value 'add-or-replace interactive))