all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Teemu Likonen <tlikonen@iki.fi>
Cc: emacs-devel@gnu.org
Subject: Re: substitute-key-definition vs. define-key MAP [remap ...]
Date: Fri, 23 Jul 2010 00:36:02 +0200	[thread overview]
Message-ID: <jwvbp9zrvx3.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <871vb517a6.fsf@mithlond.arda> (Teemu Likonen's message of "Thu,  15 Jul 2010 11:25:05 +0300")

> So, am I right in saying that using substitute-key-definition on global
> map directly is a bad practice?

Yes and no.  Part of the reason why it exists is because that code was
written before remap was available.  Another part is because I'm not
sure remap is available in XEmacs, so packages who want to work in
XEmacs may prefer not to use it.

Finally, in some cases, using remap is not the right answer either
because remap not only replaces the command at its "usual" key-bindings,
but at all its key-bindings, which means that the user has no way to
access the original command other than via M-x (she can't make her own
key-binding for it, for instance).  So remap can only be used when the
remapped command really makes the original command undesirable.


        Stefan



  reply	other threads:[~2010-07-22 22:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-15  8:25 substitute-key-definition vs. define-key MAP [remap ...] Teemu Likonen
2010-07-22 22:36 ` Stefan Monnier [this message]
2010-07-23  3:50   ` Stephen J. Turnbull
2010-07-23  9:26     ` Stefan Monnier
2010-07-23  9:32       ` Miles Bader
2010-07-24  7:08         ` Stephen J. Turnbull
2010-07-24  8:19           ` David Kastrup
2010-07-24  9:33           ` Miles Bader
2010-07-24 14:25             ` Stephen J. Turnbull
2010-07-25  3:21               ` Miles Bader
2010-07-25 10:19                 ` Stephen J. Turnbull
2010-07-25 13:43                   ` Miles Bader
2010-07-23 10:03       ` David Kastrup
2010-07-24  6:27         ` Stephen J. Turnbull

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=jwvbp9zrvx3.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=tlikonen@iki.fi \
    /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.