zsh-users
 help / color / mirror / code / Atom feed
From: "Thomas Köhler" <jean-luc@picard.franken.de>
To: zsh-users@math.gatech.edu
Cc: "Johan Sundström" <johsu650@student.liu.se>,
	"Sven Guckes" <guckes@math.fu-berlin.de>
Subject: Re: completion control for "man" command
Date: Sun, 14 Jun 1998 01:50:32 +0200	[thread overview]
Message-ID: <19980614015032.30444@picard.franken.de> (raw)
In-Reply-To: <19980613204012.S3086@math.fu-berlin.de>; from Sven Guckes on Sat, Jun 13, 1998 at 08:40:12PM +0200

Hello,

On Sat, Jun 13, 1998 at 08:40:12PM +0200, Sven Guckes wrote:

> Hey!
> 
> Rather than keeping this mail to myself and trying the impossible [;-)] I'll
> forward this to the experts on the zsh-users mailist. Hope you don't mind.
> (And I hope it answers your question on a "public forum" for zsh, Johan. :-)
> 
> I wonder - hasn't the completion control for manuals been perfected by now?
> 
> Sven
[message on "how do I complete manpages?" deleted]

I use the following for man completion. It uses a file ~/tmp/_man_ which
stores the filenames in question. If you don't like your loginshell to
wait for the creation of the file every now and then (I use 14 days)
because it creates the _man_-file, just make a cronjob out of this...

------------------------------ snip ~/.zshrc ------------------------------
# completion for manpages
# if ~/tmp/_man_ is too old then remove it and create a new one later
find ~/tmp -mtime 14 -name "_man_" -exec rm -f {} \;

createman () {
   echo "creating ~/tmp/_man_"
   # search the filenames which should be included later...
   find /usr/man -type f > ~/tmp/_man_
   find /usr/local/man -type f >> ~/tmp/_man_
   find /usr/X11R6/man -type f >> ~/tmp/_man_
   # remove pathname, .gz-suffix and the section-number, use sort & uniq
   # to get an ordered list of filenames
   sed -e "s/.*\///" -e "s/\.gz//" -e "s/\.[^.]*$//" ~/tmp/_man_ | sort | uniq > ~/tmp/_man2_
   rm -f ~/tmp/_man_
   # put all on one line
   (for i in `cat ~/tmp/_man2_` ; do echo -n "$i " ; done) > ~/tmp/_man_
   rm -f ~/tmp/_man2_
}
# create ~/tmp/_man_
if [ ! -f ~/tmp/_man_ ] ; then createman ; fi

# invoke compctl on file list
man_pages=(`cat ~/tmp/_man_`)
compctl -f -k man_pages man
------------------------------ snip ~/.zshrc ------------------------------

HTH,
Thomas

-- 
    Thomas Köhler    Email:     jean-luc@picard.franken.de
        <><           WWW:    http://home.pages.de/~jeanluc/
                      IRC:               jeanluc
      LCARS --- Linux for Computers on All Real Starships


  reply	other threads:[~1998-06-13 23:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-06-13 18:40 Sven Guckes
1998-06-13 23:50 ` Thomas Köhler [this message]
1998-06-15  0:18   ` Sven Guckes
1998-06-15  1:36     ` Bart Schaefer
1998-06-15  8:54     ` Thomas Koehler
1998-06-14  0:29 ` Bart Schaefer

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=19980614015032.30444@picard.franken.de \
    --to=jean-luc@picard.franken.de \
    --cc=guckes@math.fu-berlin.de \
    --cc=johsu650@student.liu.se \
    --cc=zsh-users@math.gatech.edu \
    /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).