Re: [hackers][vis][RFC][PATCH 0/2] Suggestion for basic autocomplete functionality

From: Silvan Jegen <s.jegen_AT_gmail.com>
Date: Wed, 18 May 2016 23:37:49 +0200

Hi Marc

On Wed, May 18, 2016 at 08:10:44PM +0200, Marc André Tanner wrote:
> After some refactoring the functionality of your patches should now be
> merged, thanks! It should now also work with slmenu, I guess you only

Nice!


> used it with dmenu?

I only tested it with dmenu because I assumed slmenu would scribble
all over the curses TUI. Turns out that just redrawing it afterwards
works fine.

However, in my short testing of both I found that dmenu's substring
matching works better for me. If you want to complete something like

vis_window_focus

starting from

vis

you can just continue with

vis wi fo

(the space char has to be typed too) in dmenu and you will be there. This
does not work with slmenu. I assume that's because the partial substring
matching is implemented differently in slmenu.


> The behavior could still be improved. It would be handy to pass
> the prefix as the initial prompt value to the menu tool which would
> start with the filter applied. Instead of removing the prefix
> from the returned text (as you did with sed(1)), we would replace
> the whole word/prefix with whatever is returned from the external
> process.
>
> Conceptually the syntax would become:
>
> $ extract_words | grep '^prefix' | sort | uniq | slmenu 'prefix'
>
> or even:
>
> $ extract_words | sort | uniq | slmenu 'prefix'

Not completely sure I am following. What would be the advantage compared
to what we have now?


> I'm considering importing slmenu into the vis repository as vis-menu
> and implementing the necessary changes. This would ease packaging by
> distributions and make vis behave always the same independent of
> whether it is run in a X11 environment.
>
> It would however also make it more difficult for users who prefer
> dmenu, opinions?

Because of the different behaviour regarding partial substring matching
I prefer dmenu. It's easy to change though so I don't mind either way.

slmenu seems to be the default "menu program" used by vis now
and dmenu is only the fallback (unless you export VIS_MENU=dmenu
explicitly). Personally, I don't see the advantage of adding more code
to vis that has to be kept up-to-date if people who care can easily
set up the environment just like they prefer it.

I don't know what the packagers' opinion about that is though.


Cheers,

Silvan
Received on Wed May 18 2016 - 23:37:49 CEST

This archive was generated by hypermail 2.3.0 : Wed May 18 2016 - 23:48:20 CEST