From b07a74497a85c3e5ed7dec1228c6441be0a8059f Mon Sep 17 00:00:00 2001 From: BT Templeton Date: Sun, 14 Aug 2011 16:42:37 -0400 Subject: [PATCH] more lexical declarations * module/language/elisp/boot.el (condition-case, catch): Add `lexical' declarations in macro expansions. --- module/language/elisp/boot.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/module/language/elisp/boot.el b/module/language/elisp/boot.el index 3e0a748ab..db3267cf2 100644 --- a/module/language/elisp/boot.el +++ b/module/language/elisp/boot.el @@ -442,11 +442,14 @@ 'elisp-condition #'(lambda () ,bodyform) #'(lambda (,key ,error-symbol ,data) + (declare (lexical ,key ,error-symbol ,data)) (let ((,conditions (get ,error-symbol 'error-conditions)) ,@(if var `((,var (cons ,error-symbol ,data))) '())) + (declare (lexical ,conditions + ,@(if var `(,var) '()))) (cond ,@(mapcar #'handler->cond-clause handlers) (t (signal ,error-symbol ,data))))))))) @@ -463,11 +466,13 @@ (c (make-symbol "c")) (data (make-symbol "data"))) `(let ((,tag-value ,tag)) + (declare (lexical ,tag-value)) (condition-case ,c (let ((%catch t)) ,@body) (throw (let ((,data (cdr ,c))) + (declare (lexical ,data)) (if (eq (car ,data) ,tag-value) (car (cdr ,data)) (apply #'throw ,data))))))))