zsh-users
 help / color / mirror / code / Atom feed
* completion for man
@ 2006-06-23 23:19 Andy Spiegl
  2006-06-23 23:51 ` Frank Terbeck
  0 siblings, 1 reply; 6+ messages in thread
From: Andy Spiegl @ 2006-06-23 23:19 UTC (permalink / raw)
  To: zsh-users

Recently I heard/read that there is a new wonderful completion function for
man with support sections.  But my zsh (v4.3.2) doesn't do it and always
just completes the command names:

 condor:~>man <TAB>
 zsh: do you wish to see all 13618 possibilities (6810 lines)? 

 condor:~>man 8 <TAB>
 zsh: do you wish to see all 13618 possibilities (6810 lines)? 

Is there maybe some configuration option I have to set?

Thanks,
 Andy.

-- 
 Fotos: francisco.spiegl.de            o      _     _         _              
 Infos: peru.spiegl.de       __o      /\_   _ \\o  (_)\__/o  (_)         -o) 
 Andy, Heidi, Francisco    _`\<,_    _>(_) (_)/<_    \_| \   _|/' \/      /\\
 heidi.und.andy@spiegl.de (_)/ (_)  (_)        (_)   (_)    (_)'  _\o_   _\_v
 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
 As far as we know our computer has never had an undetected error.


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

* Re: completion for man
  2006-06-23 23:19 completion for man Andy Spiegl
@ 2006-06-23 23:51 ` Frank Terbeck
  2006-06-24  0:48   ` Andy Spiegl
  0 siblings, 1 reply; 6+ messages in thread
From: Frank Terbeck @ 2006-06-23 23:51 UTC (permalink / raw)
  To: zsh-users

Andy Spiegl <zsh.Andy@spiegl.de>:
> Recently I heard/read that there is a new wonderful completion function for
> man with support sections.  But my zsh (v4.3.2) doesn't do it and always
> just completes the command names:
> 
>  condor:~>man <TAB>
>  zsh: do you wish to see all 13618 possibilities (6810 lines)? 
> 
>  condor:~>man 8 <TAB>
>  zsh: do you wish to see all 13618 possibilities (6810 lines)? 
> 
> Is there maybe some configuration option I have to set?

Hi Andy,

Starting from 'zsh -f' you need the following:

[snip]
zmodload zsh/complist
autoload -U compinit && compinit
zstyle ':completion:*'              menu select
zstyle ':completion:*:*:man:*'      menu yes
zstyle ':completion:*'              group-name ''
zstyle ':completion:*:manuals'      separate-sections true
zstyle ':completion:*:manuals.*'    insert-sections   true
zstyle ':completion:*:descriptions' format "- %d -"
[snap]

You can even do:
zstyle ':completion:*:manuals.(^1*)' insert-sections true

...to add the section number for all sections but section number one.

Regards, Frank


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

* Re: completion for man
  2006-06-23 23:51 ` Frank Terbeck
@ 2006-06-24  0:48   ` Andy Spiegl
  2006-06-24  1:27     ` Frank Terbeck
  0 siblings, 1 reply; 6+ messages in thread
From: Andy Spiegl @ 2006-06-24  0:48 UTC (permalink / raw)
  To: zsh-users

> Starting from 'zsh -f' you need the following:
Thanks!  Great, now it's showing me the sections.

> You can even do:
> zstyle ':completion:*:manuals.(^1*)' insert-sections true
> 
> ...to add the section number for all sections but section number one.
Hm, that part doesn't seem to work...

condor:~>man 2 <TAB>
interactive: []
- manual page, section 1 -
\[                                3ddesk                                  3ddeskd                    
411toppm                          822-date                                a2p                        
a2ping                            a2ps                                    a52dec                     
a5booklet                         aa3d                                    aaflip                     
...

Shouldn't it be listing only pages out of section 2 here?

Thanks,
 Andy.

-- 
 When you become obsessed with the enemy, you become the enemy.


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

* Re: completion for man
  2006-06-24  0:48   ` Andy Spiegl
@ 2006-06-24  1:27     ` Frank Terbeck
  2006-06-24 21:29       ` Andy Spiegl
  0 siblings, 1 reply; 6+ messages in thread
From: Frank Terbeck @ 2006-06-24  1:27 UTC (permalink / raw)
  To: zsh-users

Andy Spiegl <zsh.Andy@spiegl.de>:
[...]
> > You can even do:
> > zstyle ':completion:*:manuals.(^1*)' insert-sections true
> > ...to add the section number for all sections but section number one.
> Hm, that part doesn't seem to work...
> 
> condor:~>man 2 <TAB>
> interactive: []
> - manual page, section 1 -
> \[                                3ddesk                                  3ddeskd                    
> 411toppm                          822-date                                a2p                        
> a2ping                            a2ps                                    a52dec                     
> a5booklet                         aa3d                                    aaflip                     
> ...
> 
> Shouldn't it be listing only pages out of section 2 here?

Yes it should. And it does for me.
Have you tried the commands from 'zsh -f'?
I just checked it, and it does work (zsh v4.3.2 [debian/linux]).

Regards, Frank


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

* Re: completion for man
  2006-06-24  1:27     ` Frank Terbeck
@ 2006-06-24 21:29       ` Andy Spiegl
  2006-06-25  4:35         ` Bart Schaefer
  0 siblings, 1 reply; 6+ messages in thread
From: Andy Spiegl @ 2006-06-24 21:29 UTC (permalink / raw)
  To: zsh-users

Hi Frank,

> Have you tried the commands from 'zsh -f'?
You're right.  In that case it works.
After half an hour of trial-and-error I found the cause
why it doesn't work here:

The following alias
 alias man='command man -a'
screws up the section completion.

The same happens if I hit TAB after "man -a 2 ".
Is that a bug or a feature?

Thanks,
 Andy.

-- 
 There is no particular mystery in animation...it's really very simple,
 and like anything that is simple, it is about the hardest thing in the
 world to do. --  Bill Tytla at the Walt Disney Studio, June 28, 1937.


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

* Re: completion for man
  2006-06-24 21:29       ` Andy Spiegl
@ 2006-06-25  4:35         ` Bart Schaefer
  0 siblings, 0 replies; 6+ messages in thread
From: Bart Schaefer @ 2006-06-25  4:35 UTC (permalink / raw)
  To: zsh-users

On Jun 24, 11:29pm, Andy Spiegl wrote:
}
} The same happens if I hit TAB after "man -a 2 ".
} Is that a bug or a feature?

It's neither, really.  The _man completer simply doesn't support any of
the GNU "man" command-line switches.  The only option it understands is
the crufty old "man -l" for manpage-formatting a named file rather than
by searching the manpath (which it appears GNU man doesn't even permit
any longer).


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

end of thread, other threads:[~2006-06-25  4:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-23 23:19 completion for man Andy Spiegl
2006-06-23 23:51 ` Frank Terbeck
2006-06-24  0:48   ` Andy Spiegl
2006-06-24  1:27     ` Frank Terbeck
2006-06-24 21:29       ` Andy Spiegl
2006-06-25  4:35         ` Bart Schaefer

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).