Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TAGS for multiply project.

4 views
Skip to first unread message

Oleksandr Gavenko

unread,
Jul 22, 2010, 5:32:01 PM7/22/10
to help-gn...@gnu.org
Usually I work on two source hierarchy simultaneously
(one working and one as example code or copy of working
for small fixes, testing, experimenting).

It is essential have "goto definition" feature in both
hierarchies.

Etags/Exuberant Ctags/GNU GLOBAL allow
this for single project and I actively use Etags.

But in case of Etags when I switch to another project
I need reset tag buffer.

It is possible working simultaneously on
different source hierarchy with TAGS easy?

I like solution that function like:

I press M-.

Emacs get visited file path: /path/to/proj1/subdir/file.c
and search for TAGS file in: /path/to/proj1/subdir,
/path/to/proj1, /path/to, /path sequentially.

With first TAGS occurrence Emacs do search in TAGS
for identifier and go to its definition.

For me easy put TAGS file on top of source hierarchy,
so in this case prompt for TAGS path avoided.

If 'find-tag' still have usable performance I will be happy!!!

--
Best regards!


Andrea Crotti

unread,
Jul 22, 2010, 6:28:19 PM7/22/10
to help-gn...@gnu.org

[...]

Well I think that with semantic you could get something like this.
In C for example once you set up correctly your include path then you
can jump to the definition of anything you want from whatever symbol...


Scott Frazer

unread,
Jul 23, 2010, 9:28:03 AM7/23/10
to

I use (and wrote) this:

http://www.emacswiki.org/emacs/EtagsTable

Scott

Oleksandr Gavenko

unread,
Jul 23, 2010, 3:36:38 PM7/23/10
to help-gn...@gnu.org
Thx for replay. I try use Semantic.

I like some it feture, so put into .emacs:

(semantic-mode 1)
(global-semantic-idle-summary-mode 1)
(global-semantic-highlight-func-mode 1)

I have 2 question about semantic.

How can a go back after "C-c , J" (semantic-complete-jump)
like "M-*" (pop-tag-mark) for TAGS?

How can I tell where lies system header, so I can see
identifier types by 'global-semantic-idle-summary-mode' and
jump to definition by 'semantic-complete-jump'?

I try:

(mapc (lambda (item) (semantic-add-system-include item))
'(
"C:/Program Files/Microsoft Visual Studio 9.0/VC/ATLMFC/INCLUDE"
"C:/Program Files/Microsoft Visual Studio 9.0/VC/INCLUDE"
"C:/Program Files/Microsoft SDKs/Windows/v6.1/include"
))

but seems this must be evaluated per buffer (not work globally).

--
Best regards!


Andrea Crotti

unread,
Jul 23, 2010, 4:11:06 PM7/23/10
to help-gn...@gnu.org
> I like some it feture, so put into .emacs:
>
> (semantic-mode 1)
> (global-semantic-idle-summary-mode 1)
> (global-semantic-highlight-func-mode 1)
>
> I have 2 question about semantic.
>
> How can a go back after "C-c , J" (semantic-complete-jump)
> like "M-*" (pop-tag-mark) for TAGS?
>

Good question, I never asked myself since C-x b RET gets me back to the
original file, but it would be nice to have something like that.
More nice would be open the buffer in a different window because
normally that's what I want...

>
> I try:
>
> (mapc (lambda (item) (semantic-add-system-include item))
> '(
> "C:/Program Files/Microsoft Visual Studio 9.0/VC/ATLMFC/INCLUDE"
> "C:/Program Files/Microsoft Visual Studio 9.0/VC/INCLUDE"
> "C:/Program Files/Microsoft SDKs/Windows/v6.1/include"
> ))
>
> but seems this must be evaluated per buffer (not work globally).

Mm reading the documentation is exactly what they wanted.
And I think it actually makes sense somehow since you might need
different include paths for different projects.

I didn't see either how to do it globally, but there must be some way.
$INCLUDEPATH maybe?


Štěpán Němec

