Subject: Re: Proof of concept mainstream plugin manager
From: Sebastian Gniazdowski <[email-masked]>
To: Bart Schaefer <[email-masked]>
Cc: Zsh hackers list <[email-masked]>
Date: Sun, 24 Jan 2016 15:59:32 +0100
List-Id: Zsh Workers List <zsh-workers.zsh.org>

Tested 8 plugins:

horosgrisa/autoenv
adolfoabegg/browse-commit
arzzen/calc.plugin.zsh
walesmd/caniuse.plugin.zsh
mollifier/cd-gitroot
mikedacre/cdbk
willghatch/zsh-cdr
rutchkiwi/copyzshell (requires OMZ directory structure simulation)

And they all work. Except maybe for zsh-cdr, which has the following
glitch: when I run my n-cd, select directory, which will cause "cd" to
be called, then _reload_and_run will cause error on line:

"    builtin autoload $=autoload_opts "$func""

That's very weird, as when I display the options right before the line:

    echo "Running with opts: " $=autoload_opts ", for func: $func"

then there is no improper option in $autoload_opts. And, second call
to n-cd works fine... I can workaround this by doing "command cd" in
my tool instead of just "cd", but still, that's a puzzle, what can be
going on? Decided to write about this and move onward testing next
plugins. Here is movie that shows the weird behavior:

https://asciinema.org/a/bn8b73y8t308qimrrxmvxqlc2

Where in Zsh source does "autload" report anything about option "-" ?
Maybe I could apply some patch and build Zsh to see some clues?

PS. ZPlugin proves to be very nice. Very nice to see what plugins do:

https://asciinema.org/a/dtgdzr4wqe9nizreqjlgrjmik

It also confirms that the plugins contain rather naive code, like
after reading Advanced Bash Scripting Guide, however, they rather just
work, like the autoenv plugin. I'm thinking about reporting that
plugin does use binaries like grep or sed, which would give a hint of
how naive the code loaded is.

Best regards,
Sebastian Gniazdowski