30

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?

1 Answer 1

45
(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.

Sign up to request clarification or add additional context in comments.

7 Comments

Thank you. Some questions which require yes-or-no are serious. I'd prefer not to enable <kbd>y</kbd> for all of them.
@jetxee: Yes, you're right. Sometimes it can be dangerous. Forces you to read before you hit a key :-) I've updated my answer with one possible solution to your problem. Is that what you needed?
Can't vote for the answer with that defalias call, the edit (IMO) should have removed everything above the Edit: line.
Thank you. tags-revert-without-query is what I need.
Thank you for this. Before I found this I was going crazy. I kept not noticing the prompt, going on to do something else, only to get hit with an unexpected "Command attempted to use minibuffer while in minibuffer" error later. For example, I would not notice that Emacs had displayed the prompt, then try to open a file while it was displayed.
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.