unread,
Jul 24, 2010, 4:48:58 AM7/24/10
to Andrea Crotti, help-gn...@gnu.org
Andrea Crotti <andrea....@gmail.com> writes:

>> How can a go back after "C-c , J" (semantic-complete-jump)
>> like "M-*" (pop-tag-mark) for TAGS?
>>
>
> Good question, I never asked myself since C-x b RET gets me back to the
> original file, but it would be nice to have something like that.
> More nice would be open the buffer in a different window because
> normally that's what I want...

I never used Semantic, but one would expect that `pop-global-mark' (C-x
C-SPC by default) will do what you want.

Štěpán

Oleksandr Gavenko

unread,
Jul 24, 2010, 5:05:13 PM7/24/10
to help-gn...@gnu.org
Interesting command, but it seems not working as 'pop-tag-mark'.

For example I visit .el file mark position, visit .cxx
file, go to definition of local function by "C-c , j"
and try go back by "C-x C-SPC". Sadly switched to .el buffer.

--
Best regards!


Richard Riley

unread,
Jul 24, 2010, 6:46:02 PM7/24/10
to help-gn...@gnu.org
Oleksandr Gavenko <gave...@gmail.com> writes:


The tags file used is set based on project hierarchy if I understand you
properly.

http://www.emacswiki.org/emacs/EtagsTable


Oleksandr Gavenko

unread,
Jul 25, 2010, 4:04:43 AM7/25/10
to help-gn...@gnu.org
Many thanks to Richard Riley.

With

(require 'etags-table)
(setq etags-table-search-up-depth 1)

Emacs automatically search for TAGS file starting
from current directory and go up until found.

This allow use TAGS for multiply project
by building TAGS file on the root of each project.

And performance is good (need no more than second time wait
when go to definition).

'semantic' I also will be use for 'global-semantic-idle-summary-mode'
but I don't want replace TAGS with it
as I know how TAGS works and with etags/ctags I can
easy parse new file type based on regexp
(no need for elisp programming).

'etags-table.el' have only 100 line of elist.
Why do not include it into official Emacs?

Automatic TAGS search up depth very useful feature.

--
Best regards!


Thierry Volpiatto

unread,
Jul 25, 2010, 4:23:07 AM7/25/10
to help-gn...@gnu.org
Oleksandr Gavenko <gave...@gmail.com> writes:

See also:
http://www.emacswiki.org/emacs/download/anything-etags.el

--
Thierry Volpiatto
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997


Oleksandr Gavenko

unread,
Jul 25, 2010, 12:19:57 PM7/25/10
to help-gn...@gnu.org
On 2010-07-23 23:11, Andrea Crotti wrote:
>> I like some it feture, so put into .emacs:
>>
>> (semantic-mode 1)
>> (global-semantic-idle-summary-mode 1)
>> (global-semantic-highlight-func-mode 1)
>>
>> I have 2 question about semantic.
>>
>> How can a go back after "C-c , J" (semantic-complete-jump)
>> like "M-*" (pop-tag-mark) for TAGS?
>>
>
> Good question, I never asked myself since C-x b RET gets me back to the
> original file, but it would be nice to have something like that.
> More nice would be open the buffer in a different window because
> normally that's what I want...
>
C-x b RET good work if you goto header prototype.
Really you just see it and back.

But if you go to implementation and try understand it
you also may want goto implemetation of called function,
return, read more, goto, return, read more ...
and finally return into original place.

In that case Emacs MUST organize list of jumps
and function which can binding to keys
to get easy return in original place.

Visual Studio, NetBeans, Eclipce, IAR Embedded Workbench
and many other IDE remember all jumps and allow
browse backward/forward like Firefox/Opera/Chrome
for links.

Really no one need this feature or it implemented?

--
Best regards!


Richard Riley

unread,
Jul 25, 2010, 12:39:32 PM7/25/10
to help-gn...@gnu.org
Thierry Volpiatto <thierry....@gmail.com> writes:

> Oleksandr Gavenko <gave...@gmail.com> writes:
>
>> On 2010-07-25 1:46, Richard Riley wrote:
>>> Oleksandr Gavenko<gave...@gmail.com> writes:
>>>
>>>> On 2010-07-24 11:48, Štěpán Němec wrote:
>>>>> Andrea Crotti<andrea....@gmail.com> writes:
>>>>>

>>>>>>> How can a go back after "C-c , J" (semantic-complete-jump)
>>>>>>> like "M-*" (pop-tag-mark) for TAGS?
>>>>>>>
>>>>>>
>>>>>> Good question, I never asked myself since C-x b RET gets me back to the
>>>>>> original file, but it would be nice to have something like that.
>>>>>> More nice would be open the buffer in a different window because
>>>>>> normally that's what I want...
>>>>>

I tend to find "anything" pretty much overkill for something as "quickly
interactive" as tag hopping. Id love to see a video capture of you using
anything in a programming environment!

Oleksandr Gavenko

unread,
Jul 25, 2010, 2:53:13 PM7/25/10
to help-gn...@gnu.org
On 2010-07-25 19:19, Oleksandr Gavenko wrote:
> On 2010-07-23 23:11, Andrea Crotti wrote:
>>> I like some it feture, so put into .emacs:
>>>
>>> (semantic-mode 1)
>>> (global-semantic-idle-summary-mode 1)
>>> (global-semantic-highlight-func-mode 1)
>>>
>>> I have 2 question about semantic.
>>>
>>> How can a go back after "C-c , J" (semantic-complete-jump)
>>> like "M-*" (pop-tag-mark) for TAGS?
>>>
>>
>> Good question, I never asked myself since C-x b RET gets me back to the
>> original file, but it would be nice to have something like that.
>> More nice would be open the buffer in a different window because
>> normally that's what I want...
>>
> C-x b RET good work if you goto header prototype.
> Really you just see it and back.
>
> But if you go to implementation and try understand it
> you also may want goto implemetation of called function,
> return, read more, goto, return, read more ...
> and finally return into original place.
>
> In that case Emacs MUST organize list of jumps
> and function which can binding to keys
> to get easy return in original place.
>
> Visual Studio, NetBeans, Eclipce, IAR Embedded Workbench
> and many other IDE remember all jumps and allow
> browse backward/forward like Firefox/Opera/Chrome
> for links.
>
> Really no one need this feature or it implemented?
>
Eric M. Ludlam answer me in emacs.semantic:

http://article.gmane.org/gmane.emacs.semantic/2449

Seems his solution useful but I have trouble with
C-x B key binding, which defined in mru-bookmark.el:

(define-key km "\C-xB" 'semantic-mrub-switch-tags)

It was hidden by iswitchb.el:

(global-set-key "\C-xb" 'iswitchb-buffer)

C-h k C-x B say:

C-x b (***translated from*** C-x B) runs the command iswitchb-buffer

What mean marked by * text?

--
Best regards!


Štěpán Němec

unread,
Jul 25, 2010, 3:49:31 PM7/25/10
to Oleksandr Gavenko, help-gn...@gnu.org
Oleksandr Gavenko <gave...@gmail.com> writes:

[...]

> http://article.gmane.org/gmane.emacs.semantic/2449
>
> Seems his solution useful but I have trouble with
> C-x B key binding, which defined in mru-bookmark.el:
>
> (define-key km "\C-xB" 'semantic-mrub-switch-tags)
>
> It was hidden by iswitchb.el:
>
> (global-set-key "\C-xb" 'iswitchb-buffer)
>
> C-h k C-x B say:
>
> C-x b (***translated from*** C-x B) runs the command iswitchb-buffer
>
> What mean marked by * text?

It means what it says :-P
When Emacs does not find a binding for a shifted key, it translates it
to the unshifted variant and gives you that. So the message indicates
you *don't* really have anything bound to C-x B (or it is a bug, but I
haven't heard about that one yet (and such bindings have always worked
for me) so I tend to assume it's the former).

HTH,

Štěpán

0 new messages