|
121 | 121 | (citre-use-project-root-when-creating-tags t)
|
122 | 122 | :init
|
123 | 123 | (defvar +citre-recursive-root-project-detection-files '(".tags/" ".repo/" ".citre_root"))
|
| 124 | + (defvar +citre-gtags-recursive-files-list t) |
| 125 | + (defvar +citre-gtags-files-list-suffixes '("*.[chly]" "*.[ch]xx" "*.[ch]pp" "*.[ch]++" "*.cc" "*.hh")) |
| 126 | + (defvar +citre-gtags-files-list-ignored-directories '("CVS" "RCS" "SCCS" ".git" ".hg" ".bzr" ".cdv" ".pc" ".svn" "_MTN" "_darcs" "_sgbak" "debian")) |
124 | 127 | :config
|
125 | 128 | (defun +citre-recursive-project-root ()
|
126 | 129 | "Search recursively until we find one of `+citre-recursive-root-project-detection-files'.
|
127 | 130 | Fall back to the default `citre--project-root'."
|
128 |
| - (or |
129 |
| - (+directory-root-containing-file +citre-recursive-root-project-detection-files) |
130 |
| - ;; Fall back to the default detection! |
131 |
| - (citre--project-root)))) |
| 131 | + (or (+directory-root-containing-file +citre-recursive-root-project-detection-files) |
| 132 | + (citre--project-root))) ; Fall back to the default detection! |
| 133 | + |
| 134 | + (defun +citre-gtags-find-files-command (&optional dir) |
| 135 | + (let* ((default-directory (or dir default-directory))) |
| 136 | + (concat |
| 137 | + "echo 'Creating list of files to index ...'\n" |
| 138 | + (find-cmd |
| 139 | + (unless +citre-gtags-recursive-files-list '(maxdepth "1")) |
| 140 | + `(prune (and (type "d") (name ,@+citre-gtags-files-list-ignored-directories))) |
| 141 | + `(iname ,@+citre-gtags-files-list-suffixes) |
| 142 | + '(type "f" "l") |
| 143 | + '(print)) |
| 144 | + " > gtags.files\n" |
| 145 | + "echo 'Creating list of files to index ... done'\n"))) |
| 146 | + |
| 147 | + (defun +citre-gtags-create-list-of-files-to-index (top-directory) |
| 148 | + "Create a list of files to index in TOP-DIRECTORY." |
| 149 | + (interactive "DCreate file list in directory: ") |
| 150 | + (let* ((default-directory top-directory)) |
| 151 | + (start-process-shell-command "+citre-gtags-files-list" "*+citre-gtags-files-list*" (+citre-gtags-find-files-command))))) |
132 | 152 |
|
133 | 153 | (use-package citre-config
|
134 | 154 | :straight citre
|
|
0 commit comments