From 708e18079298bd601d26044116cceca0517f1d95 Mon Sep 17 00:00:00 2001 From: Marien Zwart Date: Sat, 27 Apr 2024 13:12:47 +1000 Subject: [PATCH] Make Doom search config with ripgrep, not git Doom's package help uses `git grep` to search for files in Doom configuring a package, which does not work for us because our Doom install does not live in a Git checkout. Unfortunately this breaks package help completely because of error handling problems. Add advice to use ripgrep instead, which fixes package help. I don't like doing this: I've sent the same fix upstream, if it's not accepted there I may just make Doom in the Nix store be a Git checkout. --- pre-init.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pre-init.el b/pre-init.el index 5a2fb19..729b8af 100644 --- a/pre-init.el +++ b/pre-init.el @@ -18,5 +18,18 @@ it. Just skip it entirely." (after! doom-packages (setq straight-base-dir unstraightened--straight-base-dir)) +;; TODO: remove if Doom accepts https://github.com/doomemacs/doomemacs/pull/7849 +(defadvice! nix-doom-configs-without-git (package) + "Override to use ripgrep instead of git." + :override #'doom--help-package-configs + (let ((default-directory doom-emacs-dir)) + (split-string + (cdr (doom-call-process + "rg" "--no-heading" "--line-number" "--iglob" "!*.org" + (format "%s %s($| )" + "(^;;;###package|\\(after!|\\(use-package!)" + package))) + "\n" t))) + ;; nix-doom-emacs-unstraightened additions end here. ;; Original init.el follows.