[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Documentation for overriding-terminal-local-map is confusing?
From: |
Stefan Monnier |
Subject: |
Re: Documentation for overriding-terminal-local-map is confusing? |
Date: |
Mon, 25 May 2020 10:08:03 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
> 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 manual:
I guess you're victim of the fact that the ELisp manual is not written
for people editing their init.el but for people writing Elisp packages.
> 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
> way.
emulation-mode-map-alists is meant for that, yes.
(think of it as emulating the UI of an editor that binds C-b to
switch-buffer, ...)
Stefan