[Top][All Lists]

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

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

From: Jan Synacek
Subject: Re: Documentation for overriding-terminal-local-map is confusing?
Date: Mon, 25 May 2020 18:38:56 +0200

On Mon, May 25, 2020 at 4:08 PM Stefan Monnier <> wrote:
> > 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.

Yes, that's what also came to my mind. And that's actually fine.
But, I still think that the manual could be improved in this regard a bit.

> > 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, ...)

I see.

Thank you,
Jan Synacek
Software Engineer, Red Hat

reply via email to

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