all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* help with tags
@ 2003-07-30 14:00 Javier Oviedo
  2003-07-30 15:11 ` Kai Großjohann
  0 siblings, 1 reply; 8+ messages in thread
From: Javier Oviedo @ 2003-07-30 14:00 UTC (permalink / raw)


Hello all:

I want to create some sort of C-project that lets me jump to
function/variable/#define/structure definitions from within c-code. I know
that this must be an incredibly common request.

I've looked at tags in the emacs manual. It says to use etags to accomplish
this. I guess that  I would have to run this on every directory manually and
update it when I modify files.

Is there some utility that will let me automatically create this kind of
tag/project system given some path? Ideally it would support the following
functionality:

1. Given a root dir, it would add all sub-directories(and files within) to
this project.
2. It would auto-update tags tables when/if a file is modified.

I'm not sure if this is asking too much, but please let me know if there is
anything that performs some or all of these features. Thanks in advance!

--
Javier

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

* Re: help with tags
  2003-07-30 14:00 help with tags Javier Oviedo
@ 2003-07-30 15:11 ` Kai Großjohann
  2003-07-30 20:28   ` Javier Oviedo
                     ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Kai Großjohann @ 2003-07-30 15:11 UTC (permalink / raw)


"Javier Oviedo" <email_joviedo@yahoo.com> writes:

> Is there some utility that will let me automatically create this kind of
> tag/project system given some path? Ideally it would support the following
> functionality:
>
> 1. Given a root dir, it would add all sub-directories(and files within) to
> this project.
> 2. It would auto-update tags tables when/if a file is modified.
>
> I'm not sure if this is asking too much, but please let me know if there is
> anything that performs some or all of these features. Thanks in advance!

I think you have to do it manually, but make is your friend.

    rm TAGS; touch TAGS
    find . -name '*.[hc]' -print | xargs etags -a

These commands add all *.h and *.c files to the TAGS file.  You need
to rerun them whenever something big has changed.  So you could just
add these commands to your normal build process, for instance.  After
all, if something big has changed, you're going to build the program
anyway to check if it still works...

Note that small modifications are not a problem -- M-. is smart
enough to look around if the position information in TAGS is slightly
off.

You might also like the Emacs Code Browser and the Semantic
Bovinator.  The latter has some code parsers which give you tags-like
functionality, and the former provides a GUI.

Also, see M-x speedbar RET and also M-x imenu RET.  I use M-x imenu
RET a lot to jump around in the same file.
-- 
~/.signature

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

* Re: help with tags
  2003-07-30 15:11 ` Kai Großjohann
@ 2003-07-30 20:28   ` Javier Oviedo
  2003-07-31 17:02     ` Kai Großjohann
  2003-07-31  6:43   ` Eli Zaretskii
       [not found]   ` <mailman.754.1059630121.8231.help-gnu-emacs@gnu.org>
  2 siblings, 1 reply; 8+ messages in thread
From: Javier Oviedo @ 2003-07-30 20:28 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2170 bytes --]

I use imenu as well for looking within a current file. Speedbar was kind of
cool, but it does not support the capabilities that I mentioned...i would
have to use tags externally..

I think that I'll give your etags method a chance. Would still have to do
this for every sub-directory or does your 'find' method do this recursively?

Has anyone ever tried to make something like I was originally looking for? I
think that it would most naturally fit into ecb...instead of running the
tags externally, build in the feature to ecb.

Thanks.

--
Javier


"Kai Großjohann" <kai.grossjohann@gmx.net> wrote in message
news:844r146ock.fsf@slowfox.is.informatik.uni-duisburg.de...
> "Javier Oviedo" <email_joviedo@yahoo.com> writes:
>
> > Is there some utility that will let me automatically create this kind of
> > tag/project system given some path? Ideally it would support the
following
> > functionality:
> >
> > 1. Given a root dir, it would add all sub-directories(and files within)
to
> > this project.
> > 2. It would auto-update tags tables when/if a file is modified.
> >
> > I'm not sure if this is asking too much, but please let me know if there
is
> > anything that performs some or all of these features. Thanks in advance!
>
> I think you have to do it manually, but make is your friend.
>
>     rm TAGS; touch TAGS
>     find . -name '*.[hc]' -print | xargs etags -a
>
> These commands add all *.h and *.c files to the TAGS file.  You need
> to rerun them whenever something big has changed.  So you could just
> add these commands to your normal build process, for instance.  After
> all, if something big has changed, you're going to build the program
> anyway to check if it still works...
>
> Note that small modifications are not a problem -- M-. is smart
> enough to look around if the position information in TAGS is slightly
> off.
>
> You might also like the Emacs Code Browser and the Semantic
> Bovinator.  The latter has some code parsers which give you tags-like
> functionality, and the former provides a GUI.
>
> Also, see M-x speedbar RET and also M-x imenu RET.  I use M-x imenu
> RET a lot to jump around in the same file.
> --
> ~/.signature

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

* Re: help with tags
  2003-07-30 15:11 ` Kai Großjohann
  2003-07-30 20:28   ` Javier Oviedo
@ 2003-07-31  6:43   ` Eli Zaretskii
       [not found]   ` <mailman.754.1059630121.8231.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2003-07-31  6:43 UTC (permalink / raw)


