diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2010-11-11 17:19:01 -0500 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2010-11-11 17:19:01 -0500 |
commit | acef0722fc954a88eea588486b478f49b1afdc6a (patch) | |
tree | 6d7b78590da45bbedec5fd7486e22dd28e56daed /lisp/emacs-lisp | |
parent | 7bea8c7a92e1fb3eaf1a4e9f2becdaf0074f64ad (diff) | |
download | emacs-acef0722fc954a88eea588486b478f49b1afdc6a.tar.gz emacs-acef0722fc954a88eea588486b478f49b1afdc6a.tar.bz2 emacs-acef0722fc954a88eea588486b478f49b1afdc6a.zip |
* lisp/files.el (safe-local-variable-p): Gracefully handle errors.
* lisp/emacs-lisp/bytecomp.el (byte-compile-warnings): Simplify the
safety predicate.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 394169be99d..cdfac80ca78 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -294,21 +294,12 @@ suppress. For example, (not mapcar) will suppress warnings about mapcar." (set :menu-tag "Some" ,@(mapcar (lambda (x) `(const ,x)) byte-compile-warning-types)))) -;;;###autoload(put 'byte-compile-warnings 'safe-local-variable 'byte-compile-warnings-safe-p) ;;;###autoload -(defun byte-compile-warnings-safe-p (x) - "Return non-nil if X is valid as a value of `byte-compile-warnings'." - (or (booleanp x) - (and (listp x) - (if (eq (car x) 'not) (setq x (cdr x)) - t) - (equal (mapcar - (lambda (e) - (when (memq e byte-compile-warning-types) - e)) - x) - x)))) +(put 'byte-compile-warnings 'safe-local-variable + (lambda (v) + (or (symbolp v) + (null (delq nil (mapcar (lambda (x) (not (symbolp x))) v)))))) (defun byte-compile-warning-enabled-p (warning) "Return non-nil if WARNING is enabled, according to `byte-compile-warnings'." |