mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-04 11:40:22 +00:00
* subr.el (map-keymap-sorted): Rename from map-keymap-internal.
Remove `sort-first' argument. * keymap.c (Fmap_keymap): Use `map-keymap-sorted.
This commit is contained in:
parent
d7b10f4c2e
commit
a10cca6c90
@ -1,5 +1,8 @@
|
||||
2008-03-25 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||
|
||||
* subr.el (map-keymap-sorted): Rename from map-keymap-internal.
|
||||
Remove `sort-first' argument.
|
||||
|
||||
* subr.el (redisplay-end-trigger-functions)
|
||||
(window-redisplay-end-trigger, set-window-redisplay-end-trigger)
|
||||
(process-filter-multibyte-p, set-process-filter-multibyte):
|
||||
|
32
lisp/subr.el
32
lisp/subr.el
@ -532,25 +532,23 @@ The order of bindings in a keymap matters when it is used as a menu."
|
||||
(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)
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
2008-03-25 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||
|
||||
* keymap.c (Fmap_keymap): Use `map-keymap-sorted.
|
||||
|
||||
* frame.c (Fmodify_frame_parameters, x_set_frame_parameters):
|
||||
Use XCAR/XCDR.
|
||||
|
||||
|
@ -735,7 +735,7 @@ usage: (map-keymap FUNCTION KEYMAP) */)
|
||||
significance. */
|
||||
xsignal1 (Qinvalid_function, function);
|
||||
if (! NILP (sort_first))
|
||||
return call3 (intern ("map-keymap-internal"), function, keymap, Qt);
|
||||
return call2 (intern ("map-keymap-sorted"), function, keymap);
|
||||
|
||||
map_keymap (keymap, map_keymap_call, function, NULL, 1);
|
||||
return Qnil;
|
||||
|
Loading…
Reference in New Issue
Block a user