]> code.delx.au - gnu-emacs/blobdiff - lisp/emacs-lisp/cl.el
Merge branch 'master' into xwidget
[gnu-emacs] / lisp / emacs-lisp / cl.el
index 37821758fa5d979fbb26fddb8c11a3f8498ca139..1cd7bd76b0e4f39266b601389f478b661de7a865 100644 (file)
@@ -1,6 +1,6 @@
 ;;; cl.el --- Compatibility aliases for the old CL library.  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2012  Free Software Foundation, Inc.
+;; Copyright (C) 2012-2015 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: extensions
@@ -29,6 +29,7 @@
 
 (require 'cl-lib)
 (require 'macroexp)
+(require 'gv)
 
 ;; (defun cl--rename ()
 ;;   (let ((vdefs ())
@@ -341,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
@@ -373,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.
@@ -689,6 +687,7 @@ You can replace this macro with `gv-letplace'."
   'cl--map-keymap-recursively "24.3")
 (define-obsolete-function-alias 'cl-map-intervals 'cl--map-intervals "24.3")
 (define-obsolete-function-alias 'cl-map-extents 'cl--map-overlays "24.3")
+(define-obsolete-function-alias 'cl-set-getf 'cl--set-getf "24.3")
 
 (defun cl-maclisp-member (item list)
   (declare (obsolete member "24.3"))