From: Peter Stephenson <pws@cambridgesiliconradio.com>
To: zsh-workers@sunsite.auc.dk (Zsh hackers list)
Subject: Re: complete (real C) tags
Date: Tue, 23 May 2000 12:44:18 +0100 [thread overview]
Message-ID: <0FV000K1QGLUD7@la-la.cambridgesiliconradio.com> (raw)
In-Reply-To: "Your message of Wed, 17 May 2000 16:57:44 -0000." <1000517165744.ZM18034@candle.brasslantern.com>
> 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 <pws@cambridgesiliconradio.com>
Cambridge Silicon Radio, Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK Tel: +44 (0)1223 392070
next prev parent reply other threads:[~2000-05-23 11:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-05-17 14:54 Peter Stephenson
2000-05-17 16:57 ` Bart Schaefer
2000-05-23 11:44 ` Peter Stephenson [this message]
2000-05-24 15:34 ` PATCH: RC_QUOTES Peter Stephenson
2000-05-24 15:52 ` Bart Schaefer
2000-05-24 16:16 ` Peter Stephenson
2000-05-23 12:33 complete (real C) tags Sven Wischnowsky
2000-05-23 12:56 ` Peter Stephenson
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=0FV000K1QGLUD7@la-la.cambridgesiliconradio.com \
--to=pws@cambridgesiliconradio.com \
--cc=zsh-workers@sunsite.auc.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).