> From: kai.grossjohann@gmx.net (=?iso-8859-1?q?Kai_Gro=DFjohann?=)
> Newsgroups: gnu.emacs.help
> Date: Wed, 30 Jul 2003 17:11:55 +0200
> 
>     find . -name '*.[hc]' -print | xargs etags -a

The "xargs" part is not necessary; the following will do:

      find . -name '*.[hc]' -print | etags -

This variant has the advantage of not requiring `xargs', which might
be a problem on non-Posix platforms.  It is also faster.

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

* Re: help with tags
  2003-07-30 20:28   ` Javier Oviedo
@ 2003-07-31 17:02     ` Kai Großjohann
  0 siblings, 0 replies; 8+ messages in thread
From: Kai Großjohann @ 2003-07-31 17:02 UTC (permalink / raw)


"Javier Oviedo" <email_joviedo@yahoo.com> writes:

> I think that I'll give your etags method a chance. Would still have to do
> this for every sub-directory or does your 'find' method do this recursively?

Yes, find recurses.  That's the good thing about find :-)

-- 
~/.signature

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

* Re: help with tags
       [not found]   ` <mailman.754.1059630121.8231.help-gnu-emacs@gnu.org>
@ 2003-08-01 14:00     ` Javier Oviedo
  2003-08-01 15:41       ` Dan Katz
  0 siblings, 1 reply; 8+ messages in thread
From: Javier Oviedo @ 2003-08-01 14:00 UTC (permalink / raw)


Thanks guys. I have another query about tags.

In my particular project we support multiple hw platforms. There are high
level C calls that are common between platforms but will call different
versions of the same function(same name). This is done based upon what the
target platform we are currently building for with the linker linking the
correct function for us....In other words, the same function name may exist
in multiple sub-directories. This would also apply to #defines, structures,
etc. Can tags handle this in an intelligent fashion while still keeping one
common tag file?

Currently, when I do find-tag, it stops on the first occurrence it finds in
the tag table. It would be nice if I could run a command that would go to
the next occurrence in the tag table. Does that make any sense? This way I
could cycle until I find the definition/construct that matches my current
platform.

I hope this wasn't too wordy. Thanks!

--
Javier


"Eli Zaretskii" <eliz@elta.co.il> wrote in message
news:mailman.754.1059630121.8231.help-gnu-emacs@gnu.org...
> > From: kai.grossjohann@gmx.net (=?iso-8859-1?q?Kai_Gro=DFjohann?=)
> > Newsgroups: gnu.emacs.help
> > Date: Wed, 30 Jul 2003 17:11:55 +0200
> >
> >     find . -name '*.[hc]' -print | xargs etags -a
>
> The "xargs" part is not necessary; the following will do:
>
>       find . -name '*.[hc]' -print | etags -
>
> This variant has the advantage of not requiring `xargs', which might
> be a problem on non-Posix platforms.  It is also faster.
>
>
>

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

* Re: help with tags
  2003-08-01 14:00     ` Javier Oviedo
@ 2003-08-01 15:41       ` Dan Katz
  0 siblings, 0 replies; 8+ messages in thread
From: Dan Katz @ 2003-08-01 15:41 UTC (permalink / raw)


On Fri, 1 Aug 2003, Javier Oviedo wrote:

> Currently, when I do find-tag, it stops on the first occurrence it
> finds in the tag table. It would be nice if I could run a command
> that would go to the next occurrence in the tag table.

As the help for the find-tag function states (C-h f find-tag):

    If second arg NEXT-P is t (interactively, with prefix arg), search
    for another tag that matches the last tagname or regexp used.

The prefix arg (a.k.a. the universal arg) is usually bound to C-u.  So
your session might look like this (for default key bindings):

M-. foo<RET>                   ; Find the first 'foo' tag
C-u M-.                        ; Goto the next one


Is this what you're looking for?

Dan

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

* Help with tags
@ 2013-08-27 12:59 Glen Stark
  0 siblings, 0 replies; 8+ messages in thread
From: Glen Stark @ 2013-08-27 12:59 UTC (permalink / raw)
  To: help-gnu-emacs

I've been using ggtags with gnu-global for a while now, and been pretty 
happy.  Recently we moved some external dependencies outside of the 
source tree however and I can't figure out how to use them.

Lets say I have two source trees:

/usr/local/external_libs

and

~/my_project

I use emacs on the files in the source tree in my_project, but I'd like 
to be able to follow tags to files in /usr/local/external_libs.

How do I go about doing that?

Thanks very much,

Glen



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

end of thread, other threads:[~2013-08-27 12:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-07-30 14:00 help with tags Javier Oviedo
2003-07-30 15:11 ` Kai Großjohann
2003-07-30 20:28   ` Javier Oviedo
2003-07-31 17:02     ` Kai Großjohann
2003-07-31  6:43   ` Eli Zaretskii
     [not found]   ` <mailman.754.1059630121.8231.help-gnu-emacs@gnu.org>
2003-08-01 14:00     ` Javier Oviedo
2003-08-01 15:41       ` Dan Katz
  -- strict thread matches above, loose matches on Subject: below --
2013-08-27 12:59 Help " Glen Stark

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.