From: Xah Lee <xahlee@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Looking up and CALLING a key binding
Date: Wed, 7 Jan 2009 10:08:57 -0800 (PST) [thread overview]
Message-ID: <362bfee7-cf0f-4832-b89c-52b30b902c19@d42g2000prb.googlegroups.com> (raw)
In-Reply-To: mailman.4126.1231254888.26697.help-gnu-emacs@gnu.org
On Jan 6, 7:14 am, TheLonelyStar <nabb...@lonely-star.org> wrote:
> Hi,
>
> I need this for the following two things:
>
> 1. I want to bind a key (the tab key) to a special function which can fail.
> If the function fails, I want to call the original binding of the key
> (which is differerent depending on which mode I am in).
>
> 2. I want to bind a key to the insertion of a little code snippet.
> i.E. { -> to
> {
> |}
>
> But since in many modes the "{" and "}" keys are bound to some special
> function, I want to call these keybindings for the insertions of the "{" and
> "}".
do it like this:
(funcall (lookup-key (current-global-map) (kbd "M-r")))
this will find out the function assigned to the key “Alt+r”, then call
the function.
Xah
∑ http://xahlee.org/
☄
next prev parent reply other threads:[~2009-01-07 18:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.4013.1231164018.26697.help-gnu-emacs@gnu.org>
2009-01-06 1:13 ` Looking up and CALLING a key binding Xah Lee
2009-01-06 15:14 ` TheLonelyStar
2009-01-06 15:20 ` Lennart Borgman
[not found] ` <mailman.4126.1231254888.26697.help-gnu-emacs@gnu.org>
2009-01-07 18:08 ` Xah Lee [this message]
2009-01-08 15:31 ` Kevin Rodgers
2009-01-06 14:56 ` OtherMichael
2009-01-05 14:00 TheLonelyStar
2009-01-06 14:22 ` Kevin Rodgers
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=362bfee7-cf0f-4832-b89c-52b30b902c19@d42g2000prb.googlegroups.com \
--to=xahlee@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.