emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/emacs-lisp/unsafep.el


From: Richard M. Stallman
Subject: [Emacs-diffs] Changes to emacs/lisp/emacs-lisp/unsafep.el
Date: Tue, 21 Feb 2006 19:54:36 +0000

Index: emacs/lisp/emacs-lisp/unsafep.el
diff -u emacs/lisp/emacs-lisp/unsafep.el:1.10 
emacs/lisp/emacs-lisp/unsafep.el:1.11
--- emacs/lisp/emacs-lisp/unsafep.el:1.10       Mon Feb  6 12:20:07 2006
+++ emacs/lisp/emacs-lisp/unsafep.el    Tue Feb 21 19:54:36 2006
@@ -148,10 +148,10 @@
        ((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 @@
     (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))))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]