emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 1fe087a: lisp/emacs-lisp/cl.el (cl--function-conver


From: Katsumi Yamaoka
Subject: [Emacs-diffs] master 1fe087a: lisp/emacs-lisp/cl.el (cl--function-convert): Work for cl-flet and cl-labels
Date: Tue, 27 Jan 2015 03:15:51 +0000

branch: master
commit 1fe087a1ab4182b2e6c1d05444461acc4e78e2d8
Author: Katsumi Yamaoka <address@hidden>
Commit: Katsumi Yamaoka <address@hidden>

    lisp/emacs-lisp/cl.el (cl--function-convert): Work for cl-flet and cl-labels
---
 lisp/ChangeLog        |    6 +++++-
 lisp/emacs-lisp/cl.el |   11 ++++-------
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ff352a2..96b7f63 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,9 @@
-2015-01-26  Stefan Monnier  <address@hidden>
+2015-01-27  Katsumi Yamaoka  <address@hidden>
+
+       * emacs-lisp/cl.el (cl--function-convert): Run cl--labels-convert
+       for the case cl-flet or cl-labels form is wrapped with lexical-let.
 
+2015-01-26  Stefan Monnier  <address@hidden>
 
        * emacs-lisp/cl-generic.el (cl--generic-method): New struct.
        (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 da3eab7..1cd7bd7 100644
--- a/lisp/emacs-lisp/cl.el
+++ b/lisp/emacs-lisp/cl.el
@@ -342,6 +342,8 @@ The two cases that are handled are:
 - renaming of F when it's a function defined via `cl-labels' or `labels'."
   (require 'cl-macs)
   (declare-function cl--expr-contains-any "cl-macs" (x y))
+  (declare-function cl--labels-convert "cl-macs" (f))
+  (defvar cl--labels-convert-cache)
   (cond
    ;; ¡¡Big Ugly Hack!! We can't use a compiler-macro because those are checked
    ;; *after* handling `function', but we want to stop macroexpansion from
@@ -374,13 +376,8 @@ The two cases that are handled are:
           (setq cl--function-convert-cache (cons newf res))
           res))))
    (t
-    (let ((found (assq f macroexpand-all-environment)))
-      (if (and found (ignore-errors
-                       (eq (cadr (cl-caddr found)) 'cl-labels-args)))
-          (cadr (cl-caddr (cl-cadddr found)))
-        (let ((res `(function ,f)))
-          (setq cl--function-convert-cache (cons f res))
-          res))))))
+    (setq cl--labels-convert-cache cl--function-convert-cache)
+    (cl--labels-convert f))))
 
 (defmacro lexical-let (bindings &rest body)
   "Like `let', but lexically scoped.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]