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!
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...
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!
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?
>> 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
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!
The tags file used is set based on project hierarchy if I understand you
properly.
http://www.emacswiki.org/emacs/EtagsTable
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!
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
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!
> 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!
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!
[...]
> 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