Mercurial > emacs
diff lisp/subr.el @ 93204:9f83f0ec5257
* subr.el (map-keymap-sorted): Rename from map-keymap-internal.
Remove `sort-first' argument.
* keymap.c (Fmap_keymap): Use `map-keymap-sorted.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Tue, 25 Mar 2008 19:42:34 +0000 |
parents | c264aa814b15 |
children | c15f559a5ada |
line wrap: on
line diff
--- a/lisp/subr.el Tue Mar 25 18:31:36 2008 +0000 +++ b/lisp/subr.el Tue Mar 25 19:42:34 2008 +0000 @@ -532,25 +532,23 @@ (setq inserted t))) (setq tail (cdr tail))))) -(defun map-keymap-internal (function keymap &optional sort-first) +(defun map-keymap-sorted (function keymap) "Implement `map-keymap' with sorting. Don't call this function; it is for internal use only." - (if sort-first - (let (list) - (map-keymap (lambda (a b) (push (cons a b) list)) - keymap) - (setq list (sort list - (lambda (a b) - (setq a (car a) b (car b)) - (if (integerp a) - (if (integerp b) (< a b) - t) - (if (integerp b) t - ;; string< also accepts symbols. - (string< a b)))))) - (dolist (p list) - (funcall function (car p) (cdr p)))) - (map-keymap function keymap))) + (let (list) + (map-keymap (lambda (a b) (push (cons a b) list)) + keymap) + (setq list (sort list + (lambda (a b) + (setq a (car a) b (car b)) + (if (integerp a) + (if (integerp b) (< a b) + t) + (if (integerp b) t + ;; string< also accepts symbols. + (string< a b)))))) + (dolist (p list) + (funcall function (car p) (cdr p))))) (put 'keyboard-translate-table 'char-table-extra-slots 0)