* PATCH: _man copes with : delimited manpath
@ 1999-09-27 13:17 Adam Spiers
1999-09-27 13:44 ` Peter Stephenson
1999-10-06 16:22 ` PATCH: " Oliver Kiddle
0 siblings, 2 replies; 7+ messages in thread
From: Adam Spiers @ 1999-09-27 13:17 UTC (permalink / raw)
To: zsh workers mailing list
On my system, `manpath' generates colon-delimited paths, rather than
space-delimited ones. This patch solves that problem. It also fixes
what I think is a typo, but someone should check this.
Index: Completion/User/_man
===================================================================
RCS file: /usr/local/cvsroot/zsh/Completion/User/_man,v
retrieving revision 1.1.1.4
diff -u -r1.1.1.4 _man
--- Completion/User/_man 1999/09/21 12:17:47 1.1.1.4
+++ Completion/User/_man 1999/09/27 01:14:03
@@ -14,12 +14,18 @@
approx="(#a${_comp_correct})"
fi
-(( $#manpath )) || manpath=$(manpath 2>/dev/null) ||
+if (( ! $#manpath )); then
+ local mp=$(manpath 2>/dev/null)
+ [[ "$mp" == *:* ]] && mp=( ${(s.:.)mp} )
+ manpath=( $mp )
+fi
+
+(( $#manpath )) ||
manpath=( /usr/man(-/N) /(opt|usr)/(dt|share|X11R6|local)/(cat|)man(-/N) )
# `sman' is the SGML manual directory for Solaris 7.
-if [[ $words[2] = (<->*|ln) ]]; then
+if [[ $words[2] = (<->*|l|n) ]]; then
rep=(
$manpath/(sman|man|cat)${words[2]}/${~approx}$PREFIX${~star}$SUFFIX.<->*(N:t) )
else
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: PATCH: _man copes with : delimited manpath
1999-09-27 13:17 PATCH: _man copes with : delimited manpath Adam Spiers
@ 1999-09-27 13:44 ` Peter Stephenson
1999-09-28 9:36 ` Tanaka Akira
1999-10-06 16:22 ` PATCH: " Oliver Kiddle
1 sibling, 1 reply; 7+ messages in thread
From: Peter Stephenson @ 1999-09-27 13:44 UTC (permalink / raw)
To: zsh workers mailing list
Adam Spiers wrote:
> On my system, `manpath' generates colon-delimited paths, rather than
> space-delimited ones. This patch solves that problem. It also fixes
> what I think is a typo, but someone should check this.
You'll need to add this. mp doesn't get split into words the first time
unless you use an array.
--- Completion/User/_man~ Mon Sep 27 15:41:48 1999
+++ Completion/User/_man Mon Sep 27 15:42:53 1999
@@ -15,7 +15,7 @@
fi
if (( ! $#manpath )); then
- local mp=$(manpath 2>/dev/null)
+ local mp=($(manpath 2>/dev/null))
[[ "$mp" == *:* ]] && mp=( ${(s.:.)mp} )
manpath=( $mp )
fi
--
Peter Stephenson <pws@ibmth.df.unipi.it> Tel: +39 050 844536
WWW: http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: PATCH: _man copes with : delimited manpath
1999-09-27 13:44 ` Peter Stephenson
@ 1999-09-28 9:36 ` Tanaka Akira
0 siblings, 0 replies; 7+ messages in thread
From: Tanaka Akira @ 1999-09-28 9:36 UTC (permalink / raw)
To: zsh workers mailing list
In article <9909271344.AA19699@ibmth.df.unipi.it>,
Peter Stephenson <pws@ibmth.df.unipi.it> writes:
> + local mp=($(manpath 2>/dev/null))
I think this is desired syntax. But it is not implemented yet.
is27e1u11% man <TAB>
_man: unknown file attribute [18]
Index: Completion/User/_man
===================================================================
RCS file: /projects/zsh/zsh/Completion/User/_man,v
retrieving revision 1.1.1.16
diff -u -F^( -r1.1.1.16 _man
--- Completion/User/_man 1999/09/27 14:24:58 1.1.1.16
+++ Completion/User/_man 1999/09/28 09:34:44
@@ -15,7 +15,8 @@
fi
if (( ! $#manpath )); then
- local mp=($(manpath 2>/dev/null))
+ local mp
+ mp=($(manpath 2>/dev/null))
[[ "$mp" == *:* ]] && mp=( ${(s.:.)mp} )
manpath=( $mp )
fi
--
Tanaka Akira
^ permalink raw reply [flat|nested] 7+ messages in thread
* PATCH: Re: _man copes with : delimited manpath
1999-09-27 13:17 PATCH: _man copes with : delimited manpath Adam Spiers
1999-09-27 13:44 ` Peter Stephenson
@ 1999-10-06 16:22 ` Oliver Kiddle
1999-10-06 17:24 ` Adam Spiers
1 sibling, 1 reply; 7+ messages in thread
From: Oliver Kiddle @ 1999-10-06 16:22 UTC (permalink / raw)
To: Zsh workers; +Cc: Adam Spiers
Adam Spiers wrote:
> On my system, `manpath' generates colon-delimited paths, rather than
> space-delimited ones. This patch solves that problem. It also fixes
> what I think is a typo, but someone should check this.
Sorry, I wasn't thinking properly when I wrote it - all manpath commands I can find return a colon delimited string.
I prefered the more succinct way it was done so I'd suggest the following patch. An alternative would be to assign to MANPATH instead of manpath.
Oliver Kiddle
*** Completion/User/_man.bak Wed Oct 6 17:09:43 1999
--- Completion/User/_man Wed Oct 6 17:09:58 1999
***************
*** 14,25 ****
approx="(#a${_comp_correct})"
fi
! (( $#manpath )) || manpath=$(manpath 2>/dev/null) ||
manpath=( /usr/man(-/N) /(opt|usr)/(dt|share|X11R6|local)/(cat|)man(-/N) )
# `sman' is the SGML manual directory for Solaris 7.
! if [[ $words[2] = (<->*|ln) ]]; then
rep=(
$manpath/(sman|man|cat)${words[2]}/${~approx}$PREFIX${~star}$SUFFIX.<->*(N:t) )
else
--- 14,25 ----
approx="(#a${_comp_correct})"
fi
! (( $#manpath )) || manpath=( ${(s.:.)$(manpath 2>/dev/null)} ) ||
manpath=( /usr/man(-/N) /(opt|usr)/(dt|share|X11R6|local)/(cat|)man(-/N) )
# `sman' is the SGML manual directory for Solaris 7.
! if [[ $words[2] = (<->*|l|n) ]]; then
rep=(
$manpath/(sman|man|cat)${words[2]}/${~approx}$PREFIX${~star}$SUFFIX.<->*(N:t) )
else
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: PATCH: Re: _man copes with : delimited manpath
1999-10-06 16:22 ` PATCH: " Oliver Kiddle
@ 1999-10-06 17:24 ` Adam Spiers
1999-10-06 17:35 ` Adam Spiers
0 siblings, 1 reply; 7+ messages in thread
From: Adam Spiers @ 1999-10-06 17:24 UTC (permalink / raw)
To: Zsh workers
Oliver Kiddle (opk@u.genie.co.uk) wrote:
> Adam Spiers wrote:
> > On my system, `manpath' generates colon-delimited paths, rather than
> > space-delimited ones. This patch solves that problem. It also fixes
^^^^^^^^^^^^^
> > what I think is a typo, but someone should check this.
^^^^^^^^^^^^^^^^^^^^^^
[snip]
> ! if [[ $words[2] = (<->*|ln) ]]; then
[snip]
> ! if [[ $words[2] = (<->*|l|n) ]]; then
Was I wrong in thinking that this was a typo? Or did you just
accidentally unfix my fix? :-)
Adam
P.S. Am I alone in finding context diffs remarkably awkward to read?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: PATCH: Re: _man copes with : delimited manpath
1999-10-06 17:24 ` Adam Spiers
@ 1999-10-06 17:35 ` Adam Spiers
1999-10-07 8:43 ` Oliver Kiddle
0 siblings, 1 reply; 7+ messages in thread
From: Adam Spiers @ 1999-10-06 17:35 UTC (permalink / raw)
To: Zsh workers
Adam Spiers, on thelonious (adam@thelonious.new.ox.ac.uk) wrote:
> Was I wrong in thinking that this was a typo? Or did you just
> accidentally unfix my fix? :-)
Agh, ignore that; I read the patch the wrong way round. Like I said ...
> P.S. Am I alone in finding context diffs remarkably awkward to read?
But it still looks this patch replaces two or more of the previous
_man patches. Which ones?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: PATCH: Re: _man copes with : delimited manpath
1999-10-06 17:35 ` Adam Spiers
@ 1999-10-07 8:43 ` Oliver Kiddle
0 siblings, 0 replies; 7+ messages in thread
From: Oliver Kiddle @ 1999-10-07 8:43 UTC (permalink / raw)
To: Adam Spiers; +Cc: Zsh workers
Adam Spiers wrote:
> Agh, ignore that; I read the patch the wrong way round. Like I said ...
> > P.S. Am I alone in finding context diffs remarkably awkward to read?
They're not too bad, the only problem is with a patch like mine where
there are only changed lines (as opposed to added/removed) so it is less
obvious which lines are new and which are old. You could always write a
quick script to colourise diffs to make it clearer. I use an awk script
as a filter before my pager when I use mush which colourises e-mails.
> But it still looks this patch replaces two or more of the previous
> _man patches. Which ones?
It was intended to replace your original patch and as a result render
those which followed irrelevant. This is why I also included your typo
fix - so that people wouldn't have to apply half of your patch.
Oliver Kiddle
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~1999-10-07 8:47 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-09-27 13:17 PATCH: _man copes with : delimited manpath Adam Spiers
1999-09-27 13:44 ` Peter Stephenson
1999-09-28 9:36 ` Tanaka Akira
1999-10-06 16:22 ` PATCH: " Oliver Kiddle
1999-10-06 17:24 ` Adam Spiers
1999-10-06 17:35 ` Adam Spiers
1999-10-07 8:43 ` Oliver Kiddle
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).