From: August Karlstrom <fusionfive@comhem.se>
Subject: Re: Passing key bound to function as argument
Date: Thu, 27 Oct 2005 20:58:48 GMT [thread overview]
Message-ID: <ccb8f.149259$dP1.507241@newsc.telia.net> (raw)
In-Reply-To: <mailman.12946.1130439541.20277.help-gnu-emacs@gnu.org>
Kevin Rodgers wrote:
> August Karlstrom wrote:
> > Suppose I want to make my own `self-insert-command' (but implemented in
> > Elisp). How would I go about?
>
> (defun self-insert-command (n)
> (interactive "p")
> ...)
>
> But it won't get called, because command_loop_1 optimizes out the call
> to the Lisp binding and uses the C binding (Fself_insert_command) directly.
I have already tried
(defun my-self-insert-command (n)
(interactive "p")
(insert n))
(global-set-key "a" 'my-self-insert-command)
(global-set-key "b" 'my-self-insert-command)
Pressing either a or b inserts the character with ordinal number 1
(instead of a or b) so that doesn't work.
August
next prev parent reply other threads:[~2005-10-27 20:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-27 17:03 Passing key bound to function as argument August Karlstrom
2005-10-27 18:53 ` Kevin Rodgers
[not found] ` <mailman.12946.1130439541.20277.help-gnu-emacs@gnu.org>
2005-10-27 20:58 ` August Karlstrom [this message]
2005-10-27 21:10 ` Edward O'Connor
[not found] ` <mailman.12961.1130447654.20277.help-gnu-emacs@gnu.org>
2005-10-27 21:55 ` August Karlstrom
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='ccb8f.149259$dP1.507241@newsc.telia.net' \
--to=fusionfive@comhem.se \
/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.