diff lisp/cl-macs.el @ 5376:4b529b940e2e

Eliminate unused blocks named nil, too, cl-macs.el, bytecomp.el 2011-03-17 Aidan Kehoe <kehoea@parhasard.net> * bytecomp.el (byte-compile-catch): * bytecomp.el (byte-compile-throw): * cl-macs.el (return-from): With `block' and `return-from', a nil NAME is perfectly legitimate, and the corresponding `catch' statements need be removed by the byte-compiler. 5dd1ba5e0113 , my change of 2011-02-12, didn't do this; correct that now.
author Aidan Kehoe <kehoea@parhasard.net>
date Thu, 17 Mar 2011 21:07:16 +0000
parents 8b70d37ab80e
children a32a108ae815
line wrap: on
line diff
--- a/lisp/cl-macs.el	Thu Mar 17 20:17:19 2011 +0000
+++ b/lisp/cl-macs.el	Thu Mar 17 21:07:16 2011 +0000
@@ -767,12 +767,12 @@
 This is compatible with Common Lisp, but note that `defun' and
 `defmacro' do not create implicit blocks as they do in Common Lisp."
   `(throw ',(or (cdr (assq name cl-active-block-names))
-		(prog1 (copy-symbol name)
-		  (and-fboundp 'byte-compile-warn (cl-compiling-file)
-			       (byte-compile-warn
-				"return-from: no enclosing block named `%s'"
-				name))))
-	 ,result))
+                ;; Tell the byte-compiler the original name of the block,
+                ;; leave any warning to it.
+                (let ((copy-symbol (copy-symbol name)))
+                  (put copy-symbol 'cl-block-name name)
+                  copy-symbol))
+           ,result))
 
 ;;; The "loop" macro.