summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2008-10-23 02:40:37 +0000
committerGlenn Morris <rgm@gnu.org>2008-10-23 02:40:37 +0000
commit0ee35e515b9a2002fe8a06c85925e023c2248979 (patch)
treeaaeb5bc159b75d5ddb1151e8386793aadef21173 /lisp/emacs-lisp
parent91236f636eff8b9edcc73ef7e4798ad547eee9a8 (diff)
downloademacs-0ee35e515b9a2002fe8a06c85925e023c2248979.tar.gz
emacs-0ee35e515b9a2002fe8a06c85925e023c2248979.tar.bz2
emacs-0ee35e515b9a2002fe8a06c85925e023c2248979.zip
(flet): Throw an error when trying to byte-compile a redefinition of a
function with special byte-compile handling. (Bug#411)
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/cl-macs.el12
1 files changed, 8 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 9ca675f08c4..08864962f08 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -1328,10 +1328,14 @@ go back to their previous definitions, or lack thereof).
(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))