From: Oliver Kiddle <opk@u.genie.co.uk>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: Re: _man only uses $manpath
Date: Fri, 17 Sep 1999 15:27:32 +0100 [thread overview]
Message-ID: <37E24FD4.30CED0F9@u.genie.co.uk> (raw)
In-Reply-To: <19990917090418.C1029@dman.com>
Clint Adams wrote:
> And if you want that as a colon-delimited list, you can run
> the manpath binary.
As far as I can tell, running manpath will always work where man -w will
and in other cases such as debian where man -w doesn't so we can use
that. I've attached a basic patch which tries running manpath and
failing that, uses filename expansion to generate a reasonable guessed
manpath. No doubt we'll shortly find that everyone can think of many
more directories which can be in the default manpath. I couldn't think
of a much better way to check the directories other than determining
that they are existing directories. A for loop can be used if someone
can think of a suitable check.
I'm not convinced that it is worth it to parse files in /etc for any
system where a the manpath command exists so I haven't bothered with it.
As an aside, can the filename generation below be put all in one word:
it seems that I can't nest brackets with | and can't do things like (|/)
without getting a zsh: bad pattern error.
Oliver Kiddle
*** _man.old Fri Sep 17 14:39:09 1999
--- _man Fri Sep 17 15:08:42 1999
***************
*** 14,19 ****
--- 14,22 ----
approx="(#a${_comp_correct})"
fi
+ [ "$manpath" ] || manpath=$(manpath 2>/dev/null) || \
+ manpath=( /usr/man(-/N)
/(opt|usr)/(dt|share|X11R6|local)/(cat|)man(-/N) )
+
if [[ $words[2] = (<->*|ln) ]]; then
rep=(
$manpath/(man|cat)${words[2]}/${~approx}$PREFIX${~star}$SUFFIX.<->*(N:t:r)
)
next prev parent reply other threads:[~1999-09-17 14:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-09-17 9:45 Sven Wischnowsky
1999-09-17 11:22 ` Adam Spiers
1999-09-17 12:43 ` Oliver Kiddle
1999-09-17 12:54 ` Clint Adams
1999-09-17 13:04 ` Clint Adams
1999-09-17 14:27 ` Oliver Kiddle [this message]
1999-09-17 14:44 ` PATCH: " Peter Stephenson
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=37E24FD4.30CED0F9@u.genie.co.uk \
--to=opk@u.genie.co.uk \
--cc=zsh-workers@sunsite.auc.dk \
/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).