Emacs : problem with tags file?
Asked Answered
G

3

5

I am using ctags to create tags for my Emacs to read symbols from, using cygwin.

Emacs says "visit-tags-table-buffer: File /home/superman/tags is not a valid tags table"

here are my options to find files and generate tags.

$>find . -type f -regex '.*\.[hc]\|.*\.cpp' -print0 |
  xargs -0 ctags -e --extra=+q --fields=+fksaiS --c++-kinds=+px --append -f ~/tags
Greenlee answered 6/5, 2010 at 23:39 Comment(0)
L
6

I think "ctags" is the wrong program. (I'm not sure what it's for; I suspect it's obsolete).

Emacs should have come with a program called "etags"; use that instead.

Literary answered 7/5, 2010 at 6:22 Comment(4)
yep, after a lot of reading I think I am using the wrong one, I should be using Exuberant Ctags, and not the original Ctags. let me try and let you know. thanks :-) !Greenlee
for C/C++ I think, that gtags from GNU Global package is better (you also need to load gtags.el)Showy
Thanks @Peter ! RT@Alex - I did not know about gtags, will take a look, thanks a lot.Greenlee
Alex, it looks promising. are you using it, how do you like it?, I am just starting to use Emacs, so with your advice, I will switch to gtags. thanks a lot. let me know.Greenlee
L
2

I wrote a blog post on using etags with emacs that should help

Legalize answered 8/5, 2010 at 16:20 Comment(1)
this is cool ! I did it with cygwin. can you add another tag ("Using etags in Emacs with cygwin") for google to bump up this post ? this is really helpful and neat.Greenlee
G
1

Actually, I need to use Exuberant Ctags and not Ctags. I did not know that they were two different products.

So, DO NOT get Ctags from Cygwin's repository, instead go here Exuberant Ctags if you want to use it with Emacs. Ctags does not work with Emacs.

Greenlee answered 7/5, 2010 at 9:7 Comment(1)
The version of ctags in Cygwin is Exuberant CTags (see 'man ctags'). You can either run it as "ctags -e" or "etags" to get the correct behavior.Blackmarket

© 2022 - 2024 — McMap. All rights reserved.