aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaokotani <naokotani@protonmail.com>2024-01-11 05:50:40 -0800
committerGitHub <noreply@github.com>2024-01-11 14:50:40 +0100
commit59774e369aefba721ff8b72bfb88bdf12f8ecd74 (patch)
tree51044dc938f039fe93e3cbb6c98419d47fea64c2
parent6ca32ca05eef41c3bc3d9cc66fc052741250bc3a (diff)
Added clarification to evil-define-key for escaping modifier keys (#1856)
* Added clarification to evil-define-key for escaping modifier keys It is useful to have clarification in the doc string for evil-define-key that it is necessary to escape modifiers keys for users that are accustomed to using functions like global-set-key or keymap-global-set where this is not necessary. This is also not made particularly clear in the define-key function itself, which is a legacy function. * Fixed poor wording and used kdb in place of escape sequence
-rw-r--r--evil-core.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/evil-core.el b/evil-core.el
index 4190997..614d8ea 100644
--- a/evil-core.el
+++ b/evil-core.el
@@ -958,7 +958,14 @@ the following lead to identical bindings:
The symbol `local' may also be used, which corresponds to using
`evil-local-set-key'. If a quoted symbol is used that is not
`global' or `local', it is assumed to be the name of a minor
-mode, in which case `evil-define-minor-mode-key' is used."
+mode, in which case `evil-define-minor-mode-key' is used.
+
+KEY is an internal Emacs representation of a key, as for
+`define-key'. To bind key sequences that use modifier keys such
+as \"C-a\" or \"M-a\", convert the key sequences using `kbd'.
+For example:
+
+ (evil-define-key \\='normal foo-map (kbd \"C-a\") \\='bar)"
(declare (indent defun))
(cond
((member keymap '('global 'local))