diff options
| author | Andreas Schwab | 2008-12-26 16:49:30 +0000 |
|---|---|---|
| committer | Andreas Schwab | 2008-12-26 16:49:30 +0000 |
| commit | c099a58826b5df840e889687e5e5903bd40cb9b8 (patch) | |
| tree | e49e5e0e75e417d8e2d5359a90e69e4360b465c3 | |
| parent | d3a36099e79e56cc513904728f28cfda2fe474a8 (diff) | |
| download | emacs-c099a58826b5df840e889687e5e5903bd40cb9b8.tar.gz emacs-c099a58826b5df840e889687e5e5903bd40cb9b8.zip | |
(keymap-canonicalize): Properly preserve keymap prompt.
| -rw-r--r-- | lisp/ChangeLog | 2 | ||||
| -rw-r--r-- | lisp/subr.el | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 34b98c6589e..7c13ca9f8a9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | 2008-12-26 Andreas Schwab <schwab@suse.de> | 1 | 2008-12-26 Andreas Schwab <schwab@suse.de> |
| 2 | 2 | ||
| 3 | * subr.el (keymap-canonicalize): Properly preserve keymap prompt. | ||
| 4 | |||
| 3 | * tar-mode.el (tar-swap-data): New function. | 5 | * tar-mode.el (tar-swap-data): New function. |
| 4 | (tar-change-major-mode-hook): Use it instead of buffer-swap-text. | 6 | (tar-change-major-mode-hook): Use it instead of buffer-swap-text. |
| 5 | (tar-mode-revert): Likewise. | 7 | (tar-mode-revert): Likewise. |
diff --git a/lisp/subr.el b/lisp/subr.el index a7027b44fda..7c8f844164f 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -558,7 +558,8 @@ Don't call this function; it is for internal use only." | |||
| 558 | (defun keymap-canonicalize (map) | 558 | (defun keymap-canonicalize (map) |
| 559 | "Return an equivalent keymap, without inheritance." | 559 | "Return an equivalent keymap, without inheritance." |
| 560 | (let ((bindings ()) | 560 | (let ((bindings ()) |
| 561 | (ranges ())) | 561 | (ranges ()) |
| 562 | (prompt (keymap-prompt map))) | ||
| 562 | (while (keymapp map) | 563 | (while (keymapp map) |
| 563 | (setq map (map-keymap-internal | 564 | (setq map (map-keymap-internal |
| 564 | (lambda (key item) | 565 | (lambda (key item) |
| @@ -567,8 +568,7 @@ Don't call this function; it is for internal use only." | |||
| 567 | (push (cons key item) ranges) | 568 | (push (cons key item) ranges) |
| 568 | (push (cons key item) bindings))) | 569 | (push (cons key item) bindings))) |
| 569 | map))) | 570 | map))) |
| 570 | (setq map (funcall (if ranges 'make-keymap 'make-sparse-keymap) | 571 | (setq map (funcall (if ranges 'make-keymap 'make-sparse-keymap) prompt)) |
| 571 | (keymap-prompt map))) | ||
| 572 | (dolist (binding ranges) | 572 | (dolist (binding ranges) |
| 573 | ;; Treat char-ranges specially. | 573 | ;; Treat char-ranges specially. |
| 574 | (define-key map (vector (car binding)) (cdr binding))) | 574 | (define-key map (vector (car binding)) (cdr binding))) |