]> git.eshelyaron.com Git - emacs.git/commitdiff
`term-mode': mention the keymap to add keybindings to
authorKonstantin Kharlamov <Hi-Angel@yandex.ru>
Sat, 16 Mar 2024 10:24:34 +0000 (13:24 +0300)
committerEshel Yaron <me@eshelyaron.com>
Sun, 24 Mar 2024 14:12:10 +0000 (15:12 +0100)
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 keymaps to add keybindings to for `term-mode'.  (Bug#69786)

(cherry picked from commit f48babb1120343f211367a1b5854dc7740c3091d)

lisp/term.el

index 3a0ecc041cac76378a73319c04e36b4b1bd6c991..c15f6cf2e9f97278385e54a9526fea2a0bcf35a4 100644 (file)
@@ -658,7 +658,8 @@ executed once, when the buffer is created."
         ["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 @@ underlying shell."
       (dotimes (key 21)
         (keymap-set map (format "<f%d>" 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 @@ particular subprocesses.  This can be done by setting the hooks
 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}