From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8188 invoked from network); 17 May 2000 16:58:43 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 17 May 2000 16:58:43 -0000 Received: (qmail 26149 invoked by alias); 17 May 2000 16:58:31 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11445 Received: (qmail 26138 invoked from network); 17 May 2000 16:58:22 -0000 From: "Bart Schaefer" Message-Id: <1000517165744.ZM18034@candle.brasslantern.com> Date: Wed, 17 May 2000 16:57:44 +0000 In-Reply-To: <0FUP001EMLEECG@la-la.cambridgesiliconradio.com> Comments: In reply to Peter Stephenson "complete (real C) tags" (May 17, 3:54pm) References: <0FUP001EMLEECG@la-la.cambridgesiliconradio.com> X-Mailer: Z-Mail (5.0.0 30July97) To: Peter Stephenson , zsh-workers@sunsite.auc.dk (Zsh hackers list) Subject: Re: complete (real C) tags MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On May 17, 3:54pm, Peter Stephenson wrote: } Subject: complete (real C) tags } } I don't think I ever posted this; it allows the new completion system to } complete tags from a TAGS or tags file (i.e. the tags used by Emacs and vi, } nothing to do with completion tags). I have it bound to ^Xt. Somebody sent me a similar thing for compctl. Hmm, where did I put it? } # could do this with sed, just can't be bothered to work out how, } $(perl -ne '/([a-zA-Z_0-9]+)[ \t:;,\(]*\x7f/ && } print "$1\n"' $c_path$c_Tagsfile) That's a valiant effort, but it doesn't agree with the way emacs parses a TAGS file. You'd be better off simply discarding everything after the DEL character and also discarding all punctuation, and then treating the remaining words on every line as if they were all candidates. (Try using find-tag on e.g. the word `static' in emacs sometime.) BTW, here's the equivalent sed (actually, even slightly more accurate, if the TAGS file is for a C or C++ program), using $'...' to interpolate \t and \x7f. It can still miss multiple identifiers that appear on the same declaration line in the C source file (it picks out only the rightmost). sed -ne 's/^\(.*[a-zA-Z_0-9]\)[[ '$'\t'':;,()]*'$'\177''.*$/\1/' \ -e 's/\(.*[^a-zA-Z_0-9]\)*\([a-zA-Z_0-9]*\)$/\2/p' -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com