# HG changeset patch # User Andreas Schwab # Date 1230310170 0 # Node ID ad20c1d5df899c61bdb31e81838c234cf44ce80c # Parent 2ff8670c7e9f782e2157e6a3a8b1088d7ac0c05f (keymap-canonicalize): Properly preserve keymap prompt. diff -r 2ff8670c7e9f -r ad20c1d5df89 lisp/ChangeLog --- a/lisp/ChangeLog Fri Dec 26 16:38:00 2008 +0000 +++ b/lisp/ChangeLog Fri Dec 26 16:49:30 2008 +0000 @@ -1,5 +1,7 @@ 2008-12-26 Andreas Schwab + * 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. diff -r 2ff8670c7e9f -r ad20c1d5df89 lisp/subr.el --- 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)))