help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: How to get in progress Key Sequence from Elisp


From: Barry OReilly
Subject: Re: How to get in progress Key Sequence from Elisp
Date: Mon, 3 Dec 2012 09:37:08 -0500

That's exactly what I needed, thanks!


On Sun, Dec 2, 2012 at 4:15 PM, Drew Adams <drew.adams@oracle.com> wrote:
> When I'm in the middle of inputting a Key Sequence, how may
> I get a data structure with the Key Sequence entered thus
> far from Elisp?
> ...
> I can do this if I can get the Key Sequence as the user has
> been entered at that time.

If I understand what you are asking, see `this-command-keys'.  E.g.:

(defun foo ()
  "..."
  (let* ((this-key  (this-command-keys))
         (prefix    (substring
                     this-key
                     0 (1- (length this-key)))))
    ;; (message "PREFIX: %S, DESCRIPTION: %S"
    ;;          prefix (key-description prefix))
    prefix))

This is what I use in the code for Icicles key completion.



reply via email to

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