On 2025-10-25 10:36:39 -0400, Jay Berkenbilt wrote:
> It's been a very long time since I worked on the completion code, and
> an longer time since I had zsh completion in my head. I started using
> zsh in 2000, and it's probably been 20 years since I've had a good
> mental model on this. I am not likely to find time to fix this. I'm
> concerned that removing the file will break qpdf completion for many
> more users than the existing file will. People who are doing
> sophisticated things with their completion are more likely to be able
> to work around this, while most people who just install qpdf would
> probably be better served if completion works out of the box.
I don't think that there is any workaround. But I'm thinking of
an alternative solution: protect the _qpdf content by
if typeset -f _bash_complete > /dev/null ; then
...
fi
and document that users who whish qpdf completions should run
"autoload -U +X bashcompinit && bashcompinit" in their ".zshrc".
Note that the zshcompsys(1) man page already documents:
The function bashcompinit provides compatibility with bash's
programmable completion system. When run it will define the
functions, compgen and complete which correspond to the bash
builtins with the same names. It will then be possible to use
completion specifications and functions written for bash.
so that the user would know the consequence of bashcompinit.
BTW, independently of the use of bashcompinit, the behavior of qpdf
is modified if a COMP_LINE or COMP_POINT environment variable is
defined. For instance, from a sh shell:
$ COMP_LINE=foo qpdf
$ COMP_POINT=foo qpdf
$
because qpdf runs in completion mode (ditto if there are arguments,
which could possibly be regarded as a bug because it seems that
completion mode does not need arguments at all, thus introduces
a useless change of behavior in non-error uses of qpdf). Since
these environment variables are not documented, this could confuse
the user. Note that I saw that only when reading the source of qpdf.
--
Vincent Lefèvre <[email protected]> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)