From: Bart Schaefer <schaefer@brasslantern.com>
To: Karel Balej <karelb@gimli.ms.mff.cuni.cz>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: man completion
Date: Sun, 15 May 2022 09:45:24 -0700 [thread overview]
Message-ID: <CAH+w=7YMj_TnQ5711ZNDZSqPeYyV+4OuwgmtHFmj8qsroDT9BA@mail.gmail.com> (raw)
In-Reply-To: <20220515152021.pumg2z3fmfga76vp@asfaloth>
On Sun, May 15, 2022 at 8:20 AM Karel Balej <karelb@gimli.ms.mff.cuni.cz> 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
next prev parent reply other threads:[~2022-05-15 16:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-15 15:20 Karel Balej
2022-05-15 16:45 ` Bart Schaefer [this message]
2022-05-16 19:41 ` Bart Schaefer
2022-05-16 21:40 ` Mikael Magnusson
2022-05-17 0:41 ` Bart Schaefer
2022-05-21 12:57 ` Karel Balej
2022-05-21 20:22 ` Bart Schaefer
2022-05-22 16:00 ` Karel Balej
2022-05-22 21:26 ` Bart Schaefer
2022-05-23 12:28 ` Karel Balej
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAH+w=7YMj_TnQ5711ZNDZSqPeYyV+4OuwgmtHFmj8qsroDT9BA@mail.gmail.com' \
--to=schaefer@brasslantern.com \
--cc=karelb@gimli.ms.mff.cuni.cz \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).