From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15074 invoked from network); 14 Sep 1999 00:19:22 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 14 Sep 1999 00:19:22 -0000 Received: (qmail 7194 invoked by alias); 14 Sep 1999 00:19:11 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7817 Received: (qmail 7187 invoked from network); 14 Sep 1999 00:19:10 -0000 To: zsh-workers@sunsite.auc.dk Subject: PATCH: _apt, _socket and _perl_builtin_funcs MIME-Version: 1.0 (generated by AKEMI 1.13.2 - =?ISO-2022-JP?B?Ig==?= =?ISO-2022-JP?B?GyRCQTA0Y0s8GyhCIg==?=) Content-Type: text/plain; charset=US-ASCII From: Tanaka Akira Date: 14 Sep 1999 09:19:07 +0900 Message-ID: User-Agent: Chao-gnus/6.12.5 AKEMI/1.13.2 (=?ISO-2022-JP?B?GyRCQTAbKEI=?= =?ISO-2022-JP?B?GyRCNGNLPBsoQg==?=) FLAM-DOODLE/1.12.6 (=?ISO-2022-JP?B?GyRCM3cbKEI=?= 10R4.0/5.0) Emacs/20.4 (sparc-sun-solaris2.6) MULE/4.0 (HANANOEN) * _apt: support the form of option_prefix='...!command...'. * _socket: more explanations. * _perl_builtin_funcs: support systems that has no `-w' option with `man'. (Solaris 7) _perl_builtin_funcs does not work on Debian even now. Because the result of `man -w perlfunc' is gziped file -- `/usr/man/man1/perlfunc.1p.gz'. Index: Completion/Debian/_apt =================================================================== RCS file: /projects/zsh/zsh/Completion/Debian/_apt,v retrieving revision 1.1.1.4 diff -u -F^( -r1.1.1.4 _apt --- _apt 1999/09/13 16:35:36 1.1.1.4 +++ _apt 1999/09/14 00:10:49 @@ -113,7 +113,7 @@ tmp2=($_ra_left${(M)^short_hasarg:#$~tmp1} $_ra_left${(M)^short_configfile:#$~tmp1} $_ra_left${(M)^short_arbitem:#$~tmp1}) compadd "$expl_opt[@]" -S= - $tmp2' - comp_opt='[[ -prefix - || -z "$compconfig[option_prefix]" ]]'" && { $comp_short; $comp_long }" + comp_opt='[[ -prefix - || -z "$compconfig[option_prefix]" || "$compconfig[option_prefix]" = *\!$words[1]* ]]'" && { $comp_short; $comp_long }" regex_short=() regex_long=() Index: Completion/User/_socket =================================================================== RCS file: /projects/zsh/zsh/Completion/User/_socket,v retrieving revision 1.1.1.3 diff -u -F^( -r1.1.1.3 _socket --- _socket 1999/09/13 18:22:21 1.1.1.3 +++ _socket 1999/09/14 00:10:49 @@ -8,22 +8,42 @@ local state line expl typeset -A options +if [[ $CURRENT -eq 2 && ( + -z "$compconfig[option_prefix]" || + "$compconfig[option_prefix]" = *\!${words[1]}* || + "$PREFIX" = -* ) ]]; then + _description expl option + compadd -M 'r:|[_-]=* r:|=*' "$expl[@]" - -version +fi + _arguments -s \ - -{b,c,f,q,r,v,w} \ - -{s,l} \ - '-p:command:->command' \ + '-b[background]' \ + '-c[crlf]' \ + '-f[fork]' \ + '-q[quit]' \ + '-r[read only]' \ + '-v[verbose]' \ + '-w[write only]' \ + '-s[server]' \ + '-l[loop]' \ + '-p[program]:command:->command' \ ':arg1:->arg1' \ ':arg2:->arg2' case "$state" in command) compset -q - _normal + if [[ $CURRENT -eq 1 ]]; then + _command_names -e "$@" + else + _normal + fi ;; arg1) if (( $+options[-s] )); then - _message 'port to listen' + _description expl 'port to listen' + _ports "$expl[@]" else _description expl 'host' _combination socket_hosts_ports hosts "$expl[@]" Index: Completion/User/_perl_builtin_funcs =================================================================== RCS file: /projects/zsh/zsh/Completion/User/_perl_builtin_funcs,v retrieving revision 1.1.1.1 diff -u -F^( -r1.1.1.1 _perl_builtin_funcs --- _perl_builtin_funcs 1999/09/05 22:04:03 1.1.1.1 +++ _perl_builtin_funcs 1999/09/14 00:10:49 @@ -12,13 +12,13 @@ typeset -agU _perl_builtin_funcs local perlfunc - if perlfunc=`man -w perlfunc 2>&1`; then + if [[ -n "${perlfunc:=$(man -w perlfunc 2>/dev/null; print -l ${^manpath}/man1/perlfunc.1(N) {/usr/man,/usr/local/man}/man1/perlfunc.1(N))}" ]]; then _perl_builtin_funcs=( `perl -lne ' $in_funcs++, next if /Alphabetical/; \ next unless $in_funcs; \ if (/^\.Ip "(\w+)/) { \ print $1 unless $func{$1}; $func{$1}++ \ - }' $perlfunc` + }' $=perlfunc` ) else echo "Couldn't find perlfunc man page; giving up." -- Tanaka Akira