diff options
| author | Richard M. Stallman | 1997-03-22 03:55:21 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-03-22 03:55:21 +0000 |
| commit | 328a37ec312c1eadedae8210b9554d2e51353981 (patch) | |
| tree | cd42c06a68c27ef918b92567679aa7a3d0d1c5cf | |
| parent | 1cd24721c27168c7c4e7084bea061ed1653d5ed8 (diff) | |
| download | emacs-328a37ec312c1eadedae8210b9554d2e51353981.tar.gz emacs-328a37ec312c1eadedae8210b9554d2e51353981.zip | |
(substitute-key-definition):
Compare with equal if definition is a key sequence.
| -rw-r--r-- | lisp/subr.el | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/subr.el b/lisp/subr.el index 3f215b1970d..a498cea5b37 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -125,7 +125,11 @@ in KEYMAP as NEWDEF those chars which are defined as OLDDEF in OLDMAP." | |||
| 125 | (while (and (symbolp inner-def) | 125 | (while (and (symbolp inner-def) |
| 126 | (fboundp inner-def)) | 126 | (fboundp inner-def)) |
| 127 | (setq inner-def (symbol-function inner-def))) | 127 | (setq inner-def (symbol-function inner-def))) |
| 128 | (if (eq defn olddef) | 128 | (if (or (eq defn olddef) |
| 129 | ;; Compare with equal if definition is a key sequence. | ||
| 130 | ;; That is useful for operating on function-key-map. | ||
| 131 | (and (or (stringp defn) (vectorp defn)) | ||
| 132 | (equal defn olddef))) | ||
| 129 | (define-key keymap prefix1 (nconc (nreverse skipped) newdef)) | 133 | (define-key keymap prefix1 (nconc (nreverse skipped) newdef)) |
| 130 | (if (and (keymapp defn) | 134 | (if (and (keymapp defn) |
| 131 | ;; Avoid recursively scanning | 135 | ;; Avoid recursively scanning |
| @@ -162,7 +166,9 @@ in KEYMAP as NEWDEF those chars which are defined as OLDDEF in OLDMAP." | |||
| 162 | (while (and (symbolp inner-def) | 166 | (while (and (symbolp inner-def) |
| 163 | (fboundp inner-def)) | 167 | (fboundp inner-def)) |
| 164 | (setq inner-def (symbol-function inner-def))) | 168 | (setq inner-def (symbol-function inner-def))) |
| 165 | (if (eq defn olddef) | 169 | (if (or (eq defn olddef) |
| 170 | (and (or (stringp defn) (vectorp defn)) | ||
| 171 | (equal defn olddef))) | ||
| 166 | (define-key keymap prefix1 | 172 | (define-key keymap prefix1 |
| 167 | (nconc (nreverse skipped) newdef)) | 173 | (nconc (nreverse skipped) newdef)) |
| 168 | (if (and (keymapp defn) | 174 | (if (and (keymapp defn) |