* zsh 4.0.1 _man bug
@ 2001-07-10 6:04 Max Ischenko
2001-07-10 7:49 ` Bart Schaefer
0 siblings, 1 reply; 5+ messages in thread
From: Max Ischenko @ 2001-07-10 6:04 UTC (permalink / raw)
To: zsh-users
When completing man pages with _man, I got the error -- alpha suffixes
not removed from the end:
man 2 io<TAB> -> man 2 ioctl
man n listb<TAB> -> man n listbox.n
Does anyone have a fix for this?
--
And it should be the law: If you use the word `paradigm' without knowing
what the dictionary says it means, you go to jail. No exceptions.
-- David Jones
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: zsh 4.0.1 _man bug
2001-07-10 6:04 zsh 4.0.1 _man bug Max Ischenko
@ 2001-07-10 7:49 ` Bart Schaefer
2001-07-10 8:07 ` Sven Wischnowsky
0 siblings, 1 reply; 5+ messages in thread
From: Bart Schaefer @ 2001-07-10 7:49 UTC (permalink / raw)
To: Max Ischenko, zsh-users
On Jul 10, 9:04am, Max Ischenko wrote:
}
} man n listb<TAB> -> man n listbox.n
}
} Does anyone have a fix for this?
Try 4.0.2 ... the _man completion function was significantly improved.
--
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: zsh 4.0.1 _man bug
2001-07-10 7:49 ` Bart Schaefer
@ 2001-07-10 8:07 ` Sven Wischnowsky
2001-07-10 9:30 ` Max Ischenko
0 siblings, 1 reply; 5+ messages in thread
From: Sven Wischnowsky @ 2001-07-10 8:07 UTC (permalink / raw)
To: zsh-users
Bart Schaefer wrote:
> On Jul 10, 9:04am, Max Ischenko wrote:
> }
> } man n listb<TAB> -> man n listbox.n
> }
> } Does anyone have a fix for this?
>
> Try 4.0.2 ... the _man completion function was significantly improved.
Actually, it had the same bug, which is fixed in the new _man function
(included below for your convenience, it should work with 4.0.1, too).
Bye
Sven
#compdef man apropos whatis
_man() {
local dirs expl mrd awk
if [[ $service == man ]] && (( $words[(I)-l] + $words[(I)--local-file] )); then
_files || return 0
fi
if (( ! $#manpath )); then
local mp
mp=($(manpath 2>/dev/null))
[[ "$mp" == *:* ]] && mp=( ${(s.:.)mp} )
manpath=( $mp )
fi
(( $#manpath )) || manpath=( ${(s.:.)$(manpath 2>/dev/null)} ) ||
manpath=( /usr/man(-/) /(opt|usr)/(dt|share|X11R6|local)/(cat|)man(-/) )
# `sman' is the SGML manual directory for Solaris 7.
# 1M is system administrator commands on SVR4
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}"
else
dirs=( $^manpath/(sman|man|cat)*/ )
awk='{print $1}'
fi
_wanted manuals expl 'manual page' _man_pages
}
_man_pages() {
local matcher pages dummy
zparseopts -E M+:=matcher
if (( $#matcher )); then
matcher=( ${matcher:#-M} )
matcher="$matcher"
else
matcher=
fi
pages=( $dirs )
compfiles -p pages '' '' "$matcher" '' dummy '*'
pages=( ${^~pages}(N:t:r) )
(($#mrd)) && pages[$#pages+1]=($(awk $awk $mrd))
# Remove any compression suffix, then remove the minimum possible string
# beginning with .<->: that handles problem cases like files called
# `POSIX.1.5'.
compadd "$@" - ${pages%.(?|<->*)}
}
_man "$@"
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: zsh 4.0.1 _man bug
2001-07-10 8:07 ` Sven Wischnowsky
@ 2001-07-10 9:30 ` Max Ischenko
2001-07-10 9:31 ` Sven Wischnowsky
0 siblings, 1 reply; 5+ messages in thread
From: Max Ischenko @ 2001-07-10 9:30 UTC (permalink / raw)
To: zsh-users
Sven Wischnowsky wrote:
> > Try 4.0.2 ... the _man completion function was significantly improved.
>
> Actually, it had the same bug, which is fixed in the new _man function
> (included below for your convenience, it should work with 4.0.1, too).
>
Thank you, it works fine.
Just a little question -- how should I install this version of _man,
assuming that I don't have root permissions on the machine?
--
Best regards, Maxim F. Ischenko.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: zsh 4.0.1 _man bug
2001-07-10 9:30 ` Max Ischenko
@ 2001-07-10 9:31 ` Sven Wischnowsky
0 siblings, 0 replies; 5+ messages in thread
From: Sven Wischnowsky @ 2001-07-10 9:31 UTC (permalink / raw)
To: zsh-users
Max Ischenko wrote:
> Sven Wischnowsky wrote:
>
> > > Try 4.0.2 ... the _man completion function was significantly improved.
> >
> > Actually, it had the same bug, which is fixed in the new _man function
> > (included below for your convenience, it should work with 4.0.1, too).
> >
>
> Thank you, it works fine.
> Just a little question -- how should I install this version of _man,
> assuming that I don't have root permissions on the machine?
You can always put it into one of your own function directories and make
sure that directory is earlier in you $fpath than the system
directories. The completion system will than take care to prefer your
version over the globally installed one.
Bye
Sven
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2001-07-10 9:33 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-10 6:04 zsh 4.0.1 _man bug Max Ischenko
2001-07-10 7:49 ` Bart Schaefer
2001-07-10 8:07 ` Sven Wischnowsky
2001-07-10 9:30 ` Max Ischenko
2001-07-10 9:31 ` Sven Wischnowsky
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).