|
From: | August Karlstrom |
Subject: | Re: Passing key bound to function as argument |
Date: | Thu, 27 Oct 2005 20:58:48 GMT |
User-agent: | Mozilla Thunderbird 1.0.7 (X11/20051013) |
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
[Prev in Thread] | Current Thread | [Next in Thread] |