简体   繁体   中英

How to make Emacs reload the TAGS file automatically?

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM