Subject: [PATCH] docs: mention the keymap to add keybindings to for term-mode

From: Konstantin Kharlamov <[email-masked]>
Date: Thu, 14 Mar 2024 02:39:23 +0300

I've spent quite some time today trying to somehow override keybindings
for term-mode. While time was spent mostly due to some local mistakes,
one problem I also noticed is that term-mode has `term-mode-map` —
pretty much like any other major mode foo typically have `foo-mode-
map`. However, adding keybindings into it has no effect whatsoever.
Instead term-mode has an additional `term-raw-map`, which is the actual
location where one has to put custom bindings.

It is completely non-intuitive (and I also for some reason didn't get
the answer on emacs.stackexchange for the same problem when I was
trying to google it), so let's document that nuisance.
From f0cf72a973caf5063a4a1cab4fcc0bd73d0d7976 Mon Sep 17 00:00:00 2001
From: Konstantin Kharlamov <[email-masked]>
Date: Thu, 14 Mar 2024 02:33:06 +0300
Subject: [PATCH] docs: mention the keymap to add keybindings to for term-mode

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.

* doc/emacs/misc.texi (Term mode): mention the keymap to add
keybindings to for term-mode
---
 doc/emacs/misc.texi | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi
index 7eb28f56826..471cd2eed1a 100644
--- a/doc/emacs/misc.texi
+++ b/doc/emacs/misc.texi
@@ -1651,6 +1651,10 @@ Term Mode
 interface is similar to the @code{more} program.
 @end table
 
+@cindex keymap in Term mode
+  To add custom keybindings to the Term mode use @code{term-raw-map}
+keymap.
+
 @node Remote Host
 @subsection Remote Host Shell
 @cindex remote host
-- 
2.44.0