zsh-users
 help / color / mirror / code / Atom feed
* Completion and menu behavior
@ 2002-08-07  6:10 Byron Foster
  2002-08-07  7:39 ` Sven Wischnowsky
  0 siblings, 1 reply; 13+ messages in thread
From: Byron Foster @ 2002-08-07  6:10 UTC (permalink / raw)
  To: zsh-users

Being an avid ZSH user I've recently spent some time learning the new 
completion system.  Very powerful stuff!  After adding zstyle entries in 
my .zshrc I tried to get the tab (complete-word) behavior to behave in a 
manner as follows:

lets say I'm in a directory that contains only files 'foobar' and 
'foofoo' and I type 'less [TAB]' at the command line.  Currently I will 
get a partial completion of 'foo' and that's it.  Now what I would like 
is that if I were to type 'less [TAB]' at the command line I would be 
given 'less foo' with the cursor following just after the partial 
completion, but *also* with a menu listing foobar and foofoo.  Now I 
have tried all combinations of completion options and styles to try and 
get this behavior, but none do the trick.  The one I believe should do 
the trick is AUTO_LIST since it's documentation indicates that it will 
always display a menu list with an ambiguity.  But I think that the 
problem is that a partial completion is not considered an ambiguity. 
AUTO_LIST does work in the case that if I type 'less foo[TAB]' then the 
menu does appear since no completion at all is taking place.  I don't 
want to use something like MENU_COMPLETE because a like the partial 
completions.

I may sound lazy since in the above case I could type TAB twice, once to 
get a partial completion then again to get the menu.  However, with this 
behavior one cannot tell on the first TAB hit if the completion of 'foo' 
is a partial completion or a full completion.  What I would like is for 
the menu list to act as an indicator of a partial completion in addition 
to displaying the possible matches.

I'm using zsh (4.0.4)
Any help would be appreciated!

Byron






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

* Re: Completion and menu behavior
  2002-08-07  6:10 Completion and menu behavior Byron Foster
@ 2002-08-07  7:39 ` Sven Wischnowsky
  2002-08-07 21:44   ` DervishD
  2002-08-08  3:23   ` Byron Foster
  0 siblings, 2 replies; 13+ messages in thread
From: Sven Wischnowsky @ 2002-08-07  7:39 UTC (permalink / raw)
  To: zsh-users


Byron Foster wrote:

> ...
> 
> lets say I'm in a directory that contains only files 'foobar' and 
> 'foofoo' and I type 'less [TAB]' at the command line.  Currently I will 
> get a partial completion of 'foo' and that's it.  Now what I would like 
> is that if I were to type 'less [TAB]' at the command line I would be 
> given 'less foo' with the cursor following just after the partial 
> completion, but *also* with a menu listing foobar and foofoo.

Try a combination of AUTO_LIST and NO_LIST_AMBIGUOUS:

  setopt autolist
  unsetopt listambiguous

Just btw: the use of `menu' in your mail is somewhat irritating
because, as I think, you really only want a list. Menuing is done with
AUTO_MENU or MENU_COMPLETE or the `menu' style. And menuing with a
list sounds like menu selection, where you can move the cursor in a
listing to select matches (turned on with the `select' value of the
`menu' style).


Bye
  Sven

-- 
Sven Wischnowsky                          wischnow@berkom.de


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

* Re: Completion and menu behavior
  2002-08-07  7:39 ` Sven Wischnowsky
@ 2002-08-07 21:44   ` DervishD
  2002-08-07 22:10     ` Bart Schaefer
  2002-08-08  3:23   ` Byron Foster
  1 sibling, 1 reply; 13+ messages in thread
From: DervishD @ 2002-08-07 21:44 UTC (permalink / raw)
  To: wischnow, zsh-users

    Hi Sven :)

>Menuing is done with AUTO_MENU or MENU_COMPLETE or the `menu' style.

    I have AUTO_MENU 'on' and I never get menus, just lists. I think
that the only way of getting menus is with zstyle (I don't use
compinit). I say 'menu' referring to menu selection.

    Raúl


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

* Re: Completion and menu behavior
  2002-08-07 21:44   ` DervishD
@ 2002-08-07 22:10     ` Bart Schaefer
  2002-08-10 17:02       ` DervishD
  2002-08-10 17:30       ` DervishD
  0 siblings, 2 replies; 13+ messages in thread
From: Bart Schaefer @ 2002-08-07 22:10 UTC (permalink / raw)
  To: DervishD, zsh-users

On Aug 7, 11:44pm, DervishD wrote:
> Subject: Re: Completion and menu behavior
> 
> >Menuing is done with AUTO_MENU or MENU_COMPLETE or the `menu' style.
> 
>     I have AUTO_MENU 'on' and I never get menus, just lists.

