From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15697 invoked from network); 23 May 2000 11:45:06 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 23 May 2000 11:45:06 -0000 Received: (qmail 3602 invoked by alias); 23 May 2000 11:44:50 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11527 Received: (qmail 3595 invoked from network); 23 May 2000 11:44:50 -0000 Date: Tue, 23 May 2000 12:44:18 +0100 From: Peter Stephenson Subject: Re: complete (real C) tags In-reply-to: "Your message of Wed, 17 May 2000 16:57:44 -0000." <1000517165744.ZM18034@candle.brasslantern.com> To: zsh-workers@sunsite.auc.dk (Zsh hackers list) Message-id: <0FV000K1QGLUD7@la-la.cambridgesiliconradio.com> Content-transfer-encoding: 7BIT > Bart wrote: > 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' I've finally discovered why this doesn't work for me. First, $'...''...' is using RCQUOTES to interpolate a ' in the middle. I suspect this is wrong with $'...', since you can quote a single quote in that, but I'll take counsel before trying to fix it. Second, Solaris sed didn't seem to think much of the second pattern: it seems to want to remove the whole line. I've rewritten it as sed -ne 's/^\(.*[a-zA-Z_0-9]\)[[ '$'\t'':;,()]*'$'\177''.*$/\1/' \ -e 's/^.*[^a-zA-Z_0-9]//' \ -e '/^[a-zA-Z_].*/p' and this seems to do roughly what I want. Finally, I've noticed it's several *times* slower for a long tags list when going through _main_complete (see Sven's patch for _complete_tag in 11459) rather than just compadd, so I'm very tempted just to miss that out --- try it with a full `etags -t **/*.[ch]' TAGS file for zsh: I get less than a second with just compadd, something like five seconds with _main_complete (on a Sun Enterprise server, too). I suppose the problem is the huge array being constantly set and restored as it passes through the shell functions --- it may not have very much to do with completion as such, although I think that saves and restores some of its state when calling functions, too. -- Peter Stephenson Cambridge Silicon Radio, Unit 300, Science Park, Milton Road, Cambridge, CB4 0XL, UK Tel: +44 (0)1223 392070