1335 |
instead of @code{kill-line} and @code{kill-word}. It can establish |
instead of @code{kill-line} and @code{kill-word}. It can establish |
1336 |
this by making these two command-remapping bindings in its keymap: |
this by making these two command-remapping bindings in its keymap: |
1337 |
|
|
1338 |
@example |
@smallexample |
1339 |
(define-key my-mode-map [remap kill-line] 'my-kill-line) |
(define-key my-mode-map [remap kill-line] 'my-kill-line) |
1340 |
(define-key my-mode-map [remap kill-word] 'my-kill-word) |
(define-key my-mode-map [remap kill-word] 'my-kill-word) |
1341 |
@end example |
@end smallexample |
1342 |
|
|
1343 |
Whenever @code{my-mode-map} is an active keymap, if the user types |
Whenever @code{my-mode-map} is an active keymap, if the user types |
1344 |
@kbd{C-k}, Emacs will find the standard global binding of |
@kbd{C-k}, Emacs will find the standard global binding of |
1349 |
|
|
1350 |
Remapping only works through a single level. In other words, |
Remapping only works through a single level. In other words, |
1351 |
|
|
1352 |
@example |
@smallexample |
1353 |
(define-key my-mode-map [remap kill-line] 'my-kill-line) |
(define-key my-mode-map [remap kill-line] 'my-kill-line) |
1354 |
(define-key my-mode-map [remap my-kill-line] 'my-other-kill-line) |
(define-key my-mode-map [remap my-kill-line] 'my-other-kill-line) |
1355 |
@end example |
@end smallexample |
1356 |
|
|
1357 |
@noindent |
@noindent |
1358 |
does not have the effect of remapping @code{kill-line} into |
does not have the effect of remapping @code{kill-line} into |