unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Location-aware tags?
@ 2012-04-09 16:53 Lars Magne Ingebrigtsen
  2012-04-09 19:01 ` Lars Magne Ingebrigtsen
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Lars Magne Ingebrigtsen @ 2012-04-09 16:53 UTC (permalink / raw)
  To: emacs-devel

It's possible that this functionality exists, and I'm just unaware of
it, but wouldn't it be nice if `M-.' could be location-aware instead of
global?

That is, if I'm in ~/src/emacs/emacs-24/lisp and I hit `M-.', it would
use the TAGS file in ~/src/emacs/emacs-24.  If I'm in
~/src/emacs/trunk/src, it would use the TAGS file in ~/src/emacs/trunk.
And so on.

Especially when dealing with branches that have (basically) the same
symbols, just adding more tags files to the search list doesn't help.
You can almost get away with it when you're editing totally separate
projects, but even then you're occasionally popped to the wrong place.

So I'm proposing to add a new variable `tags-use-auto-tags' or
something, that would make `M-.' always look for the nearest TAGS file
upwards in the directory structure, and then switch to that file before
looking up the symbol.

Unless somebody has a better idea.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




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

* Re: Location-aware tags?
  2012-04-09 16:53 Location-aware tags? Lars Magne Ingebrigtsen
@ 2012-04-09 19:01 ` Lars Magne Ingebrigtsen
  2012-04-11  2:17   ` Chris Van Dusen
  2012-04-09 19:46 ` Tom Tromey
  2012-04-10  5:49 ` Stefan Reichör
  2 siblings, 1 reply; 6+ messages in thread
From: Lars Magne Ingebrigtsen @ 2012-04-09 19:01 UTC (permalink / raw)
  To: emacs-devel

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> So I'm proposing to add a new variable `tags-use-auto-tags' or
> something, that would make `M-.' always look for the nearest TAGS file
> upwards in the directory structure, and then switch to that file before
> looking up the symbol.

Even more super-magical would be if Emacs auto-generated the TAGS file,
if none could be found.  That is, if you `M-.' in a directory, and no
TAGS file can be found upwards, then it prompts you for where to
generate the file "from", generate it to /tmp/tmpTAGS, switch to it, and
delete the file.

That way Emacs would magically allow you to easily browse whatever
source tree you're inspecting without you having to have any particular
knowledge of the nitty-gritty going on behind the curtain.

(etags would be called with "find dir -type f | etags --output=/tmp/foo -"
or something, I guess.)

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




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

* Re: Location-aware tags?
  2012-04-09 16:53 Location-aware tags? Lars Magne Ingebrigtsen
  2012-04-09 19:01 ` Lars Magne Ingebrigtsen
@ 2012-04-09 19:46 ` Tom Tromey
  2012-04-10  5:49 ` Stefan Reichör
  2 siblings, 0 replies; 6+ messages in thread
From: Tom Tromey @ 2012-04-09 19:46 UTC (permalink / raw)
  To: emacs-devel

Lars> It's possible that this functionality exists, and I'm just unaware of
Lars> it, but wouldn't it be nice if `M-.' could be location-aware instead of
Lars> global?

Yeah.

It would be nice to also accommodate those of us who build outside of
srcdir, if that is possible.

Lars> That way Emacs would magically allow you to easily browse whatever
Lars> source tree you're inspecting without you having to have any particular
Lars> knowledge of the nitty-gritty going on behind the curtain.

Sounds nice.

This is a problem I tried to solve a couple of times.  Well, I tried to
solve a related problem -- auto-updating TAGS.

Once, a long time ago, I changed etags to record its arguments in TAGS.
Then when saving Emacs could re-run etags on just that file.

Another time I did something similar, but using inotify.

The first never went in, I don't remember why.  The second was not
really satisfactory, too slow for some reason.


You can sort of do this using CEDET now, although in my experience it
has been moderately buggy -- in earlier releases, unusuably so; with bzr
trunk Emacs, in a hard-to-characterize way causing random Emacs pauses.


In the end I just went back to GNU idutils instead.  Not quite as nice
as some IDE-ish solution, but workable.

Tom



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

* Re: Location-aware tags?
  2012-04-09 16:53 Location-aware tags? Lars Magne Ingebrigtsen
  2012-04-09 19:01 ` Lars Magne Ingebrigtsen
  2012-04-09 19:46 ` Tom Tromey
