zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: Felix Rosencrantz <f_rosencrantz@yahoo.com>
Cc: zw <zsh-workers@sunsite.dk>
Subject: PATCH: Re: Bug with _perl_builtin_funcs
Date: Wed, 23 Apr 2003 12:17:02 +0200	[thread overview]
Message-ID: <22800.1051093022@gmcs3.logica.co.uk> (raw)
In-Reply-To: <20030401151646.34142.qmail@web10411.mail.yahoo.com>

On 1 Apr, Felix Rosencrantz wrote:
> There is a bug in the function _perl_builtin_funcs.  This function attempts to
> build a list of perl builtin funcs by parsing the man page for perlfunc.  When
> it parses the man page it assume it is plain text.  However, on RH the man page
> is compressed with gzip.

This should make it use bzip2 or gzip as appropriate. I also had
problems with the lines starting .IP instead of .Ip so I fixed that so
it now works on my system.

Oliver

Index: _perl_builtin_funcs
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Type/_perl_builtin_funcs,v
retrieving revision 1.1
diff -u -r1.1 _perl_builtin_funcs
--- _perl_builtin_funcs	2 Apr 2001 11:40:15 -0000	1.1
+++ _perl_builtin_funcs	23 Apr 2003 10:10:22 -0000
@@ -8,24 +8,31 @@
 # for future use.
 #
 
-if [[ ${+_perl_builtin_funcs} -eq 0 ]]; then
+if (( ! $+_perl_builtin_funcs )); then
   typeset -agU _perl_builtin_funcs
   local perlfunc
 
-  if [[ -n "${perlfunc:=$(man -w perlfunc 2>/dev/null; print -l ${^manpath}/man1/perlfunc.1(N) {/usr/man,/usr/share/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`
-               )
+  if [[ -n "${perlfunc:=$(man -w perlfunc 2>/dev/null; print -l ${^manpath:-${(s.:.)$(manpath)}}/man1/perlfunc.1(|[zZ]|gz|bz2)(N) {/usr/man,/usr/share/man,/usr/local/man}/man1/perlfunc.1(|[zZ]|gz|bz2)(N))}" ]]; then
+    case $perlfunc in
+      *.bz2) perlfunc="bzip2 -cd $perlfunc" ;;
+      *[zZ]) perlfunc="gzip -cd $perlfunc" ;;
+      *) perlfunc="cat $perlfunc" ;;
+    esac
+    _perl_builtin_funcs=(
+      $($=perlfunc | perl -lne '
+      $in_funcs++, next if /Alphabetical/;
+      next unless $in_funcs;
+      if (/^\.I[pP] "(\w+)/) {
+        print $1 unless $func{$1}; $func{$1}++
+      }')
+    )
   else
-    echo "Couldn't find perlfunc man page; giving up."
+    _message "can't find perlfunc man page; giving up"
     return 1
   fi
 fi
 
 local expl
 
-_wanted functions expl 'Perl built-in functions' compadd -a _perl_builtin_funcs
+_wanted functions expl 'perl built-in function' compadd "$@" -a - \
+    _perl_builtin_funcs


  reply	other threads:[~2003-04-23 10:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-01 15:16 Felix Rosencrantz
2003-04-23 10:17 ` Oliver Kiddle [this message]
2003-04-23 16:53   ` PATCH: " Bart Schaefer
2003-04-24  9:06     ` Oliver Kiddle

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=22800.1051093022@gmcs3.logica.co.uk \
    --to=okiddle@yahoo.co.uk \
    --cc=f_rosencrantz@yahoo.com \
    --cc=zsh-workers@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).