2

It would be convenient if I could arrange for visit-tags-table to open the TAGS file automatically with the correct syntax table for the language of the files being indexed in it. That way regular expressions would work the same way in the TAGS file as in the files indexed.

Does anyone know how to do that?

  • Hmm, I guess I could add " -- eval: (set-syntax-table coq-mode-syntax-table) --" to the first line of each tags file. – Dan Grayson Feb 28 '17 at 17:30
1

the list of tags is stored in tags-table-list, when you load a file, you know the full path of that file (C-h v buffer-file-name), so you can tweak tags-table-list by buffer-file-name and make it buffer local.

BTW, you need create individual TAGS for each language. For example, one TAGS for javascript, another TAGS for PHP. That's pretty easy if you follow the suggestion from Emacs manual (https://www.gnu.org/software/emacs/manual/html_node/emacs/Create-Tags-Table.html) by using Find and Ctags together because you can specify the file extension when scanning files.

You still need write a little bit Emacs Lisp code but https://github.com/redguardtoo/find-and-ctags help you write less code.

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.