From: Elena <egarrulo@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Short-circuiting keybindings?
Date: Wed, 10 Nov 2010 03:15:13 -0800 (PST) [thread overview]
Message-ID: <d360e058-47a7-41b9-8742-66b71b0d1f53@d28g2000yqn.googlegroups.com> (raw)
In-Reply-To: 87k4kmf3at.fsf@kuiper.lan.informatimago.com
On 10 Nov, 00:08, p...@informatimago.com (Pascal J. Bourguignon)
wrote:
> Elena <egarr...@gmail.com> writes:
> > is there a generic way to create "short-circuiting" keybindings? I
> > mean: let's say I want "C-b" to issue a command only whenever a
> > condition is met, otherwise if "C-b" is a prefix key then Emacs should
> > continue listening for keystrokes and execute commands when
> > appropriate.
>
> Really, to do what you have in mind, the easiest and cleanest would be
> to modify the core of emacs, in the C sources.
Ouch! That would be cumbersome.
> > You could add hooks, or change the mechanisms.
Thanks for your suggestion. Such goal can be achieved on case basis.
For instance, let's say we want "C-b" to be bound to a command, thus
shadowing "C-b C-c", only when region is active. We could bind "C-b C-
b" globally, while binding "C-b" in `activate-mark-hook' and unbinding
it in `deactivate-mark-hook'. Right?
next prev parent reply other threads:[~2010-11-10 11:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-09 21:06 Short-circuiting keybindings? Elena
[not found] ` <87k4kmf3at.fsf@kuiper.lan.informatimago.com>
2010-11-10 11:15 ` Elena [this message]
2010-11-10 18:19 ` Stefan Monnier
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=d360e058-47a7-41b9-8742-66b71b0d1f53@d28g2000yqn.googlegroups.com \
--to=egarrulo@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/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.