all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jan Synacek <jsynacek@redhat.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Documentation for overriding-terminal-local-map is confusing?
Date: Mon, 25 May 2020 18:38:56 +0200	[thread overview]
Message-ID: <CAPsXM8WjYYR0aQ_Oo-Bx7rH59YghFfJK=fTt3YDuJzBk-HWLSw@mail.gmail.com> (raw)
In-Reply-To: <jwvzh9wf6uq.fsf-monnier+emacs@gnu.org>

On Mon, May 25, 2020 at 4:08 PM Stefan Monnier <monnier@iro.umontreal.ca> 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	other threads:[~2020-05-25 16:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-25  8:49 Documentation for overriding-terminal-local-map is confusing? Jan Synacek
2020-05-25 14:08 ` Stefan Monnier
2020-05-25 16:38   ` Jan Synacek [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPsXM8WjYYR0aQ_Oo-Bx7rH59YghFfJK=fTt3YDuJzBk-HWLSw@mail.gmail.com' \
    --to=jsynacek@redhat.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.