From 8f5d861fcc91d590d5e7370b1eb1e79e6e69f62d Mon Sep 17 00:00:00 2001 From: Konstantin Kharlamov Date: Sat, 16 Mar 2024 13:24:34 +0300 Subject: [PATCH] term-mode: mention the keymap to add keybindings to A user typically expects a keymap for mode `foo` to be called `foo-mode-map`. term-mode has `term-mode-map` too, but for user-defined bindings to have effect they have to be put to `term-raw-map` instead. So let's mention that. * lisp/term.el (term-mode) (term-mode-map) (term-raw-map): mention the keymap to add keybindings to for term-mode --- lisp/term.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lisp/term.el b/lisp/term.el index 2ce0c2b5e79..9c890e80379 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -658,7 +658,8 @@ term-mode-map ["Forward Output Group" term-next-prompt t] ["Kill Current Output Group" term-kill-output t])) map) - "Keymap for Term mode.") + "Keymap for \"line mode\" in Term mode. For custom keybindings purposes +please note there is also `term-raw-map'") (defvar term-escape-char nil "Escape character for char sub-mode of term mode. @@ -961,7 +962,9 @@ term-raw-map (dotimes (key 21) (keymap-set map (format "" key) #'term-send-function-key))) map) - "Keyboard map for sending characters directly to the inferior process.") + "Keyboard map for sending characters directly to the inferior process. +For custom keybindings purposes please note there is also +`term-mode-map'") (easy-menu-define term-terminal-menu (list term-mode-map term-raw-map term-pager-break-map) @@ -1122,6 +1125,10 @@ term-mode and the variable `term-prompt-regexp' to the appropriate regular expression. +If you define custom keybindings, make sure to assign them to the +correct keymap (or to both): use `term-raw-map' in raw mode and +`term-mode-map' in line mode. + Commands in raw mode: \\{term-raw-map} -- 2.44.0