Commit c099a588 authored by Andreas Schwab's avatar Andreas Schwab
Browse files

(keymap-canonicalize): Properly preserve keymap prompt.

parent d3a36099
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.
......
......@@ -558,7 +558,8 @@ Don't call this function; it is for internal use only."
(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 @@ Don't call this function; it is for internal use only."
(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)))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment