diff options
author | Richard M. Stallman <rms@gnu.org> | 1997-05-22 19:00:25 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1997-05-22 19:00:25 +0000 |
commit | 30b736204cc2e0d4ec9134109de8b8717c480449 (patch) | |
tree | 6b8a3a6328612181818b481814cd25f4c9312684 /lisp/subr.el | |
parent | 4c747214d94b50ca6fae72115e2691545b163318 (diff) | |
download | emacs-30b736204cc2e0d4ec9134109de8b8717c480449.tar.gz |
(substitute-key-definition): Handle chartables.
Diffstat (limited to 'lisp/subr.el')
-rw-r--r-- | lisp/subr.el | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/lisp/subr.el b/lisp/subr.el index a4ad6937f43..f4a457ab1d3 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -180,7 +180,44 @@ in KEYMAP as NEWDEF those chars which are defined as OLDDEF in OLDMAP." (substitute-key-definition olddef newdef keymap inner-def prefix1))))) - (setq i (1+ i)))))) + (setq i (1+ i)))) + (if (char-table-p (car scan)) + (map-char-table + (function (lambda (char defn) + (let () + ;; The inside of this let duplicates exactly + ;; the inside of the previous let, + ;; except that it uses set-char-table-range + ;; instead of define-key. + (aset vec1 0 char) + (aset prefix1 (length prefix) char) + (let (inner-def skipped) + ;; Skip past menu-prompt. + (while (stringp (car-safe defn)) + (setq skipped (cons (car defn) skipped)) + (setq defn (cdr defn))) + (and (consp defn) (consp (car defn)) + (setq defn (cdr defn))) + (setq inner-def defn) + (while (and (symbolp inner-def) + (fboundp inner-def)) + (setq inner-def (symbol-function inner-def))) + (if (or (eq defn olddef) + (and (or (stringp defn) (vectorp defn)) + (equal defn olddef))) + (set-char-table-range (car scan) + char + (nconc (nreverse skipped) newdef)) + (if (and (keymapp defn) + (let ((elt (lookup-key keymap prefix1))) + (or (null elt) + (keymapp elt))) + (not (memq inner-def + key-substitution-in-progress))) + (substitute-key-definition olddef newdef keymap + inner-def + prefix1))))))) + (car scan))))) (setq scan (cdr scan))))) (defun define-key-after (keymap key definition after) |