From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21502 invoked from network); 30 Jul 2004 15:36:23 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 30 Jul 2004 15:36:23 -0000 Received: (qmail 92801 invoked from network); 30 Jul 2004 15:36:17 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 30 Jul 2004 15:36:17 -0000 Received: (qmail 28867 invoked by alias); 30 Jul 2004 15:32:55 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20223 Received: (qmail 28857 invoked from network); 30 Jul 2004 15:32:55 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by 130.225.247.90 with SMTP; 30 Jul 2004 15:32:55 -0000 Received: (qmail 83132 invoked from network); 30 Jul 2004 15:30:59 -0000 Received: from acolyte.scowler.net (216.254.112.45) by a.mx.sunsite.dk with SMTP; 30 Jul 2004 15:30:56 -0000 Received: by acolyte.scowler.net (Postfix, from userid 1000) id 997867004E; Fri, 30 Jul 2004 11:30:54 -0400 (EDT) Date: Fri, 30 Jul 2004 11:30:54 -0400 From: Clint Adams To: zsh-workers@sunsite.dk Cc: Hugo Haas , 262247-forwarded@bugs.debian.org Subject: Re: Bug#262247: zsh: Improved make completion Message-ID: <20040730153054.GA4059@scowler.net> References: <20040730101751.GA11905@larve.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="GvXjxJ+pjyke8COw" Content-Disposition: inline In-Reply-To: <20040730101751.GA11905@larve.net> User-Agent: Mutt/1.5.6+20040523i X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=-4.9 required=6.0 tests=BAYES_00 autolearn=no version=2.63 X-Spam-Hits: -4.9 --GvXjxJ+pjyke8COw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline > Attached is a Perl script that can be used as a replacement of the > Perl script appearing in the make completion code (_make) to follow > include statements in Makefiles. You mean it should replace the expression '@matches = /^(?:([a-zA-Z0-9]+[^\/\t=\s]+)\s*)+:/ and print join(" ", @matches); if (/^\.include\s+\/ || /^\.include\s+\".*mk\/bsd\.pkg\.(subdir\.)?mk\"/) { print "fetch fetch-list extract patch configure build install reinstall dein stall package describe checkpatch checksum makesum\n"; } ' in _make? Maybe the perl and awk bits should be replaced by some native Z-Shell parsing. --GvXjxJ+pjyke8COw Content-Type: text/x-perl; charset=us-ascii Content-Disposition: attachment; filename="ma.pl" sub match() { my ($fn) = @_; @matches = /^(?:([a-zA-Z0-9]+[^\/\t=\s]+)\s*)+:/ and print join(" ", @matches); if (/^include\s+(\S+)/) { my $i = $1;; if ($fn =~ m|/|) { $fn =~ s|/[^/]+$|/$i|; } else { $fn = $i; } &parse($fn); } elsif (/^\.include\s+\/ || /^\.include\s+\".*mk\/bsd\.pkg\.(subdir\.)?mk\"/) { print "fetch fetch-list extract patch configure build install reinstall deinstall package describe checkpatch checksum makesum\n"; } } sub parse() { my ($fn) = @_; my $f; open($f, $fn) || return; while (<$f>) { &match($fn); } close($f); } &parse($ARGV[0]); --GvXjxJ+pjyke8COw--