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

perl -d: completion bug



My zsh completion-fu is weak, still.  Is there a way in which a function
calling another function to do the work can interrupt a  _wanted() to
filter the results, or do I need to re-factor the function currently
calling _wanted() into a helper function which does the work and a
wrapper with the current name which calls _wanted(), then use that new
function?

There's a bug in the Perl completion.  perl -d:<tab> completes all Perl
modules.  What it needs to complete is the sub-string of module names in
the Devel:: namespace, after the Devel::.

The current _perl_modules() uses the caching system to good effect and I
want to keep that, cache all the modules in the same way (might as well,
even for a -d:<tab> completion) and then just filter to a sub-set.

Eg, given the module Devel::Trace installed, you'd invoke Perl thusly:
zsh% perl -d:Trace -e $'print "foo\\n";\nprint "bar\\n";'
>> -e:1: print "foo\n";
foo
>> -e:2: print "bar\n";
bar
zsh%

(And if the answer is trivial, please don't wait on a patch from me!)

Thanks,
-Phil



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