Is it possible to auto-regenerate and load tags table in emacs rather than having to keep running visit-tags-table?

StackOverflow https://stackoverflow.com/questions/2550474

  •  23-09-2019
  •  | 
  •  

문제

I am trying to find a way to auto-regenerate tags for my application and visit those tags in emacs to try to improve my workflow. Is it possible to get emacs to detect changes in TAG file and re-visit it ?

도움이 되었습니까?

해결책

There is a tags setting:

(setq tags-revert-without-query t)

Which will tell tags functionality to re-visit the TAGS file if it changes on disk. This check happens every time you invoke a tags function.

다른 팁

Maybe not exactly what you're looking for, but I have a small function to regenerate and re-visit the tags table in the current working directory that I use all the time.

(defvar tags-cmd "etags -R 2>/dev/null")

(defun regen-tags ()
  "Regenerate the tags file for the current working directory"
  (interactive)
  (let ((tag-file (concat default-directory "TAGS")))
    (shell-command tags-cmd)
    (visit-tags-table tag-file)))
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top