3

Edit: Answered my own question.

In the past, when working with Emacs, C and etags, I was able to do M-. and find a function definition. But I could also do M-, and find all calls of that function. Very convenient.

I've recently started programming C with Emacs again. I've built a TAGS file with etags. I can use M-. but I can't use M-,. When I look into the TAGS file, I see that there are only lines for the function definitions. There is no information where all the calls to that function are.

So my suspicion is that I should build the TAGS file differently. But I've read the man-page for etags, and I can't find any options that might do what I want.

The only thing I could imagine is that the company where I worked in the past had a modified version of etags?

We had a coding convention that function-calls should always have a space between name and open-bracket. E.g. int my_function (int x){ and calls should never have a space there. E.g. x = my_function(1);. Could this be it ? Or is that unrelated ?

  • It's possible to use exuberant ctags ctags.sourceforge.net to get the effect you want. It has more options than etags. – InHarmsWay Jul 22 '15 at 4:06
2

I think I found the answer to my own question.
We were probably using GNU's idutils.
http://www.gnu.org/software/idutils/manual/idutils.html

This package allows you to use mkid to make an ID file, just like etags makes a TAGS file. Then you can use the gid utility to search for functions. All I now need to do is install mkid and gid, and try to remember how I can integrate the gid command in Emacs.

I hope this question might be useful in the future for others.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.