summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/cl-lib.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2012-11-10 15:13:33 -0800
committerGlenn Morris <rgm@gnu.org>2012-11-10 15:13:33 -0800
commit6baf66d53bbedd85a443e0d69d1f4311a93f0677 (patch)
tree38d7a00d5f7d5aecb86285d334fa15a31e5fbab1 /lisp/emacs-lisp/cl-lib.el
parent05a859c1bd9cd07b2c0fad06a0694e88ea929fcf (diff)
parente4e46889223296e8875548d278340b21db449a4a (diff)
downloademacs-6baf66d53bbedd85a443e0d69d1f4311a93f0677.tar.gz
emacs-6baf66d53bbedd85a443e0d69d1f4311a93f0677.tar.bz2
emacs-6baf66d53bbedd85a443e0d69d1f4311a93f0677.zip
Merge from emacs-24; up to 2012-11-08T14:54:03Z!monnier@iro.umontreal.ca
Diffstat (limited to 'lisp/emacs-lisp/cl-lib.el')
-rw-r--r--lisp/emacs-lisp/cl-lib.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el
index 034a5c7517e..a9be08b1383 100644
--- a/lisp/emacs-lisp/cl-lib.el
+++ b/lisp/emacs-lisp/cl-lib.el
@@ -251,12 +251,17 @@ one value.
(defvar cl-proclaims-deferred nil)
(defun cl-proclaim (spec)
+ "Record a global declaration specified by SPEC."
(if (fboundp 'cl-do-proclaim) (cl-do-proclaim spec t)
(push spec cl-proclaims-deferred))
nil)
(defmacro cl-declaim (&rest specs)
- (let ((body (mapcar (function (lambda (x) (list 'cl-proclaim (list 'quote x))))
+ "Like `cl-proclaim', but takes any number of unevaluated, unquoted arguments.
+Puts `(cl-eval-when (compile load eval) ...)' around the declarations
+so that they are registered at compile-time as well as run-time."
+ (let ((body (mapcar (function (lambda (x)
+ (list 'cl-proclaim (list 'quote x))))
specs)))
(if (cl--compiling-file) (cl-list* 'cl-eval-when '(compile load eval) body)
(cons 'progn body)))) ; avoid loading cl-macs.el for cl-eval-when