"Menu completion" is controlled by AUTO_MENU and is the effect you get
where typing TAB multiple times cycles through the choices, showing you
one choice on the command line each time you press TAB.  This term dates
from before zsh was able to do fancy navigation though a set of choices
displayed in columns below the command line.  The latter what is called
"menu selection" (to differentiate it from "completion").

> I think that the only way of getting menus is with zstyle (I don't
> use compinit). I say 'menu' referring to menu selection.

Unfortunately you can't say just the word "menu" and expect anyone who
has been using zsh for more than about 2 years to think of "selection",
and you'll only confuse yourself if you think "selection" when you see
the word "MENU" in a zsh option name.

This is why Sven says "menu behavior" in the Subject: is annoying.

The way to get menu selection without styles is to set the MENUSELECT
parameter, but that's deprecated when using the shell-function-based
completion system rather than compctl-based completion.


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

* Re: Completion and menu behavior
  2002-08-07  7:39 ` Sven Wischnowsky
  2002-08-07 21:44   ` DervishD
@ 2002-08-08  3:23   ` Byron Foster
  1 sibling, 0 replies; 13+ messages in thread
From: Byron Foster @ 2002-08-08  3:23 UTC (permalink / raw)
  To: zsh-users

Sven Wischnowsky wrote:

>Byron Foster wrote:
>  
>
>>...
>>
>>lets say I'm in a directory that contains only files 'foobar' and 
>>'foofoo' and I type 'less [TAB]' at the command line.  Currently I will 
>>get a partial completion of 'foo' and that's it.  Now what I would like 
>>is that if I were to type 'less [TAB]' at the command line I would be 
>>given 'less foo' with the cursor following just after the partial 
>>completion, but *also* with a menu listing foobar and foofoo.
>>    
>>
>
>Try a combination of AUTO_LIST and NO_LIST_AMBIGUOUS:
>
>  setopt autolist
>  unsetopt listambiguous
>
>Just btw: the use of `menu' in your mail is somewhat irritating
>because, as I think, you really only want a list. Menuing is done with
>AUTO_MENU or MENU_COMPLETE or the `menu' style. And menuing with a
>list sounds like menu selection, where you can move the cursor in a
>listing to select matches (turned on with the `select' value of the
>`menu' style).
>  
>
Hi Sven,   Thanks for the suggestion.  The NO_LIST_AMBIGUOUS did the 
trick!  You are correct about my terms, I do mean list and not menu. I 
have obviously caused some confusion.  Thanks for decrypting my email :)

Byron





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

* Re: Completion and menu behavior
  2002-08-07 22:10     ` Bart Schaefer
@ 2002-08-10 17:02       ` DervishD
  2002-08-10 17:30       ` DervishD
  1 sibling, 0 replies; 13+ messages in thread
From: DervishD @ 2002-08-10 17:02 UTC (permalink / raw)
  To: schaefer, zsh-users, raul

    Hi Bart :)

>Unfortunately you can't say just the word "menu" and expect anyone
>who has been using zsh for more than about 2 years to think of
>"selection", and you'll only confuse yourself if you think
>"selection" when you see the word "MENU" in a zsh option name.

    Fully undestood now ;)) Thanks a lot :)
    Raúl


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

* Re: Completion and menu behavior
  2002-08-07 22:10     ` Bart Schaefer
  2002-08-10 17:02       ` DervishD
@ 2002-08-10 17:30       ` DervishD
  2002-08-10 19:27         ` Bart Schaefer
  1 sibling, 1 reply; 13+ messages in thread
From: DervishD @ 2002-08-10 17:30 UTC (permalink / raw)
  To: schaefer, zsh-users, raul

    Hi Bart :)

    I have other question, maybe a newbie one, but...

>The way to get menu selection without styles is to set the MENUSELECT
>parameter, but that's deprecated when using the shell-function-based
>completion system rather than compctl-based completion.

    I don't use styles, nor the shell-function-based completion
system, and when I set MENUSELECT to 0 (to force menu selection for
any number of matches), when I hit TAB twice (I have TAB bound to
menu-expand-or-complete), I have menu completion, but no menu
selection. What I'm doing bad?

    Thanks in advance.
    Raúl


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

* Re: Completion and menu behavior
  2002-08-10 17:30       ` DervishD
@ 2002-08-10 19:27         ` Bart Schaefer
  2002-08-10 20:20           ` DervishD
  0 siblings, 1 reply; 13+ messages in thread
From: Bart Schaefer @ 2002-08-10 19:27 UTC (permalink / raw)
  To: DervishD, zsh-users

On Aug 10,  7:30pm, DervishD wrote:
} 
}     I don't use styles, nor the shell-function-based completion
} system, and when I set MENUSELECT to 0 (to force menu selection for
} any number of matches), when I hit TAB twice (I have TAB bound to
} menu-expand-or-complete), I have menu completion, but no menu
} selection. What I'm doing bad?

Probably you don't have the complist module loaded.  `zmodload complist'
and then try it again.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


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

