zsh-users
 help / color / mirror / code / Atom feed
From: Jarkko Maja <jarkko1982@yahoo.com>
To: zsh-users@sunsite.dk
Subject: Re: man page completion / regexp
Date: Mon, 7 Jun 2004 12:45:13 -0700 (PDT)	[thread overview]
Message-ID: <20040607194513.94823.qmail@web60303.mail.yahoo.com> (raw)
In-Reply-To: <s0c446a5.012@fs-prx1.hansemerkur.de>

Hi Bart,

thanks for your help, now everything works perfectly
again! Below for others who might be interested is
another shot of my config, Yahoo! mail seems to wrap
lines at random.

Thanks!



# man page completion
man_glob () {
	local a b manp cat
	read -cA a
	read -lA b
	manp=`manpath 2> /dev/null` || manp=`echo "$MANPATH"`
	[[ "$OSTYPE" = *bsd* ]] && cat=,cat
	if [[ "$a[2]" = [0-9nlpo](p|) ]] # && [[ -n "$a[3]"
|| "${(M)b% }" = " " ]]
	then
		reply=( ${^$(echo $manp | sed -e 's/:/
/g')}/{man,sman$cat}$a[2]/$1*(-N.:t) )
	else
		reply=( ${^$(echo $manp | sed -e 's/:/
/g')}/{man,sman$cat}[0-9nlpo]{,X,m}*/$1*(-N.:t) )
	fi
	reply=( ${reply%.[^0-9Xmnlpo]*} )
	# Uncomment to strip trailing section names from
reply
	#reply=( ${reply%.[0-9Xmnlpo]*} )
}
compctl -K man_glob -x 'C[-1,-P]' -m - \
	'R[-*l*,;]' -g '*.(man|[0-9Xmnlpo](|[a-z]))' -- + -f
-g '..' man

# Uncomment to accept man page names with trailing
section names, e.g., man.1
man () {
	local test=${(M)@#*/} # File name probably contains a
slash
	if [[ -z "$test" ]] && [[ $# -lt 3 ]]
	then
		command man
${(M)${${${(M)@%.[0-9Xmnlpo]*}#.}%pm}##[0-9Xmnlpo](p|)}
${@%.[0-9Xmnlpo]*}
	else
		command man "$@"
	fi
}






	
		
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 


       reply	other threads:[~2004-06-07 19:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <s0c446a5.012@fs-prx1.hansemerkur.de>
2004-06-07 19:45 ` Jarkko Maja [this message]
2004-06-07  8:42 Michael Dettmer
  -- strict thread matches above, loose matches on Subject: below --
2004-06-06 10:09 Jarkko Maja
2004-06-07  4:55 ` 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=20040607194513.94823.qmail@web60303.mail.yahoo.com \
    --to=jarkko1982@yahoo.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).