2008-12-26 Andreas Schwab <schwab@suse.de>
+ * subr.el (keymap-canonicalize): Properly preserve keymap prompt.
+
* tar-mode.el (tar-swap-data): New function.
(tar-change-major-mode-hook): Use it instead of buffer-swap-text.
(tar-mode-revert): Likewise.
(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)
(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)))