zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: Peter Stephenson <pws@cambridgesiliconradio.com>,
	zsh-workers@sunsite.auc.dk (Zsh hackers list)
Subject: Re: complete (real C) tags
Date: Wed, 17 May 2000 16:57:44 +0000	[thread overview]
Message-ID: <1000517165744.ZM18034@candle.brasslantern.com> (raw)
In-Reply-To: <0FUP001EMLEECG@la-la.cambridgesiliconradio.com>

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


  reply	other threads:[~2000-05-17 16:58 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 [this message]
2000-05-23 11:44   ` Peter Stephenson
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=1000517165744.ZM18034@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=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).