summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/cl-seq.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2012-06-08 22:26:47 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2012-06-08 22:26:47 -0400
commitd9857e534be786674818645a1c51410b4ca68cf8 (patch)
treea9ef3afbf43c114e4d913c3afc01b98ad9b184b8 /lisp/emacs-lisp/cl-seq.el
parent7cb70fd73eccd2725b8e436bff3295506816f935 (diff)
downloademacs-d9857e534be786674818645a1c51410b4ca68cf8.tar.gz
Don't autoload functions too eagerly during macroexpansion.
* lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Only autoload a function if there's a clear indication that it has a compiler-macro. * lisp/emacs-lisp/byte-run.el (defun-declarations-alist, defmacro, defun) (macro-declarations-alist): Add arglist to declaration functions. (defun-declarations-alist): Add `obsolete' and `compiler-macro'. * lisp/emacs-lisp/cl-seq.el (cl-member, cl-assoc): * lisp/emacs-lisp/cl-lib.el (cl-list*, cl-adjoin): * lisp/emacs-lisp/cl-extra.el (cl-get): Use the new `declare' statement. Also add autoload to find the compiler macro. * lisp/emacs-lisp/cl-macs.el (eql) [compiler-macro]: Remove. (cl--compiler-macro-member, cl--compiler-macro-assoc) (cl--compiler-macro-adjoin, cl--compiler-macro-list*) (cl--compiler-macro-get): New functions, replacing calls to cl-define-compiler-macro. (cl-typep) [compiler-macro]: Use macroexp-let².
Diffstat (limited to 'lisp/emacs-lisp/cl-seq.el')
-rw-r--r--lisp/emacs-lisp/cl-seq.el4
1 files changed, 4 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/cl-seq.el b/lisp/emacs-lisp/cl-seq.el
index 1db2f19349b..cb167ad2881 100644
--- a/lisp/emacs-lisp/cl-seq.el
+++ b/lisp/emacs-lisp/cl-seq.el
@@ -676,6 +676,7 @@ sequences, and PREDICATE is a `less-than' predicate on the elements.
Return the sublist of LIST whose car is ITEM.
\nKeywords supported: :test :test-not :key
\n(fn ITEM LIST [KEYWORD VALUE]...)"
+ (declare (compiler-macro cl--compiler-macro-member))
(if cl-keys
(cl-parsing-keywords (:test :test-not :key :if :if-not) ()
(while (and cl-list (not (cl-check-test cl-item (car cl-list))))
@@ -684,6 +685,7 @@ Return the sublist of LIST whose car is ITEM.
(if (and (numberp cl-item) (not (integerp cl-item)))
(member cl-item cl-list)
(memq cl-item cl-list))))
+(autoload 'cl--compiler-macro-member "cl-macs")
;;;###autoload
(defun cl-member-if (cl-pred cl-list &rest cl-keys)
@@ -714,6 +716,7 @@ Return the sublist of LIST whose car matches.
"Find the first item whose car matches ITEM in LIST.
\nKeywords supported: :test :test-not :key
\n(fn ITEM LIST [KEYWORD VALUE]...)"
+ (declare (compiler-macro cl--compiler-macro-assoc))
(if cl-keys
(cl-parsing-keywords (:test :test-not :key :if :if-not) ()
(while (and cl-alist
@@ -724,6 +727,7 @@ Return the sublist of LIST whose car matches.
(if (and (numberp cl-item) (not (integerp cl-item)))
(assoc cl-item cl-alist)
(assq cl-item cl-alist))))
+(autoload 'cl--compiler-macro-assoc "cl-macs")
;;;###autoload
(defun cl-assoc-if (cl-pred cl-list &rest cl-keys)