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

Re: _man igores global matchers



Bart Schaefer wrote:

> On Jun 1,  1:40pm, Sven Wischnowsky wrote:
> } Subject: Re: _man igores global matchers
> }
> } Bart Schaefer wrote:
> } 
> } This uses _path_files' builtin compfiles to try to get smarter glob
> } patterns with respect to the matchers in use.
> 
> Except that it doesn't appear to reference the global $_matcher anywhere?
> How does "the matcher in use" ever get to _man_pages ?
> 
> Perhaps this:
>  
> }   _wanted manuals expl 'manual page' _man_pages
> 
> Should be:
> 
>     _wanted manuals expl 'manual page' _man_pages -M "$_matcher"
> 
> ?  Or am I missing something obvious?

It's added automatically in _description, called from _wanted.

That's actually the main reason for putting that code into a separate
function (that together with laziness).

But now that you remind me... the expl array may contain more than one
-M option, so the code that extracts the matchers should look like:

  zparseopts -E M+:=matcher

  if (( $#matcher )); then
    matcher=( ${matcher:#-M} )
    matcher="$matcher"
  else
    matcher=
  fi


Btw, I'm leaving till Wednesday now, so won't be able to commit this (or
any changes for the disown stuff).

Have fun...


Bye
  Sven


-- 
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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