[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs completion matches selection UI
From: |
Stefan Monnier |
Subject: |
Re: Emacs completion matches selection UI |
Date: |
Sat, 04 Jan 2014 18:02:26 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
>> Yes. We should make it easier to extend indent-for-tab-command.
> Do you think it's possible/desirable to generalize this mechanism (to
> support the "fallback-maybe" pattern) so that we can make it easier to
> extend any command, not just indent-for-tab-command?
Everything's possible and yes, I think there's interest in supporting
this cleanly. There are different approaches, tho.
One is advice-add. This makes it possible to extend a command with new
behavior, with a clean and simple fallback mechanism.
If OTOH you want to "extend a key-binding", we don't have a good story.
You can do things like
(define-key map [?\C-i]
`(menu-item "" mycommand
:filter ,(lambda (cmd) (if <pred> cmd))))
which will use `mycommand' if <pred> is true and fallback on the next
binding otherwise. But this is not very satisfactory:
- no way to do something after the fallback command is run.
- C-h k will only tell you about one of the possible commands.
- Can't have more than one such "conditional binding" for the same key
in the same keymap.
> (define-fallbackish-command maybe-foo (kbd "[somekey]") ()
I don't understand what's the intended relation between [somekey] and
`maybe-foo'.
Stefan
- Re: Emacs completion matches selection UI, (continued)
- Re: Emacs completion matches selection UI, Dmitry Gutov, 2014/01/07
- Re: Emacs completion matches selection UI, Toby Cubitt, 2014/01/07
- Re: Emacs completion matches selection UI, Bob Bobeck, 2014/01/07
- Re: Emacs completion matches selection UI, Toby Cubitt, 2014/01/07
- Re: Emacs completion matches selection UI, Richard Stallman, 2014/01/08
- Re: Emacs completion matches selection UI, Ted Zlatanov, 2014/01/08
- Re: Emacs completion matches selection UI, Stefan Monnier, 2014/01/07
- Re: Emacs completion matches selection UI, Ted Zlatanov, 2014/01/08
- Re: Emacs completion matches selection UI, Toby Cubitt, 2014/01/08
- Re: Emacs completion matches selection UI, Dmitry Gutov, 2014/01/09
Re: Emacs completion matches selection UI,
Stefan Monnier <=
- Re: Emacs completion matches selection UI, João Távora, 2014/01/04
- Re: Emacs completion matches selection UI, Stefan Monnier, 2014/01/05
- Re: Emacs completion matches selection UI, Ted Zlatanov, 2014/01/06
- Re: Emacs completion matches selection UI, Stefan Monnier, 2014/01/06
- Re: Emacs completion matches selection UI, Ted Zlatanov, 2014/01/07
- Re: Emacs completion matches selection UI, João Távora, 2014/01/07
- Re: Emacs completion matches selection UI, Josh, 2014/01/07
- Re: Emacs completion matches selection UI, David Kastrup, 2014/01/07
- Re: Emacs completion matches selection UI, Josh, 2014/01/07
Re: Emacs completion matches selection UI, Stefan Monnier, 2014/01/06