mirror of
https://github.com/org-roam/org-roam
synced 2025-08-01 12:17:21 -05:00
(feat): unlinked-references: add error message if rg has no PCRE2 support (#1243)
This commit is contained in:
@ -1821,12 +1821,17 @@ means that the results can be noisy, and may not truly indicate
|
|||||||
an unlinked reference.
|
an unlinked reference.
|
||||||
|
|
||||||
Users are encouraged to think hard about whether items should be
|
Users are encouraged to think hard about whether items should be
|
||||||
linked, lest the network graph get too crowded."
|
linked, lest the network graph get too crowded.
|
||||||
|
|
||||||
|
Requires a version of Ripgrep with PCRE2 support installed, with
|
||||||
|
the executable 'rg' in variable `exec-path'."
|
||||||
(interactive)
|
(interactive)
|
||||||
(unless (org-roam--org-roam-file-p)
|
(unless (org-roam--org-roam-file-p)
|
||||||
(user-error "Not in org-roam file"))
|
(user-error "Not in org-roam file"))
|
||||||
(if (not (executable-find "rg"))
|
(if (not (executable-find "rg"))
|
||||||
(error "Cannot find the ripgrep executable \"rg\". Check that it is installed and available on `exec-path'")
|
(error "Cannot find the ripgrep executable \"rg\". Check that it is installed and available on `exec-path'")
|
||||||
|
(when (string-match "PCRE2 is not available" (shell-command-to-string "rg --pcre2-version"))
|
||||||
|
(error "\"rg\" must be compiled with PCRE2 support"))
|
||||||
(let* ((titles (org-roam--extract-titles))
|
(let* ((titles (org-roam--extract-titles))
|
||||||
(rg-command (concat "rg -o --vimgrep -P -i "
|
(rg-command (concat "rg -o --vimgrep -P -i "
|
||||||
(string-join (mapcar (lambda (glob) (concat "-g " glob))
|
(string-join (mapcar (lambda (glob) (concat "-g " glob))
|
||||||
|
Reference in New Issue
Block a user