diff options
| author | Vincent Belaïche | 2016-07-28 18:12:50 +0200 |
|---|---|---|
| committer | Vincent Belaïche | 2016-07-28 18:12:50 +0200 |
| commit | 90ab699c4f281d0c9a9b71f3eb4c8493d00fcf4f (patch) | |
| tree | df3235d89ee8e4d32571b8a8521f75f7576913c2 /src/keymap.c | |
| parent | 41b28dea8587c13b0bc59c1ec70b65afab3aeeca (diff) | |
| parent | ec359399a47f852b4d022a30245449438e349193 (diff) | |
| download | emacs-90ab699c4f281d0c9a9b71f3eb4c8493d00fcf4f.tar.gz emacs-90ab699c4f281d0c9a9b71f3eb4c8493d00fcf4f.zip | |
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Diffstat (limited to 'src/keymap.c')
| -rw-r--r-- | src/keymap.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/keymap.c b/src/keymap.c index 44335aded87..b27df1d0452 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -971,8 +971,18 @@ copy_keymap_1 (Lisp_Object chartable, Lisp_Object idx, Lisp_Object elt) | |||
| 971 | 971 | ||
| 972 | DEFUN ("copy-keymap", Fcopy_keymap, Scopy_keymap, 1, 1, 0, | 972 | DEFUN ("copy-keymap", Fcopy_keymap, Scopy_keymap, 1, 1, 0, |
| 973 | doc: /* Return a copy of the keymap KEYMAP. | 973 | doc: /* Return a copy of the keymap KEYMAP. |
| 974 | The copy starts out with the same definitions of KEYMAP, | 974 | |
| 975 | but changing either the copy or KEYMAP does not affect the other. | 975 | Note that this is almost never needed. If you want a keymap that's like |
| 976 | another yet with a few changes, you should use map inheritance rather | ||
| 977 | than copying. I.e. something like: | ||
| 978 | |||
| 979 | (let ((map (make-sparse-keymap))) | ||
| 980 | (set-keymap-parent map <theirmap>) | ||
| 981 | (define-key map ...) | ||
| 982 | ...) | ||
| 983 | |||
| 984 | After performing `copy-keymap', the copy starts out with the same definitions | ||
| 985 | of KEYMAP, but changing either the copy or KEYMAP does not affect the other. | ||
| 976 | Any key definitions that are subkeymaps are recursively copied. | 986 | Any key definitions that are subkeymaps are recursively copied. |
| 977 | However, a key definition which is a symbol whose definition is a keymap | 987 | However, a key definition which is a symbol whose definition is a keymap |
| 978 | is not copied. */) | 988 | is not copied. */) |