diff options
author | Karoly Lorentey <lorentey@elte.hu> | 2006-02-23 03:17:52 +0000 |
---|---|---|
committer | Karoly Lorentey <lorentey@elte.hu> | 2006-02-23 03:17:52 +0000 |
commit | 5a5654159aeca7b60bfceb8d68f4add0570efc7a (patch) | |
tree | eb9da5ea0ca4c025dc76a66eb1ede78a1cc88bc7 /lisp/emacs-lisp | |
parent | 5f3c1a63f31f77f60b8a60518ce3eda6a51f72b9 (diff) | |
parent | e75116edb6280346c671aa5a5c022776b0ca1c01 (diff) | |
download | emacs-5a5654159aeca7b60bfceb8d68f4add0570efc7a.tar.gz emacs-5a5654159aeca7b60bfceb8d68f4add0570efc7a.tar.bz2 emacs-5a5654159aeca7b60bfceb8d68f4add0570efc7a.zip |
Merged from emacs@sv.gnu.org
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-111
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-112
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-113
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-114
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-115
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-518
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/unsafep.el | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/lisp/emacs-lisp/unsafep.el b/lisp/emacs-lisp/unsafep.el index 41e98694c71..aeaf653aef6 100644 --- a/lisp/emacs-lisp/unsafep.el +++ b/lisp/emacs-lisp/unsafep.el @@ -148,10 +148,10 @@ of symbols with local bindings." ((eq fun 'lambda) ;;First arg is temporary bindings (mapc #'(lambda (x) - (let ((y (unsafep-variable x t))) - (if y (throw 'unsafep y))) (or (memq x '(&optional &rest)) - (push x unsafep-vars))) + (let ((y (unsafep-variable x t))) + (if y (throw 'unsafep y)) + (push x unsafep-vars)))) (cadr form)) (unsafep-progn (cddr form))) ((eq fun 'let) @@ -247,17 +247,16 @@ and throws a reason to `unsafep' if unsafe. Returns SYM." (if reason (throw 'unsafep reason)) sym)) -(defun unsafep-variable (sym global-okay) - "Return nil if SYM is safe as a let-binding sym -\(because it already has a temporary binding or is a non-risky buffer-local -variable), otherwise a reason why it is unsafe. Failing to be locally bound -is okay if GLOBAL-OKAY is non-nil." +(defun unsafep-variable (sym to-bind) + "Return nil if SYM is safe to set or bind, or a reason why not. +If TO-BIND is nil, check whether SYM is safe to set. +If TO-BIND is t, check whether SYM is safe to bind." (cond ((not (symbolp sym)) `(variable ,sym)) ((risky-local-variable-p sym nil) `(risky-local-variable ,sym)) - ((not (or global-okay + ((not (or to-bind (memq sym unsafep-vars) (local-variable-p sym))) `(global-variable ,sym)))) |