Function: risky-local-variable-p
risky-local-variable-p is a byte-compiled function defined in
files.el.gz.
Signature
(risky-local-variable-p SYM &optional IGNORED)
Documentation
Non-nil if SYM could be dangerous as a file-local variable.
It is dangerous if either of these conditions are met:
* Its risky-local-variable property is non-nil.
* Its name ends with "hook(s)", "function(s)", "form(s)", "map",
"program", "command(s)", "predicate(s)", "frame-alist",
"mode-alist", "font-lock-(syntactic-)keyword*",
"map-alist", or "bindat-spec".
Probably introduced at or before Emacs version 22.1.
Source Code
;; Defined in /usr/src/emacs/lisp/files.el.gz
(defun risky-local-variable-p (sym &optional _ignored)
"Non-nil if SYM could be dangerous as a file-local variable.
It is dangerous if either of these conditions are met:
* Its `risky-local-variable' property is non-nil.
* Its name ends with \"hook(s)\", \"function(s)\", \"form(s)\", \"map\",
\"program\", \"command(s)\", \"predicate(s)\", \"frame-alist\",
\"mode-alist\", \"font-lock-(syntactic-)keyword*\",
\"map-alist\", or \"bindat-spec\"."
;; If this is an alias, check the base name.
(condition-case nil
(setq sym (indirect-variable sym))
(error nil))
(or (get sym 'risky-local-variable)
(string-match "-hooks?$\\|-functions?$\\|-forms?$\\|-program$\\|\
-commands?$\\|-predicates?$\\|font-lock-keywords$\\|font-lock-keywords\
-[0-9]+$\\|font-lock-syntactic-keywords$\\|-frame-alist$\\|-mode-alist$\\|\
-map$\\|-map-alist$\\|-bindat-spec$" (symbol-name sym))))