diff lisp/subr.el @ 100699:ad20c1d5df89

(keymap-canonicalize): Properly preserve keymap prompt.
author Andreas Schwab <schwab@suse.de>
date Fri, 26 Dec 2008 16:49:30 +0000
parents 5478b71d59c6
children 2935e76b69a8
line wrap: on
line diff
--- a/lisp/subr.el	Fri Dec 26 16:38:00 2008 +0000
+++ b/lisp/subr.el	Fri Dec 26 16:49:30 2008 +0000
@@ -558,7 +558,8 @@
 (defun keymap-canonicalize (map)
   "Return an equivalent keymap, without inheritance."
   (let ((bindings ())
-        (ranges ()))
+        (ranges ())
+	(prompt (keymap-prompt map)))
     (while (keymapp map)
       (setq map (map-keymap-internal
                  (lambda (key item)
@@ -567,8 +568,7 @@
                        (push (cons key item) ranges)
                      (push (cons key item) bindings)))
                  map)))
-    (setq map (funcall (if ranges 'make-keymap 'make-sparse-keymap)
-                       (keymap-prompt map)))
+    (setq map (funcall (if ranges 'make-keymap 'make-sparse-keymap) prompt))
     (dolist (binding ranges)
       ;; Treat char-ranges specially.
       (define-key map (vector (car binding)) (cdr binding)))