unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* standard framework for prompting user for next key cord in key sequence
@ 2011-09-03 18:35 Le Wang
  2011-09-03 19:11 ` standard framework for prompting user for next key cord in keysequence Drew Adams
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Le Wang @ 2011-09-03 18:35 UTC (permalink / raw)
  To: GNU Emacs List

Pressing C-h in the middle of a key sequence shows what's possible
next.  Is there a standard framework, for doing some thing similar,
without invoking C-h?  That is -- always provide the user with
feedback as to what key chord is possible next.  The help window
should disappear once input is complete successfully or aborted.

(defvar my-map (make-sparse-keymap))

(define-key my-map [(control c) (a)] 'a-func)
(define-key my-map [(control c) (b)] 'b-func)

(defun cool-fun (func)
  ""
  (interactive (magic-input-helper my-map))

The magic-input-helper is what I'm after here.  It seems this should
be a generally helpful function.

-- 
Le



^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: standard framework for prompting user for next key cord in keysequence
  2011-09-03 18:35 standard framework for prompting user for next key cord in key sequence Le Wang
@ 2011-09-03 19:11 ` Drew Adams
  2011-09-04  2:33 ` standard framework for prompting user for next key cord in key sequence Eric Abrahamsen
  2011-09-04 19:00 ` Seweryn Kokot
  2 siblings, 0 replies; 5+ messages in thread
From: Drew Adams @ 2011-09-03 19:11 UTC (permalink / raw)
  To: 'Le Wang', 'GNU Emacs List'

> Pressing C-h in the middle of a key sequence shows what's possible
> next.  Is there a standard framework, for doing some thing similar,
> without invoking C-h?  That is -- always provide the user with
> feedback as to what key chord is possible next.  The help window
> should disappear once input is complete successfully or aborted.

In the middle of any key sequence, or even before hitting any prefix key.
Help on all/any of the keys that can be used in the current context.

Get a list of all possible completions for a key.  Get full help on any of them
(command description, in *Help*).  End by completing a key if you want to use
it, or `C-g' if you were just after the info.

http://www.emacswiki.org/emacs/EmacsNewbieWithIcicles#KeyHelpAndCompletion

http://www.emacswiki.org/emacs/Icicles_-_Key_Completion





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: standard framework for prompting user for next key cord in key sequence
  2011-09-03 18:35 standard framework for prompting user for next key cord in key sequence Le Wang
  2011-09-03 19:11 ` standard framework for prompting user for next key cord in keysequence Drew Adams
@ 2011-09-04  2:33 ` Eric Abrahamsen
  2011-09-04 19:00 ` Seweryn Kokot
  2 siblings, 0 replies; 5+ messages in thread
From: Eric Abrahamsen @ 2011-09-04  2:33 UTC (permalink / raw)
  To: help-gnu-emacs

On Sun, Sep 04 2011, Le Wang wrote:

> Pressing C-h in the middle of a key sequence shows what's possible
> next.  Is there a standard framework, for doing some thing similar,
> without invoking C-h?  That is -- always provide the user with
> feedback as to what key chord is possible next.  The help window
> should disappear once input is complete successfully or aborted.
>
> (defvar my-map (make-sparse-keymap))
>
> (define-key my-map [(control c) (a)] 'a-func)
> (define-key my-map [(control c) (b)] 'b-func)
>
> (defun cool-fun (func)
>   ""
>   (interactive (magic-input-helper my-map))
>
> The magic-input-helper is what I'm after here.  It seems this should
> be a generally helpful function.

I don't believe there's a standard framework, but for example org-mode
uses "dispatchers" for org-agenda, org-capture and org-export, where you
hit a key and are presented with a menu of options, you could take a
look at how that's done. It won't be so simple as `magic-input-helper',
unfortunately.

E




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: standard framework for prompting user for next key cord in key sequence
  2011-09-03 18:35 standard framework for prompting user for next key cord in key sequence Le Wang
  2011-09-03 19:11 ` standard framework for prompting user for next key cord in keysequence Drew Adams
  2011-09-04  2:33 ` standard framework for prompting user for next key cord in key sequence Eric Abrahamsen
@ 2011-09-04 19:00 ` Seweryn Kokot
  2011-09-04 20:01   ` Le Wang
  2 siblings, 1 reply; 5+ messages in thread
From: Seweryn Kokot @ 2011-09-04 19:00 UTC (permalink / raw)
  To: help-gnu-emacs

Le Wang <l26wang <at> gmail.com> writes:

> 
> Pressing C-h in the middle of a key sequence shows what's possible
> next.  Is there a standard framework, for doing some thing similar,
> without invoking C-h?  
> ...

I have been using one-key.el library for 2 years now and I'm very happy with 
it. It is all explained on Emacs Wiki
 
http://www.emacswiki.org/emacs/OneKey




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: standard framework for prompting user for next key cord in key sequence
  2011-09-04 19:00 ` Seweryn Kokot
@ 2011-09-04 20:01   ` Le Wang
  0 siblings, 0 replies; 5+ messages in thread
From: Le Wang @ 2011-09-04 20:01 UTC (permalink / raw)
  To: Seweryn Kokot; +Cc: help-gnu-emacs

On Mon, Sep 5, 2011 at 3:00 AM, Seweryn Kokot <sewkokot@gmail.com> wrote:
> Le Wang <l26wang <at> gmail.com> writes:
>
>>
>> Pressing C-h in the middle of a key sequence shows what's possible
>> next.  Is there a standard framework, for doing some thing similar,
>> without invoking C-h?
>> ...
>
> I have been using one-key.el library for 2 years now and I'm very happy with
> it. It is all explained on Emacs Wiki
>
> http://www.emacswiki.org/emacs/OneKey

Very cool.  This looks almost exactly like what I wanted.  Thank you.



-- 
Le



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-09-04 20:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-03 18:35 standard framework for prompting user for next key cord in key sequence Le Wang
2011-09-03 19:11 ` standard framework for prompting user for next key cord in keysequence Drew Adams
2011-09-04  2:33 ` standard framework for prompting user for next key cord in key sequence Eric Abrahamsen
2011-09-04 19:00 ` Seweryn Kokot
2011-09-04 20:01   ` Le Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).