Skip to content

Commit 4bcaef3

Browse files
committed
tweak(prog)!: move non-LSP source code tagging packages to me-tags
1 parent ba2e628 commit 4bcaef3

File tree

2 files changed

+107
-91
lines changed

2 files changed

+107
-91
lines changed

modules/me-prog.el

Lines changed: 0 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -138,97 +138,6 @@
138138
(keymap-set combobulate-key-map "M-S-<left>" #'combobulate-yeet-forward)
139139
(keymap-set combobulate-key-map "M-S-<down>" #'combobulate-yoink-forward))
140140

141-
(use-package citre
142-
:straight t
143-
:after minemacs-first-c/c++-file
144-
:demand t
145-
:custom
146-
;; Better (!) project root detection function
147-
(citre-project-root-function #'+citre-recursive-project-root)
148-
:init
149-
(defcustom +citre-recursive-root-project-detection-files '(".tags/" ".repo/" ".citre_root")
150-
"A list of files/directories to use as a project root markers."
151-
:type '(repeat string)
152-
:group 'minemacs-prog)
153-
154-
(defcustom +citre-gtags-recursive-files-list t
155-
"Find files to index recursively."
156-
:type 'boolean
157-
:group 'minemacs-prog)
158-
159-
(defcustom +citre-gtags-files-list-suffixes '("*.[chly]" "*.[ch]xx" "*.[ch]pp" "*.[ch]++" "*.cc" "*.hh")
160-
"List of filename suffixes globs to index (for extensions for example)."
161-
:type '(repeat string)
162-
:group 'minemacs-prog)
163-
164-
(defcustom +citre-gtags-files-list-ignored-directories '("CVS" "RCS" "SCCS" ".git" ".hg" ".bzr" ".cdv" ".pc" ".svn" ".repo" "_MTN" "_darcs" "_sgbak" "debian")
165-
"List of directories to be ignored when creating the file list using `+citre-gtags-find-files-command'."
166-
:type '(repeat string)
167-
:group 'minemacs-prog)
168-
:config
169-
(defun +citre-recursive-project-root ()
170-
"Search recursively until we find one of `+citre-recursive-root-project-detection-files'.
171-
Fall back to the default `citre--project-root'."
172-
(or (+directory-root-containing-file +citre-recursive-root-project-detection-files)
173-
(citre--project-root))) ; Fall back to the default detection!
174-
175-
(defun +citre-gtags-find-files-command (&optional dir)
176-
(let* ((default-directory (or dir default-directory)))
177-
(concat
178-
"echo 'Creating list of files to index ...'\n"
179-
(find-cmd
180-
(unless +citre-gtags-recursive-files-list '(maxdepth "1"))
181-
`(prune (and (type "d") (name ,@+citre-gtags-files-list-ignored-directories)))
182-
`(iname ,@+citre-gtags-files-list-suffixes)
183-
'(type "f" "l")
184-
'(print))
185-
" > gtags.files\n"
186-
"echo 'Creating list of files to index ... done'\n")))
187-
188-
(defun +citre-gtags-create-list-of-files-to-index (top-directory)
189-
"Create a list of files to index in TOP-DIRECTORY."
190-
(interactive "DCreate file list in directory: ")
191-
(let* ((default-directory top-directory))
192-
(start-process-shell-command "+citre-gtags-files-list" "*+citre-gtags-files-list*" (+citre-gtags-find-files-command)))))
193-
194-
(use-package citre-config
195-
:straight citre
196-
:after citre
197-
:demand t)
198-
199-
(use-package xcscope
200-
:straight t
201-
:unless os/win
202-
:commands cscope-create-list-of-files-to-index cscope-index-files)
203-
204-
(use-package clink
205-
:straight (:host github :repo "abougouffa/clink.el")
206-
:when (+emacs-features-p 'sqlite3)
207-
:hook (minemacs-first-c/c++-file . global-clink-mode))
208-
209-
(use-package rtags
210-
:straight t)
211-
212-
(use-package rtags-xref
213-
:straight t
214-
:commands rtags-xref-enable)
215-
216-
(use-package rscope
217-
:straight (:host github :repo "rjarzmik/rscope")
218-
:commands rscope-init rscope-regenerate-database)
219-
220-
(use-package eopengrok
221-
:straight t
222-
:commands
223-
eopengrok-mode eopengrok-find-reference eopengrok-find-text eopengrok-find-definition eopengrok-find-custom
224-
eopengrok-jump-to-source eopengrok-create-index eopengrok-create-index-with-enable-projects
225-
:config
226-
(+nmap! :keymaps 'eopengrok-mode-map
227-
"n" #'eopengrok-next-line
228-
"p" #'eopengrok-previous-line
229-
"q" #'eopengrok-quit
230-
"RET" #'eopengrok-jump-to-source))
231-
232141
(use-package srefactor
233142
:straight t)
234143

modules/me-tags.el

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
;;; me-tags.el --- Non-LSP source code tagging tools -*- lexical-binding: t; -*-
2+
3+
;; Copyright (C) 2022-2024 Abdelhak Bougouffa
4+
5+
;; Author: Abdelhak Bougouffa (rot13 "nobhtbhssn@srqbencebwrpg.bet")
6+
7+
;;; Commentary:
8+
9+
;;; Code:
10+
11+
12+
(use-package citre
13+
:straight t
14+
:after minemacs-first-c/c++-file
15+
:demand t
16+
:custom
17+
;; Better (!) project root detection function
18+
(citre-project-root-function #'+citre-recursive-project-root)
19+
:init
20+
(defcustom +citre-recursive-root-project-detection-files '(".tags/" ".repo/" ".citre_root")
21+
"A list of files/directories to use as a project root markers."
22+
:type '(repeat string)
23+
:group 'minemacs-prog)
24+
25+
(defcustom +citre-gtags-recursive-files-list t
26+
"Find files to index recursively."
27+
:type 'boolean
28+
:group 'minemacs-prog)
29+
30+
(defcustom +citre-gtags-files-list-suffixes '("*.[chly]" "*.[ch]xx" "*.[ch]pp" "*.[ch]++" "*.cc" "*.hh")
31+
"List of filename suffixes globs to index (for extensions for example)."
32+
:type '(repeat string)
33+
:group 'minemacs-prog)
34+
35+
(defcustom +citre-gtags-files-list-ignored-directories '("CVS" "RCS" "SCCS" ".git" ".hg" ".bzr" ".cdv" ".pc" ".svn" ".repo" "_MTN" "_darcs" "_sgbak" "debian")
36+
"List of directories to be ignored when creating the file list using `+citre-gtags-find-files-command'."
37+
:type '(repeat string)
38+
:group 'minemacs-prog)
39+
:config
40+
(defun +citre-recursive-project-root ()
41+
"Search recursively until we find one of `+citre-recursive-root-project-detection-files'.
42+
Fall back to the default `citre--project-root'."
43+
(or (+directory-root-containing-file +citre-recursive-root-project-detection-files)
44+
(citre--project-root))) ; Fall back to the default detection!
45+
46+
(defun +citre-gtags-find-files-command (&optional dir)
47+
(let* ((default-directory (or dir default-directory)))
48+
(concat
49+
"echo 'Creating list of files to index ...'\n"
50+
(find-cmd
51+
(unless +citre-gtags-recursive-files-list '(maxdepth "1"))
52+
`(prune (and (type "d") (name ,@+citre-gtags-files-list-ignored-directories)))
53+
`(iname ,@+citre-gtags-files-list-suffixes)
54+
'(type "f" "l")
55+
'(print))
56+
" > gtags.files\n"
57+
"echo 'Creating list of files to index ... done'\n")))
58+
59+
(defun +citre-gtags-create-list-of-files-to-index (top-directory)
60+
"Create a list of files to index in TOP-DIRECTORY."
61+
(interactive "DCreate file list in directory: ")
62+
(let* ((default-directory top-directory))
63+
(start-process-shell-command "+citre-gtags-files-list" "*+citre-gtags-files-list*" (+citre-gtags-find-files-command)))))
64+
65+
(use-package citre-config
66+
:straight citre
67+
:after citre
68+
:demand t)
69+
70+
(use-package xcscope
71+
:straight t
72+
:unless os/win
73+
:commands cscope-create-list-of-files-to-index cscope-index-files)
74+
75+
(use-package clink
76+
:straight (:host github :repo "abougouffa/clink.el")
77+
:when (+emacs-features-p 'sqlite3)
78+
:hook (minemacs-first-c/c++-file . global-clink-mode))
79+
80+
(use-package rtags
81+
:straight t)
82+
83+
(use-package rtags-xref
84+
:straight t
85+
:commands rtags-xref-enable)
86+
87+
(use-package rscope
88+
:straight (:host github :repo "rjarzmik/rscope")
89+
:commands rscope-init rscope-regenerate-database)
90+
91+
(use-package eopengrok
92+
:straight t
93+
:commands
94+
eopengrok-mode eopengrok-find-reference eopengrok-find-text eopengrok-find-definition eopengrok-find-custom
95+
eopengrok-jump-to-source eopengrok-create-index eopengrok-create-index-with-enable-projects
96+
:config
97+
(+nmap! :keymaps 'eopengrok-mode-map
98+
"n" #'eopengrok-next-line
99+
"p" #'eopengrok-previous-line
100+
"q" #'eopengrok-quit
101+
"RET" #'eopengrok-jump-to-source))
102+
103+
104+
105+
(provide 'me-tags)
106+
107+
;;; me-tags.el ends here

0 commit comments

Comments
 (0)