Commit b0c90851 authored by Dmitry Gutov's avatar Dmitry Gutov

Prompt before automatic generation for the first time

parent e93e1a6b
Pipeline #34 failed with stage
......@@ -2185,26 +2185,31 @@ for \\[find-tag] (which see)."
(defvar etags--project-tags-file nil)
(defvar etags--project-tags-root nil)
(defvar etags--project-confirmed-roots nil)
(defun etags--maybe-use-project-tags ()
(let (proj)
(let (proj root)
(when (and etags--project-tags-root
(not (file-in-directory-p default-directory
(when (and (not (or tags-file-name
(setq proj (project-current)))
(etags--project-tags-generate proj)
(setq proj (project-current))
(setq root (cl-find default-directory
(project-roots proj)
:test #'file-in-directory-p))
(or (member root etags--project-confirmed-roots)
(format "Generate tags table for %s automatically? " root))))
(cl-pushnew root etags--project-confirmed-roots)
(etags--project-tags-generate proj root)
;; Invalidate the scanned tags after any change is written to disk.
(add-hook 'after-save-hook #'etags--project-tags-cleanup)
(visit-tags-table etags--project-tags-file))))
(defun etags--project-tags-generate (proj)
(let* ((root (cl-find default-directory
(project-roots proj)
:test #'file-in-directory-p))
(default-directory root)
(defun etags--project-tags-generate (proj root)
(let* ((default-directory root)
(files (all-completions "" (project-file-completion-table proj (list root))))
(etags-command (executable-find "etags"))
;; FIXME: List all extensions, or wait for etags fix.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment