[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Documentation for overriding-terminal-local-map is confusing?

From: Jan Synacek
Subject: Documentation for overriding-terminal-local-map is confusing?
Date: Mon, 25 May 2020 10:49:47 +0200


I currently have this piece of elisp in my init.el:
(setf jsynacek-terminal-map (make-sparse-keymap))
(setf overriding-terminal-local-map jsynacek-terminal-map)
(define-key jsynacek-terminal-map (kbd "C-b") 'ido-switch-buffer)
(define-key jsynacek-terminal-map (kbd "C-o") 'find-file)

It works until I use isearch-forward, which resets
overriding-terminal-local-map. It took me a while to figure out, until I
noticed this in "22.9 Controlling the Active Keymaps" in the ELisp

"This variable is always local to the current terminal and cannot be
buffer-local.  *Note Multiple Terminals::.  It is used to implement
incremental search mode."

That basically means that the keymap is pretty much useless for
overriding anything, doesn't it? Because it always gets reset whenever
the user starts searching for something. Also, the rest of the manual
that mentions overriding-terminal-local-map kind of suggests that it's
supposed to be used exactly how I wanted to use it - to make one's own
global keybindings that work no matter what the current modes are.

So my questions are:

1) Is this actually a "bug" in the manual? That is, shouldn't the manual
be changed to be clearer? If yes, I can file a bug report.

2) What is the proper way to make my own keymap that overrides
everything? I know that the 'use-package/bind-key' package does this by
creating a minor mode and then using emulation-mode-map-alists, but the
variable's documentation doesn't even remotely suggest to use it that


reply via email to

[Prev in Thread] Current Thread [Next in Thread]