diff lisp/files.el @ 47667:96b260e0ff3d

New major mode "SES" for spreadsheets. New function (unsafep X) determines whether X is a safe Lisp form. New support module testcover.el for coverage testing.
author Jonathan Yavner <jyavner@member.fsf.org>
date Sat, 28 Sep 2002 18:45:56 +0000
parents e437df73c5bd
children 9d226e07606d
line wrap: on
line diff
--- a/lisp/files.el	Sat Sep 28 02:09:30 2002 +0000
+++ b/lisp/files.el	Sat Sep 28 18:45:56 2002 +0000
@@ -1617,6 +1617,7 @@
      ;; and after the .scm.[0-9] and CVS' <file>.<rev> patterns too.
      ("\\.[1-9]\\'" . nroff-mode)
      ("\\.g\\'" . antlr-mode)
+     ("\\.ses\\'" . ses-mode)
      ("\\.in\\'" nil t)))
   "Alist of filename patterns vs corresponding major mode functions.
 Each element looks like (REGEXP . FUNCTION) or (REGEXP FUNCTION NON-NIL).
@@ -2010,6 +2011,7 @@
 (put 'ignored-local-variables 'risky-local-variable t)
 (put 'eval 'risky-local-variable t)
 (put 'file-name-handler-alist 'risky-local-variable t)
+(put 'inhibit-quit 'risky-local-variable t)
 (put 'minor-mode-alist 'risky-local-variable t)
 (put 'minor-mode-map-alist 'risky-local-variable t)
 (put 'minor-mode-overriding-map-alist 'risky-local-variable t)
@@ -2058,6 +2060,14 @@
 ;; This one is safe because the user gets to check it before it is used.
 (put 'compile-command 'safe-local-variable t)
 
+(defun risky-local-variable-p (sym)
+  "Returns non-nil if SYM could be dangerous as a file-local variable."
+  (or (memq sym ignored-local-variables)
+      (get sym 'risky-local-variable)
+      (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$"
+			 (symbol-name sym))
+	   (not (get sym 'safe-local-variable)))))
+
 (defcustom safe-local-eval-forms nil
   "*Expressions that are considered \"safe\" in an `eval:' local variable.
 Add expressions to this list if you want Emacs to evaluate them, when
@@ -2122,15 +2132,9 @@
 	((eq var 'coding)
 	 ;; We have already handled coding: tag in set-auto-coding.
 	 nil)
-	((memq var ignored-local-variables)
-	 nil)
 	;; "Setting" eval means either eval it or do nothing.
 	;; Likewise for setting hook variables.
-	((or (get var 'risky-local-variable)
-	     (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$"
-			    (symbol-name var))
-	      (not (get var 'safe-local-variable))))
+	((risky-local-variable-p var)
 	 ;; Permit evalling a put of a harmless property.
 	 ;; if the args do nothing tricky.
 	 (if (or (and (eq var 'eval)