comparison lisp/files.el @ 52993:c17a620e1ff3

(risky-local-variable-p): Make second argument optional.
author Luc Teirlinck <teirllm@auburn.edu>
date Wed, 05 Nov 2003 04:06:27 +0000
parents e1d4f8d5156b
children 269f007885af
comparison
equal deleted inserted replaced
52992:3084104990c8 52993:c17a620e1ff3
2177 (put 'parse-time-rules 'risky-local-variable t) 2177 (put 'parse-time-rules 'risky-local-variable t)
2178 2178
2179 ;; This case is safe because the user gets to check it before it is used. 2179 ;; This case is safe because the user gets to check it before it is used.
2180 (put 'compile-command 'safe-local-variable 'stringp) 2180 (put 'compile-command 'safe-local-variable 'stringp)
2181 2181
2182 (defun risky-local-variable-p (sym val) 2182 (defun risky-local-variable-p (sym &optional val)
2183 "Non-nil if SYM could be dangerous as a file-local variable with value VAL. 2183 "Non-nil if SYM could be dangerous as a file-local variable with value VAL.
2184 If VAL is nil, the question is whether any value might be dangerous." 2184 If VAL is nil or omitted, the question is whether any value might be
2185 dangerous."
2185 (let ((safep (get sym 'safe-local-variable))) 2186 (let ((safep (get sym 'safe-local-variable)))
2186 (or (memq sym ignored-local-variables) 2187 (or (memq sym ignored-local-variables)
2187 (get sym 'risky-local-variable) 2188 (get sym 'risky-local-variable)
2188 (and (string-match "-hooks?$\\|-functions?$\\|-forms?$\\|-program$\\|-command$\\|-predicate$\\|font-lock-keywords$\\|font-lock-keywords-[0-9]+$\\|font-lock-syntactic-keywords$\\|-frame-alist$\\|-mode-alist$\\|-map$\\|-map-alist$" 2189 (and (string-match "-hooks?$\\|-functions?$\\|-forms?$\\|-program$\\|-command$\\|-predicate$\\|font-lock-keywords$\\|font-lock-keywords-[0-9]+$\\|font-lock-syntactic-keywords$\\|-frame-alist$\\|-mode-alist$\\|-map$\\|-map-alist$"
2189 (symbol-name sym)) 2190 (symbol-name sym))