@ 2012-04-10  5:49 ` Stefan Reichör
  2 siblings, 0 replies; 6+ messages in thread
From: Stefan Reichör @ 2012-04-10  5:49 UTC (permalink / raw)
  To: emacs-devel

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> It's possible that this functionality exists, and I'm just unaware of
> it, but wouldn't it be nice if `M-.' could be location-aware instead of
> global?
>
> That is, if I'm in ~/src/emacs/emacs-24/lisp and I hit `M-.', it would
> use the TAGS file in ~/src/emacs/emacs-24.  If I'm in
> ~/src/emacs/trunk/src, it would use the TAGS file in ~/src/emacs/trunk.
> And so on.

etags-table provides such a functionality, see:
http://emacswiki.org/emacs/EtagsTable

> Especially when dealing with branches that have (basically) the same
> symbols, just adding more tags files to the search list doesn't help.
> You can almost get away with it when you're editing totally separate
> projects, but even then you're occasionally popped to the wrong place.
>
> So I'm proposing to add a new variable `tags-use-auto-tags' or
> something, that would make `M-.' always look for the nearest TAGS file
> upwards in the directory structure, and then switch to that file before
> looking up the symbol.
>
> Unless somebody has a better idea.


Stefan.




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

* Re: Location-aware tags?
  2012-04-09 19:01 ` Lars Magne Ingebrigtsen
@ 2012-04-11  2:17   ` Chris Van Dusen
  2012-04-16  2:07     ` Jonathan Rockway
  0 siblings, 1 reply; 6+ messages in thread
From: Chris Van Dusen @ 2012-04-11  2:17 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: emacs-devel

On Apr 9, 2012, at 2:01 PM, Lars Magne Ingebrigtsen wrote:

> Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
> 
>> So I'm proposing to add a new variable `tags-use-auto-tags' or
>> something, that would make `M-.' always look for the nearest TAGS file
>> upwards in the directory structure, and then switch to that file before
>> looking up the symbol.
> 
> Even more super-magical would be if Emacs auto-generated the TAGS file,
> if none could be found.  That is, if you `M-.' in a directory, and no
> TAGS file can be found upwards, then it prompts you for where to
> generate the file "from", generate it to /tmp/tmpTAGS, switch to it, and
> delete the file.
> 
> That way Emacs would magically allow you to easily browse whatever
> source tree you're inspecting without you having to have any particular
> knowledge of the nitty-gritty going on behind the curtain.
> 
> (etags would be called with "find dir -type f | etags --output=/tmp/foo -"
> or something, I guess.)
> 

gtags.el included in GNU Global provides some (if not most) of this functionality.

Chris.


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

* Re: Location-aware tags?
  2012-04-11  2:17   ` Chris Van Dusen
@ 2012-04-16  2:07     ` Jonathan Rockway
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Rockway @ 2012-04-16  2:07 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 662 bytes --]

On Tue, Apr 10, 2012 at 10:17 PM, Chris Van Dusen <cavandusen@gmail.com>wrote:

> > Even more super-magical would be if Emacs auto-generated the TAGS file,
> > if none could be found.  That is, if you `M-.' in a directory, and no
> > TAGS file can be found upwards, then it prompts you for where to
> > generate the file "from", generate it to /tmp/tmpTAGS, switch to it, and
> > delete the file.
>

Sorry to dig up a week-old thread, but I wrote something like this a few
months ago:

https://github.com/jrockway/eproject/blob/master/contrib/eproject-tags.el

I haven't used it a lot, but I thought I would mention it in case someone
is interested.

--jrockway

[-- Attachment #2: Type: text/html, Size: 1133 bytes --]

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

end of thread, other threads:[~2012-04-16  2:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-09 16:53 Location-aware tags? Lars Magne Ingebrigtsen
2012-04-09 19:01 ` Lars Magne Ingebrigtsen
2012-04-11  2:17   ` Chris Van Dusen
2012-04-16  2:07     ` Jonathan Rockway
2012-04-09 19:46 ` Tom Tromey
2012-04-10  5:49 ` Stefan Reichör

Code repositories for project(s) associated with this public inbox

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

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 read-only IMAP folder(s) and NNTP newsgroup(s).