[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Invoking electirc command programmatically
From: |
rgb |
Subject: |
Re: Invoking electirc command programmatically |
Date: |
10 May 2005 09:55:22 -0700 |
User-agent: |
G2/0.2 |
PT wrote:
> I have this electric function which inserts the character it is bound
to
> and does something else too.
>
> (defun my-electric-character (&optional arg)
> "Insert the typed character and pop up a completion buffer"
> (interactive "P")
> (self-insert-command (prefix-numeric-value arg))
> ...)
>
> How can I invoke this function from my program with a certain
character,
> so that it behaves just like if the user typed the character on the
> keyboard?
>
> --
> Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
I believe you want to set last-command-event before calling
my-electric-character. I don't know where/if it's documented
but experience shows self-insert-command inserts the value
it finds in last-command-event.