zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: ctags tag completion
@ 2005-06-08  4:00 Doug Kearns
  2005-06-09 12:39 ` Doug Kearns
  0 siblings, 1 reply; 5+ messages in thread
From: Doug Kearns @ 2005-06-08  4:00 UTC (permalink / raw)
  To: zsh-workers

This adds completion for ctags tags which will also be useful for vi(m)
completion when I get around to tidying it up.

Regards,
Doug


Index: Completion/Unix/Command/_less
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_less,v
retrieving revision 1.1
diff -u -r1.1 _less
--- Completion/Unix/Command/_less	1 Mar 2004 12:22:52 -0000	1.1
+++ Completion/Unix/Command/_less	8 Jun 2005 07:30:56 -0000
@@ -103,7 +103,7 @@
       if (( $+LESSGLOBALTAGS )); then
         _global_tags
       else
-        _message -e ctags tag
+        _ctags
       fi
     ;;
   esac
Index: Completion/Unix/Type/_ctags
===================================================================
RCS file: Completion/Unix/Type/_ctags
diff -N Completion/Unix/Type/_ctags
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ Completion/Unix/Type/_ctags	8 Jun 2005 07:30:58 -0000
@@ -0,0 +1,7 @@
+#autoload
+
+local expl tags
+
+[[ -r tags ]] && tags=( ${${${(f)"$(< tags)"}:#!*}%%[[:blank:]]*} )
+
+_wanted ctags expl 'tag' compadd -M 'm:{a-zA-Z}={A-Za-z}' -a "$@" - tags


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH: ctags tag completion
  2005-06-08  4:00 PATCH: ctags tag completion Doug Kearns
@ 2005-06-09 12:39 ` Doug Kearns
  2005-06-09 13:07   ` Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: Doug Kearns @ 2005-06-09 12:39 UTC (permalink / raw)
  To: zsh-workers

On Wed, Jun 08, 2005 at 02:00:00PM +1000, Doug Kearns wrote:
> This adds completion for ctags tags which will also be useful for vi(m)
> completion when I get around to tidying it up.

Should this be called _ctags_tags, or something else, given that someone
might want to write Command/_ctags to complete the ctags command itself?

Regards,
Doug


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH: ctags tag completion
  2005-06-09 12:39 ` Doug Kearns
@ 2005-06-09 13:07   ` Peter Stephenson
  2005-06-10 14:08     ` Doug Kearns
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Stephenson @ 2005-06-09 13:07 UTC (permalink / raw)
  To: zsh-workers

Doug Kearns wrote:
> On Wed, Jun 08, 2005 at 02:00:00PM +1000, Doug Kearns wrote:
> > This adds completion for ctags tags which will also be useful for vi(m)
> > completion when I get around to tidying it up.
> 
> Should this be called _ctags_tags, or something else, given that someone
> might want to write Command/_ctags to complete the ctags command itself?

Yes, that would make sense.

By the way, when I had a completion for etags a while ago, I made
it search back up the directory tree for a TAGS file, since I tend to
tag everything in a project in a single file.  That might be a useful
enhancement.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

**********************************************************************


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH: ctags tag completion
  2005-06-09 13:07   ` Peter Stephenson
@ 2005-06-10 14:08     ` Doug Kearns
  2005-06-10 14:46       ` Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: Doug Kearns @ 2005-06-10 14:08 UTC (permalink / raw)
  To: zsh-workers

On Thu, Jun 09, 2005 at 02:07:55PM +0100, Peter Stephenson wrote:

<snip>
 
> By the way, when I had a completion for etags a while ago, I made
> it search back up the directory tree for a TAGS file, since I tend to
> tag everything in a project in a single file.  That might be a useful
> enhancement.
 
Do programs using etags not require the TAGS file to be in the cwd?

Less is the only command I know of that will allow use, from the
commandline, of a ctags tags file not in the cwd and that only works if
the paths in the file are absolute - generally they're not.

Regards,
Doug


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH: ctags tag completion
  2005-06-10 14:08     ` Doug Kearns
@ 2005-06-10 14:46       ` Peter Stephenson
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Stephenson @ 2005-06-10 14:46 UTC (permalink / raw)
  To: Zsh hackers list

Doug Kearns wrote:
> Do programs using etags not require the TAGS file to be in the cwd?

Emacs is perfectly happy wherever the TAGS file is.  The file contains
the path to each file as it is found, so if you run

etags **/*.[ch]

you get file names like top/middle/bottom/file.c which get combined
with the directory that has the TAGS file.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

**********************************************************************


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-06-10 14:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-08  4:00 PATCH: ctags tag completion Doug Kearns
2005-06-09 12:39 ` Doug Kearns
2005-06-09 13:07   ` Peter Stephenson
2005-06-10 14:08     ` Doug Kearns
2005-06-10 14:46       ` Peter Stephenson

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).