aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKatsumi Yamaoka2015-01-27 03:15:49 +0000
committerKatsumi Yamaoka2015-01-27 03:15:49 +0000
commit1fe087a1ab4182b2e6c1d05444461acc4e78e2d8 (patch)
treed64e62b7e642fafd824b004de6a85ae5188c20e7
parent2639c2ed08e5b9a55939bab0c575537e50f61141 (diff)
downloademacs-1fe087a1ab4182b2e6c1d05444461acc4e78e2d8.tar.gz
emacs-1fe087a1ab4182b2e6c1d05444461acc4e78e2d8.zip
lisp/emacs-lisp/cl.el (cl--function-convert): Work for cl-flet and cl-labels
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/emacs-lisp/cl.el11
2 files changed, 9 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ff352a25eea..96b7f63a26a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,9 @@
12015-01-26 Stefan Monnier <monnier@iro.umontreal.ca> 12015-01-27 Katsumi Yamaoka <yamaoka@jpl.org>
2
3 * emacs-lisp/cl.el (cl--function-convert): Run cl--labels-convert
4 for the case cl-flet or cl-labels form is wrapped with lexical-let.
2 5
62015-01-26 Stefan Monnier <monnier@iro.umontreal.ca>
3 7
4 * emacs-lisp/cl-generic.el (cl--generic-method): New struct. 8 * emacs-lisp/cl-generic.el (cl--generic-method): New struct.
5 (cl--generic): The method-table is now a (list-of cl--generic-method). 9 (cl--generic): The method-table is now a (list-of cl--generic-method).
diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el
index da3eab73fc4..1cd7bd76b0e 100644
--- a/lisp/emacs-lisp/cl.el
+++ b/lisp/emacs-lisp/cl.el
@@ -342,6 +342,8 @@ The two cases that are handled are:
342- renaming of F when it's a function defined via `cl-labels' or `labels'." 342- renaming of F when it's a function defined via `cl-labels' or `labels'."
343 (require 'cl-macs) 343 (require 'cl-macs)
344 (declare-function cl--expr-contains-any "cl-macs" (x y)) 344 (declare-function cl--expr-contains-any "cl-macs" (x y))
345 (declare-function cl--labels-convert "cl-macs" (f))
346 (defvar cl--labels-convert-cache)
345 (cond 347 (cond
346 ;; ¡¡Big Ugly Hack!! We can't use a compiler-macro because those are checked 348 ;; ¡¡Big Ugly Hack!! We can't use a compiler-macro because those are checked
347 ;; *after* handling `function', but we want to stop macroexpansion from 349 ;; *after* handling `function', but we want to stop macroexpansion from
@@ -374,13 +376,8 @@ The two cases that are handled are:
374 (setq cl--function-convert-cache (cons newf res)) 376 (setq cl--function-convert-cache (cons newf res))
375 res)))) 377 res))))
376 (t 378 (t
377 (let ((found (assq f macroexpand-all-environment))) 379 (setq cl--labels-convert-cache cl--function-convert-cache)
378 (if (and found (ignore-errors 380 (cl--labels-convert f))))
379 (eq (cadr (cl-caddr found)) 'cl-labels-args)))
380 (cadr (cl-caddr (cl-cadddr found)))
381 (let ((res `(function ,f)))
382 (setq cl--function-convert-cache (cons f res))
383 res))))))
384 381
385(defmacro lexical-let (bindings &rest body) 382(defmacro lexical-let (bindings &rest body)
386 "Like `let', but lexically scoped. 383 "Like `let', but lexically scoped.