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

Re: PATCH: Re: Bug with _perl_builtin_funcs



Bart wrote:
> On Apr 23, 12:17pm, Oliver Kiddle wrote:
> } Subject: PATCH: Re: Bug with _perl_builtin_funcs
> }
> } On 1 Apr, Felix Rosencrantz wrote:
> } > it parses the man page it assume it is plain text.  However, on RH
> } > the man page is compressed with gzip.
> } 
> } This should make it use bzip2 or gzip as appropriate.
> 
> Why not parse the output of "perldoc perlfunc" instead?

As I don't ever use perldoc, I was just looking for the minimal easy fix
and throwing in a case statement to run gzcat/bzcat/cat on a file seemed
easier than anything which would involve rewriting the parsing.

And it seemed to make sense that parsing troff source is easier than
the formatted output so I didn't think much about it. However, I just
looked at the perldoc man page and it seems that I can get POD source
by using perldoc -u (so _perldoc is clearly very minimal). That's nice
and easy to parse and yields this, much shorter function:

#autoload

local expl

: ${(A)_perl_builtin_funcs:=${(u)${${(M)${(f)"$(_call_program functions \
    perldoc -u perlfunc)"}:#\=item [a-z]*}#* }%%[^a-z]*}}

_wanted functions expl 'perl built-in function' compadd "$@" -a - \
    _perl_builtin_funcs



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