From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20272 invoked from network); 15 Dec 2000 14:40:38 -0000 Received: from sunsite.dk (HELO sunsite.auc.dk) (130.225.51.30) by ns1.primenet.com.au with SMTP; 15 Dec 2000 14:40:38 -0000 Received: (qmail 4836 invoked by alias); 15 Dec 2000 14:40:33 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 13281 Received: (qmail 4829 invoked from network); 15 Dec 2000 14:40:32 -0000 To: zsh-workers@sunsite.auc.dk Subject: mere and _mere MIME-Version: 1.0 (generated by REMI 1.14.3 - "Matsudai") Content-Type: text/plain; charset=US-ASCII From: Tanaka Akira Date: 15 Dec 2000 23:38:44 +0900 Message-ID: User-Agent: T-gnus/6.14.5 (based on Gnus v5.8.7) (revision 03) REMI/1.14.3 (Matsudai) Deisui/1.14.0 (Kikuhime) APEL/10.2 Emacs/20.7 (i386-unknown-openbsd2.7) MULE/4.0 (HANANOEN) I found that Functions/Misc/mere is useful. But it's not powerful as I want. So I rewroted it and write _mere for its completion. Index: Functions/Misc/mere =================================================================== RCS file: /cvsroot/zsh/zsh/Functions/Misc/mere,v retrieving revision 1.1.1.1 diff -u -u -r1.1.1.1 mere --- Functions/Misc/mere 1999/06/08 09:26:06 1.1.1.1 +++ Functions/Misc/mere 2000/12/15 14:34:27 @@ -1,3 +1,83 @@ -#! /bin/sh -# read a man page in the current directory -nroff -man -Tman $1 | less -s +# read a man page + +setopt localoptions extendedglob + +local manual="$1" col=col terminal=man magic line + +# /usr/bin/col on SunOS 4 doesn't support -x. +if [[ -x /usr/5bin/col ]]; then + col=/usr/5bin/col; +fi + +# SunOS 5 has no `man' terminal. +if [[ -d /usr/share/lib/nterm && + ! -e /usr/share/lib/nterm/tab.$terminal ]]; then + terminal=lp; +fi + +# HP-UX has no `man' terminal. +if [[ -d /usr/share/lib/term && + ! -e /usr/share/lib/term/tab$terminal ]]; then + terminal=lp; +fi + +# Unixware has no `man' terminal. +if [[ -d /usr/ucblib/doctools/nterm && + ! -e /usr/ucblib/doctools/nterm/tab.$terminal ]]; then + terminal=lp; +fi + +# Solaris has SGML manuals. +if [[ -f /usr/lib/sgml/sgml2roff ]] && + [[ "$(read -er < $manual)" = "