parent
1ea8b66a39
commit
63c0510a05
1 changed files with 25 additions and 6 deletions
|
@ -5,22 +5,41 @@
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(require 'dash)
|
(require 'dash)
|
||||||
|
(defun lean-tags-table-list ()
|
||||||
|
(let* ((lean-path-env-list
|
||||||
|
(parse-colon-path (getenv "LEAN_PATH")))
|
||||||
|
(lean--path-list
|
||||||
|
(parse-colon-path
|
||||||
|
(ignore-errors
|
||||||
|
(car (process-lines (lean-get-executable lean-executable-name)
|
||||||
|
"--path")))))
|
||||||
|
(lean-path-list
|
||||||
|
(-uniq (append lean-path-env-list lean--path-list)))
|
||||||
|
(tags-file-list
|
||||||
|
(-non-nil
|
||||||
|
(--map (let ((tags-file (concat (file-name-as-directory it)
|
||||||
|
"TAGS")))
|
||||||
|
(if (file-exists-p tags-file)
|
||||||
|
tags-file
|
||||||
|
nil))
|
||||||
|
lean-path-list))))
|
||||||
|
tags-file-list))
|
||||||
|
|
||||||
(defun lean-generate-tags ()
|
(defun lean-generate-tags ()
|
||||||
"Run linja TAGS and let emacs use the generated TAGS file."
|
"Run linja TAGS and let emacs use the generated TAGS file."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((ltags-file-name (lean-get-executable "linja"))
|
(let ((ltags-file-name (lean-get-executable "linja"))
|
||||||
tags-file-name)
|
tags-file)
|
||||||
(message "Generating TAGS...")
|
(message "Generating TAGS...")
|
||||||
(apply 'call-process
|
(apply 'call-process
|
||||||
(append `(,ltags-file-name nil "*lean-tags*" nil)
|
(append `(,ltags-file-name nil "*lean-tags*" nil)
|
||||||
lean-flycheck-checker-options
|
lean-flycheck-checker-options
|
||||||
'("TAGS")))
|
'("TAGS")))
|
||||||
(message "TAGS generated."))
|
(message "TAGS generated.")
|
||||||
(unless tags-table-list
|
(setq tags-table-list (lean-tags-table-list))
|
||||||
(setq tags-file-name (lean-find-file-upward "TAGS"))
|
(setq tags-file (lean-find-file-upward "TAGS"))
|
||||||
(when tags-file-name
|
(when tags-file
|
||||||
(visit-tags-table tags-file-name))))
|
(add-to-list 'tags-table-list tags-file))))
|
||||||
|
|
||||||
(defmacro lean-tags-make-advice-to-call-ltags (f)
|
(defmacro lean-tags-make-advice-to-call-ltags (f)
|
||||||
(let* ((f-name (symbol-name f))
|
(let* ((f-name (symbol-name f))
|
||||||
|
|
Loading…
Reference in a new issue