When the TAGS file is re-generated, and I try to visit tag in Emacs (M-.), Emacs asks me if I really want to re-read that file:
Tags file /path/to/TAGS has changed, read new contents? (yes or no)
And I have to enter yes
every time. Not very convenient (M-. Enter y e s Enter are 7 keys to press against only 2 in Vim).
How can I configure Emacs to read the updated TAGS silently, without asking?
By default, it points to the file you're currently on, so you can just type C-x C-v RET to reload your file.
The emacs editors can use the index file(s) produced by etags to search for a requested function name, defined name, or global variable, etc. Each of these search names are referred to as a tag. If the tag is found in the index, it will open the file containing the searched for tag in a new buffer.
(setq tags-revert-without-query 1)
Edit: before finding the above answer, I suggested adding this line:
(defalias 'yes-or-no-p 'y-or-n-p)
to .emacs
file, because every time you're asked if you want to reread that file, you'll just have to hit 'y' if you prefer not to use tags-revert-without-query
. In that case, M-. y is just one keystroke more than Vim.
I'll leave that information here in case somebody finds it useful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With