emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Function to insert a key sequence


From: Deniz Dogan
Subject: Re: Function to insert a key sequence
Date: Sun, 27 Dec 2009 02:51:28 +0100

2009/12/26 Jeff Kowalczyk <address@hidden>:
> Deniz Dogan <deniz.a.m.dogan <at> gmail.com> writes:
>> Attached is a little function for inserting a key sequence entered by
>> the user into the current buffer. I don't know if it fits into any
>> existing Emacs library, but I find it quite useful, so I thought I'd
>> just throw it out there.
>
> Deniz,
>
> Thanks, this function is interesting. It could be useful in tools like
> ScreencastMode [1].
>
> Is this version intended for use with Emacs 23? I had to change read-key to
> read-key-sequence to get the prompt, but the function does not exit on C-g:
>

Yes, it is intended for use with Emacs 23.

read-key is a compiled Lisp function in `subr.el'.

(read-key &optional PROMPT)

Read a key from the keyboard.
Contrary to `read-event' this will not return a raw event but instead will
obey the input decoding and translations usually done by `read-key-sequence'.
So escape sequences and keyboard encoding are taken into account.
When there's an ambiguity because the key looks like the prefix of
some sort of escape sequence, the ambiguity is resolved via `read-key-delay'.

According to the CVS log, it was added on August 19 2009 by Stefan
Monnier (revision 1.644). That said, I don't know off-hand how to make
the function work without read-key.

-- 
Deniz Dogan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]