* Re: Completion and menu behavior
  2002-08-10 19:27         ` Bart Schaefer
@ 2002-08-10 20:20           ` DervishD
  2002-08-11  1:17             ` Bart Schaefer
  0 siblings, 1 reply; 13+ messages in thread
From: DervishD @ 2002-08-10 20:20 UTC (permalink / raw)
  To: schaefer, zsh-users, raul

    Hi Bart :)

    Thanks for your answer :)

>} menu-expand-or-complete), I have menu completion, but no menu
>} selection. What I'm doing bad?
>Probably you don't have the complist module loaded.  `zmodload complist'
>and then try it again.

    I have complist built-in, not as a module :? Maybe a missing
compctl call in my RC's?

    Raúl


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

* Re: Completion and menu behavior
  2002-08-10 20:20           ` DervishD
@ 2002-08-11  1:17             ` Bart Schaefer
  2002-08-11 13:20               ` DervishD
  0 siblings, 1 reply; 13+ messages in thread
From: Bart Schaefer @ 2002-08-11  1:17 UTC (permalink / raw)
  To: DervishD, zsh-users

On Aug 10, 10:20pm, DervishD wrote:
} Subject: Re: Completion and menu behavior
}
} >Probably you don't have the complist module loaded.  `zmodload complist'
} 
}     I have complist built-in, not as a module :? Maybe a missing
} compctl call in my RC's?

Even compiled-in modules have to be zmodload'd.  See ChangeLog-3.1, the
entry for article 8770.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


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

* Re: Completion and menu behavior
  2002-08-11  1:17             ` Bart Schaefer
@ 2002-08-11 13:20               ` DervishD
  2002-08-11 14:56                 ` Bart Schaefer
  0 siblings, 1 reply; 13+ messages in thread
From: DervishD @ 2002-08-11 13:20 UTC (permalink / raw)
  To: schaefer, zsh-users, raul

    Hi Bart :)

>}     I have complist built-in, not as a module :? Maybe a missing
>} compctl call in my RC's?
>Even compiled-in modules have to be zmodload'd.

    Ok, I have it loaded now, exported MENUSELECT and now my TAB key
does nothing ;)) I've checked the menuselect keymap and the TAB key
is correctly mapped to 'menu-complete'. Sorry if I'm bothering you,
but I've never used menu selection and would like to test it O:))

    Thanks a lot for you invaluable help :)

    Raúl


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

* Re: Completion and menu behavior
  2002-08-11 13:20               ` DervishD
@ 2002-08-11 14:56                 ` Bart Schaefer
  2002-08-11 20:01                   ` DervishD
  0 siblings, 1 reply; 13+ messages in thread
From: Bart Schaefer @ 2002-08-11 14:56 UTC (permalink / raw)
  To: DervishD, zsh-users

On Aug 11,  3:20pm, DervishD wrote:
}
}     Ok, I have it loaded now, exported MENUSELECT and now my TAB key
} does nothing ;)) I've checked the menuselect keymap and the TAB key
} is correctly mapped to 'menu-complete'.

The menuselect keymap is only used to navigate the list of files, after
menu selection has started.  You need to check what TAB is bound to in
your regular keymap (emacs or viins).

You also need to be sure the ALWAYS_LAST_PROMPT option is set; if it is
not, menu selection is disabled, though that shouldn't prevent normal
completion from happening.

Other than that, I have no idea.  Check whether it works with `zsh -f':

	zsh -f
	% zmodload zsh/complist
	% MENUSELECT=0
	% ls <TAB>

If that works, then there's something in your setup that's interfering.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


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

* Re: Completion and menu behavior
  2002-08-11 14:56                 ` Bart Schaefer
@ 2002-08-11 20:01                   ` DervishD
  0 siblings, 0 replies; 13+ messages in thread
From: DervishD @ 2002-08-11 20:01 UTC (permalink / raw)
  To: schaefer, zsh-users, raul

    Hi Bart, and thanks again :))

>Other than that, I have no idea.  Check whether it works with `zsh -f':

    It works ok :)), so there's something in my RC's that is making
the wrong thing (TM). I'll take a look at may RC's.

    Thanks a lot, Bart. You're great, and it's people like you who
makes free software such a good thing.

    Raúl


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

end of thread, other threads:[~2002-08-11 19:54 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-07  6:10 Completion and menu behavior Byron Foster
2002-08-07  7:39 ` Sven Wischnowsky
2002-08-07 21:44   ` DervishD
2002-08-07 22:10     ` Bart Schaefer
2002-08-10 17:02       ` DervishD
2002-08-10 17:30       ` DervishD
2002-08-10 19:27         ` Bart Schaefer
2002-08-10 20:20           ` DervishD
2002-08-11  1:17             ` Bart Schaefer
2002-08-11 13:20               ` DervishD
2002-08-11 14:56                 ` Bart Schaefer
2002-08-11 20:01                   ` DervishD
2002-08-08  3:23   ` Byron Foster

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).