supercrabtree/k — pull request #10 by philpennock (2014-04-01 23:35:32+00:00)
Title: Be safer, drop Perl, more zshisms

Fix that echo escape sequences in filenames would have been interpreted
by using $'...' to construct strings with embedded actual escapes and
avoid letting echo do the conversion when the filenames are mixed in.
Also try to protect against ANSI escape sequences in filenames (and link
targets).

Drop the Perl dependency, using the zsh/stat module instead. Having a
list of hashes in zsh is slightly icky to iterate over, but doable.

Drop the date(1) dependency, the zsh/datetime module gives us
$EPOCHSECONDS, we can capture the value once to get consistent values
for the lifetime of the function execution.

Ensure that no variables accidentally leak out to be global, using the
zsh warn_create_global option. Protect all variables accordingly. (Can
use `typeset -g` where we explicitly want a global).

Use arrays and loops instead of if/elif/else blocks for assigning color
codes.

Use integers and `(( VARNAME ))` for simple true/false evaluation, so
that we get integer comparison instead of strcmp comparison.

End result should be identical except in cases where the filename
contained embedded ANSI escape sequences.