Function: read-file-local-variable
read-file-local-variable is a byte-compiled function defined in
files-x.el.gz.
Signature
(read-file-local-variable PROMPT)
Documentation
Read file-local variable using PROMPT and completion.
Intended to be used in the interactive spec of
add-file-local-variable, delete-file-local-variable,
add-dir-local-variable, delete-dir-local-variable.
Source Code
;; Defined in /usr/src/emacs/lisp/files-x.el.gz
;;; Commands to add/delete file-local/directory-local variables.
(defun read-file-local-variable (prompt)
"Read file-local variable using PROMPT and completion.
Intended to be used in the `interactive' spec of
`add-file-local-variable', `delete-file-local-variable',
`add-dir-local-variable', `delete-dir-local-variable'."
(let* ((default (variable-at-point))
(default (and (symbolp default) (boundp default)
(symbol-name default)))
(variable
(completing-read
(format-prompt prompt default)
obarray
(lambda (sym)
(or (custom-variable-p sym)
(get sym 'safe-local-variable)
(memq sym '(mode eval coding unibyte))))
nil nil nil default nil)))
(and (stringp variable) (intern variable))))