changeset 99067:2b3eb287d910

(flet): Throw an error when trying to byte-compile a redefinition of a function with special byte-compile handling. (Bug#411)
author Glenn Morris <rgm@gnu.org>
date Thu, 23 Oct 2008 02:40:09 +0000
parents 5f5e406e8a00
children a487fb70a412
files lisp/emacs-lisp/cl-macs.el
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emacs-lisp/cl-macs.el	Thu Oct 23 02:39:14 2008 +0000
+++ b/lisp/emacs-lisp/cl-macs.el	Thu Oct 23 02:40:09 2008 +0000
@@ -1328,10 +1328,14 @@
 	     (let ((func (list 'function*
 			       (list 'lambda (cadr x)
 				     (list* 'block (car x) (cddr x))))))
-	       (if (and (cl-compiling-file)
-			(boundp 'byte-compile-function-environment))
-		   (push (cons (car x) (eval func))
-			    byte-compile-function-environment))
+	       (when (cl-compiling-file)
+		 ;; Bug#411.  It would be nice to fix this.
+		 (and (get (car x) 'byte-compile)
+		      (error "Byte-compiling a redefinition of `%s' \
+will not work - use `labels' instead" (symbol-name (car x))))
+		 (and (boundp 'byte-compile-function-environment)
+		      (push (cons (car x) (eval func))
+			    byte-compile-function-environment)))
 	       (list (list 'symbol-function (list 'quote (car x))) func))))
 	  bindings)
 	 body))