Mercurial > emacs
comparison lisp/subr.el @ 17215:21e3f467224e
(substitute-key-definition):
Compare with equal if definition is a key sequence.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 22 Mar 1997 03:55:21 +0000 |
parents | f181580c182c |
children | 726a87ac1486 |
comparison
equal
deleted
inserted
replaced
17214:15e868121a15 | 17215:21e3f467224e |
---|---|
123 (setq inner-def defn) | 123 (setq inner-def defn) |
124 ;; Look past a symbol that names a keymap. | 124 ;; Look past a symbol that names a keymap. |
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 |
132 ;; where KEYMAP does not have a submap. | 136 ;; where KEYMAP does not have a submap. |
133 (let ((elt (lookup-key keymap prefix1))) | 137 (let ((elt (lookup-key keymap prefix1))) |
160 (setq defn (cdr defn))) | 164 (setq defn (cdr defn))) |
161 (setq inner-def defn) | 165 (setq inner-def defn) |
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) |
169 (let ((elt (lookup-key keymap prefix1))) | 175 (let ((elt (lookup-key keymap prefix1))) |
170 (or (null elt) | 176 (or (null elt) |