Function: read-file-local-variable-mode
read-file-local-variable-mode is a byte-compiled function defined in
files-x.el.gz.
Signature
(read-file-local-variable-mode)
Documentation
Read the name of a per-directory file-local variable's mode using completion.
Return the symbol of the variable, or nil if the user entered empty or
null name.
Intended to be used in the interactive spec of
add-dir-local-variable, delete-dir-local-variable.
Source Code
;; Defined in /usr/src/emacs/lisp/files-x.el.gz
(defun read-file-local-variable-mode ()
"Read the name of a per-directory file-local variable's mode using completion.
Return the symbol of the variable, or nil if the user entered empty or
null name.
Intended to be used in the `interactive' spec of
`add-dir-local-variable', `delete-dir-local-variable'."
(let* ((default (and (symbolp major-mode) (symbol-name major-mode)))
(mode
(completing-read
(format-prompt "Mode or subdirectory" default)
obarray
(lambda (sym)
(and (string-match-p "-mode\\'" (symbol-name sym))
(not (or (memq sym minor-mode-list)
(string-match-p "-minor-mode\\'"
(symbol-name sym))))))
nil nil nil default nil)))
(cond
((equal mode "nil") nil)
((and (stringp mode) (fboundp (intern mode))) (intern mode))
(t mode))))