etags-regen-mode: Handle TAGS buffer being killed
* lisp/progmodes/etags-regen.el (etags-regen--visit-table): Use kill-buffer-hook to ensure a refresh if the TAGS buffer is killed manually (bug#71727). (etags-regen--tags-cleanup): Bind the hook var to nil to avoid an infloop.
This commit is contained in:
parent
ef3f26ec02
commit
9331ab056a
1 changed files with 5 additions and 2 deletions
|
@ -294,7 +294,9 @@ File extensions to generate the tags for."
|
|||
(add-hook 'before-save-hook #'etags-regen--mark-as-new)
|
||||
(setq etags-regen--tags-file tags-file
|
||||
etags-regen--tags-root root)
|
||||
(visit-tags-table etags-regen--tags-file))
|
||||
(visit-tags-table etags-regen--tags-file)
|
||||
(with-current-buffer (get-file-buffer tags-file)
|
||||
(add-hook 'kill-buffer-hook #'etags-regen--tags-cleanup nil t)))
|
||||
|
||||
(defun etags-regen--ctags-p ()
|
||||
(string-search "Ctags"
|
||||
|
@ -390,7 +392,8 @@ File extensions to generate the tags for."
|
|||
|
||||
(defun etags-regen--tags-cleanup ()
|
||||
(when etags-regen--tags-file
|
||||
(let ((buffer (get-file-buffer etags-regen--tags-file)))
|
||||
(let ((buffer (get-file-buffer etags-regen--tags-file))
|
||||
kill-buffer-hook)
|
||||
(and buffer
|
||||
(kill-buffer buffer)))
|
||||
(tags-reset-tags-tables)
|
||||
|
|
Loading…
Add table
Reference in a new issue