zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@sunsite.dk
Subject: Re: Few newbie questions..
Date: Tue, 21 Aug 2001 06:38:43 +0000	[thread overview]
Message-ID: <1010821063843.ZM20952@candle.brasslantern.com> (raw)
In-Reply-To: <001501c12a0a$564ed110$21c9ca95@mow.siemens.ru>

On Aug 21, 10:27am, Borsenkow Andrej wrote:
}
} > Try this patch.  It handles -s, -S, and $MANSECT.  However, I don't
} > know what it does with the awk stuff in _man_pages -- it's possible
} > that the assignment to $awk needs to be adjusted as well.
} 
} No, it should be O.K.

Except, of course, that I forgot the fallback condition.  Here's the
more correct patch (the missing bit was

+  else
+    sect=$words[2]

).

Index: Completion/Unix/Command/_man
===================================================================
--- Completion/Unix/Command/_man	2001/07/10 09:05:14	1.3
+++ Completion/Unix/Command/_man	2001/08/21 06:35:55
@@ -22,9 +22,20 @@
 
   mrd=(${^manpath/\%L/${LANG:-En_US.ASCII}}/mandb(N))
 
-  if [[ $words[2] = (<->*|1M|l|n) ]]; then
-    dirs=( $^manpath/(sman|man|cat)${words[2]}/ )
-    awk="\$2 == \"$words[2]\" {print \$1}"
+  local sect
+  if [[ $OSTYPE = solaris* ]]; then
+    sect=$words[$words[(i)-s]+1]
+  elif [[ -n ${sect:=$words[$words[(i)-S]+1]} || -n ${sect:=$MANSECT} ]]; then
+    if [[ $sect != ${sect::="${sect//:/|}"} ]]; then
+      sect="($sect)"
+    fi
+  else
+    sect=$words[2]
+  fi
+
+  if [[ $sect = (<->*|1M|l|n) || $sect = \((*\|*)\) ]]; then
+    dirs=( $^manpath/(sman|man|cat)${~sect}/ )
+    awk="\$2 == \"$sect\" {print \$1}"
   else
     dirs=( $^manpath/(sman|man|cat)*/ )
     awk='{print $1}'


-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


  reply	other threads:[~2001-08-21  6:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-17 10:55 Jukka Lehti
2001-08-17 15:22 ` Bart Schaefer
2001-08-17 17:39   ` Jukka Lehti
2001-08-18  3:25     ` Bart Schaefer
2001-08-18  8:04       ` Jukka Lehti
2001-08-20 22:34       ` Vincent Lefevre
2001-08-21  2:55         ` Bart Schaefer
2001-08-21  6:27           ` Borsenkow Andrej
2001-08-21  6:38             ` Bart Schaefer [this message]
2001-08-20 11:59   ` Jukka Lehti
2001-08-20 12:19     ` Sven Wischnowsky

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=1010821063843.ZM20952@candle.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@sunsite.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).