How can I jump only to the exact function name with etags?
Question
I wanted to find the following function with etags:
dt()
but as I go through the tag table, I keep hitting functions with dt
in their names, like
widthThing1()
widthThing2()
...
making the definition of dt()
extremely difficult to find.
Is there some way to search only for the exact function that I'm searching for with etags?
Solution
Open up your TAGS file and see what it is actually indexing (which will vary by language, of course).
For instance, if the relevant entry looked like this:
function ds(^?6140,232332
Then you could use function ds(
(or potentially just ds(
) as your search term, to ensure that you weren't matching other functions.
You could omit the "function" part of that, except that typing SPC at the find-tag
prompt will invoke TAG completion. You could avoid that by typing C-qSPC instead, or alternatively utilise find-tag-regexp
bound to C-M-. which does not have the completion binding.
So C-M-.SPC ds(
RET might be convenient.
You may also want to look at the etags-select
library and binding M-. to etags-select-find-tag
, which I find provides a much better interface.
You can get that from the EmacsWiki, or Marmalade:
Packages like Icicles and Helm also provide alternative interfaces. You can start reading at http://emacswiki.org/emacs/EmacsTags