Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: man completion
- X-seq: zsh-workers 50233
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Karel Balej <karelb@xxxxxxxxxxxxxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: man completion
- Date: Sun, 15 May 2022 09:45:24 -0700
- Archived-at: <https://zsh.org/workers/50233>
- In-reply-to: <20220515152021.pumg2z3fmfga76vp@asfaloth>
- List-id: <zsh-workers.zsh.org>
- References: <20220515152021.pumg2z3fmfga76vp@asfaloth>
On Sun, May 15, 2022 at 8:20 AM Karel Balej <karelb@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> Yet when I export MANPATH as ":/some/path", I only get suggestions from
> this directory and not from the default directories. Could this detail
> be overlooked in the completion function?
The completion function is calling $(manpath 2>/dev/null), but it's
caching the result, so if you change $MANPATH that's not being picked
up.
It also clobbers the cache if called with the -M or -m options and
doesn't reset it, which is clearly wrong.
A quick but suboptimal fix (I will not be pushing this to git):
diff --git a/Completion/Unix/Command/_man b/Completion/Unix/Command/_man
index dba1d13dc..0e0415cc7 100644
--- a/Completion/Unix/Command/_man
+++ b/Completion/Unix/Command/_man
@@ -16,7 +16,7 @@
_man() {
local dirs expl mrd awk variant noinsert
local -a context line state state_descr args modes
- local -aU sects
+ local -aU sects _manpath
local -A opt_args val_args sect_descs
if [[ $service == man ]]; then
Messages sorted by:
Reverse Date,
Date,
Thread,
Author