Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bug#311020: zsh: buggy _man completion



> These are actually 2 bugs:
> 
> 1)
> When I use TAB completion with man, a _manpath array is created. If I
> then update $MANPATH, $manpath reflects this change, but however many
> times I use the completion on man again, _manpath is not updated, and
> completion uses the old MANPATH.

Not sure what we can do about that.

> 2)
> extract from _man:
>   # Remove any compression suffix, then remove the minimum possible string
>   # beginning with .<->: that handles problem cases like files called
>   # `POSIX.1.5'.
> 
>   compadd "$@" - ${pages%.(?|<->*)}
> 
> I have a man page called "qui-6.0.1". If I run this command manually,
> it indeed gives "qui-6.0". But when I use TAB completion, I see "qui-6".
> So either an option is different, or the suffix gets removed some other
> place... Notice that if the page is called "qui-6.0.1.gz", it works fine.

Thoughts on this?

Index: Completion/Unix/Command/_man
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_man,v
retrieving revision 1.6
diff -u -r1.6 _man
--- Completion/Unix/Command/_man	31 May 2002 05:02:38 -0000	1.6
+++ Completion/Unix/Command/_man	5 Aug 2005 23:54:44 -0000
@@ -82,7 +82,7 @@
 
   pages=( ${(M)dirs:#*$sect/} )
   compfiles -p pages '' '' "$matcher" '' dummy '*'
-  pages=( ${^~pages}(N:t:r) )
+  pages=( ${^~pages}(N:t) )
 
   (($#mrd)) && pages[$#pages+1]=($(awk $awk $mrd))
 
@@ -90,7 +90,7 @@
   # beginning with .<->: that handles problem cases like files called
   # `POSIX.1.5'.
 
-  compadd "$@" - ${pages%.(?|<->*)}
+  compadd "$@" - ${pages%.(?|<->*(|.gz|.bz2|.Z))}
 }
 
 _man "$@"



Messages sorted by: Reverse Date, Date, Thread, Author