aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2003-05-04 00:44:25 +0000
committerStefan Monnier2003-05-04 00:44:25 +0000
commit09dae035eb8ee4de88a5270a58bfc8ca16f8c60a (patch)
treec23d79da45aa458e15dcfbb074936797895d65a2
parent0d7a020af5fc9ad3ad1797cd668464dccd0b14d0 (diff)
downloademacs-09dae035eb8ee4de88a5270a58bfc8ca16f8c60a.tar.gz
emacs-09dae035eb8ee4de88a5270a58bfc8ca16f8c60a.zip
(cl-map-keymap): Redefine as alias.
(cl-map-keymap-recursively): Use map-keymap. (cl-macroexpand-all): Don't quote functions.
-rw-r--r--lisp/emacs-lisp/cl-extra.el27
1 files changed, 6 insertions, 21 deletions
diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el
index aa6b4f9ae48..f8fcd020703 100644
--- a/lisp/emacs-lisp/cl-extra.el
+++ b/lisp/emacs-lisp/cl-extra.el
@@ -203,26 +203,12 @@ If so, return the true (non-nil) value returned by PREDICATE."
203 (not (apply 'every cl-pred cl-seq cl-rest))) 203 (not (apply 'every cl-pred cl-seq cl-rest)))
204 204
205;;; Support for `loop'. 205;;; Support for `loop'.
206(defun cl-map-keymap (cl-func cl-map) 206(defalias 'cl-map-keymap 'map-keymap)
207 (while (symbolp cl-map) (setq cl-map (symbol-function cl-map)))
208 (if (listp cl-map)
209 (let ((cl-p cl-map))
210 (while (consp (setq cl-p (cdr cl-p)))
211 (cond ((consp (car cl-p))
212 (funcall cl-func (car (car cl-p)) (cdr (car cl-p))))
213 ((or (vectorp (car cl-p)) (char-table-p (car cl-p)))
214 (cl-map-keymap cl-func (car cl-p)))
215 ((eq (car cl-p) 'keymap)
216 (setq cl-p nil)))))
217 (let ((cl-i -1))
218 (while (< (setq cl-i (1+ cl-i)) (length cl-map))
219 (if (aref cl-map cl-i)
220 (funcall cl-func cl-i (aref cl-map cl-i)))))))
221 207
222(defun cl-map-keymap-recursively (cl-func-rec cl-map &optional cl-base) 208(defun cl-map-keymap-recursively (cl-func-rec cl-map &optional cl-base)
223 (or cl-base 209 (or cl-base
224 (setq cl-base (copy-sequence [0]))) 210 (setq cl-base (copy-sequence [0])))
225 (cl-map-keymap 211 (map-keymap
226 (function 212 (function
227 (lambda (cl-key cl-bind) 213 (lambda (cl-key cl-bind)
228 (aset cl-base (1- (length cl-base)) cl-key) 214 (aset cl-base (1- (length cl-base)) cl-key)
@@ -721,11 +707,10 @@ This also does some trivial optimizations to make the form prettier."
721 (sublis sub (nreverse decls)) 707 (sublis sub (nreverse decls))
722 (list 708 (list
723 (list* 'list '(quote apply) 709 (list* 'list '(quote apply)
724 (list 'list '(quote quote) 710 (list 'function
725 (list 'function 711 (list* 'lambda
726 (list* 'lambda 712 (append new (cadadr form))
727 (append new (cadadr form)) 713 (sublis sub body)))
728 (sublis sub body))))
729 (nconc (mapcar (function 714 (nconc (mapcar (function
730 (lambda (x) 715 (lambda (x)
731 (list 'list '(quote quote) x))) 716 (list 'list '(quote quote) x)))