all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#69786: [PATCH] docs: mention the keymap to add keybindings to for term-mode
@ 2024-03-13 23:39 Konstantin Kharlamov
  2024-03-14  5:11 ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Konstantin Kharlamov @ 2024-03-13 23:39 UTC (permalink / raw)
  To: 69786

[-- Attachment #1: Type: text/plain, Size: 670 bytes --]

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.

[-- Attachment #2: 1.patch --]
[-- Type: text/x-patch, Size: 1060 bytes --]

From f0cf72a973caf5063a4a1cab4fcc0bd73d0d7976 Mon Sep 17 00:00:00 2001
From: Konstantin Kharlamov <Hi-Angel@yandex.ru>
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


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-03-16 13:20 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-13 23:39 bug#69786: [PATCH] docs: mention the keymap to add keybindings to for term-mode Konstantin Kharlamov
2024-03-14  5:11 ` Eli Zaretskii
2024-03-14  7:20   ` Konstantin Kharlamov
2024-03-14  7:23     ` Konstantin Kharlamov
2024-03-14  7:34       ` Eli Zaretskii
2024-03-14  7:33     ` Eli Zaretskii
2024-03-14  7:53       ` Konstantin Kharlamov
2024-03-14 11:09         ` Eli Zaretskii
2024-03-16 10:36           ` Konstantin Kharlamov
2024-03-16 11:31             ` Eli Zaretskii
2024-03-16 13:20               ` Konstantin Kharlamov

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.