- fix broken page completion on macOS and FreeBSD (regression caused by
workers/50278)
- update fall-back paths to include /usr/local/share/man (fixes issues like
workers/53249 for systems without `manpath` or equivalent)
- fold macOS completion into FreeBSD's, as macOS 13+ uses it now with little
modification
- add -K option for FreeBSD and -h option for mandoc/NetBSD, complete
pre-processor sequences, complete section lists with commas for man-db
- exclude HTML pages for FreeBSD-likes
Since compfiles is undocumented, avoid its use altogether, replacing it by
a construct that blackbox analysis suggests to be equivalent.
The compfiles call being removed effected the following change (when
completing «man -S 8:1 getc<TAB>»):
BEFORE THE CALL:
typeset -a pages=( /home/daniel/prefix/zsh/share/man/man1/
/usr/share/man/man8/
/usr/share/man/man1/ )
AFTER THE CALL:
typeset -a pages=( '/home/daniel/prefix/zsh/share/man/man1/getc*(8|1)*'
'/usr/share/man/man8/getc*(8|1)*'
'/usr/share/man/man1/getc*(8|1)*' )
This patch effects the same transformation (modulo doubling the final slash).
Any -M parameter will be passed to compadd.
- No longer glob all files (the (-g)-less _path_files was virtually always called,
by at least one of the multiple calls to _man_pages).
- Actually separate sections (by propagating $expl).