emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/subr.el [lexbind]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/subr.el [lexbind]
Date: Wed, 08 Dec 2004 19:34:15 -0500

Index: emacs/lisp/subr.el
diff -c emacs/lisp/subr.el:1.307.2.29 emacs/lisp/subr.el:1.307.2.30
*** emacs/lisp/subr.el:1.307.2.29       Fri Nov 12 04:21:11 2004
--- emacs/lisp/subr.el  Wed Dec  8 23:31:41 2004
***************
*** 490,495 ****
--- 490,513 ----
            (setq inserted t)))
        (setq tail (cdr tail)))))
  
+ (defun map-keymap-internal (function keymap &optional sort-first)
+   "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< a b))))))
+       (dolist (p list)
+         (funcall function (car p) (cdr p))))
+     (map-keymap function keymap)))
  
  (defmacro kbd (keys)
    "Convert KEYS to the internal Emacs key representation.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]