From 819c20bb69e3e73131b635e74061e61136d8d051 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 30 Jun 2024 14:57:51 -0400 Subject: [PATCH] feat(common-lisp): make quicklisp directory configurable Previously, `+lisp/find-file-in-quicklisp` used a hard-coded directory aimed at a nonstandard Quicklisp install location, `~/.quicklisp`. The default install location is `~/quicklisp`, without the dot. This commit makes the user's Quicklisp directory configurable through the variable `+lisp-quicklisp-paths`. `+lisp/find-file-in-quicklisp` has been updated to respect this variable. Close: #7830 Co-authored-by: bpseudopod --- modules/lang/common-lisp/autoload/common-lisp.el | 6 +++++- modules/lang/common-lisp/config.el | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/lang/common-lisp/autoload/common-lisp.el b/modules/lang/common-lisp/autoload/common-lisp.el index 087ae51b2..b40de3e51 100644 --- a/modules/lang/common-lisp/autoload/common-lisp.el +++ b/modules/lang/common-lisp/autoload/common-lisp.el @@ -37,4 +37,8 @@ (defun +lisp/find-file-in-quicklisp () "Find a file belonging to a library downloaded by Quicklisp." (interactive) - (doom-project-find-file "~/.quicklisp/dists/")) + (doom-project-find-file + (or (cl-loop for dir in +lisp-quicklisp-paths + if (file-directory-p dir) + return (expand-file-name "dists/" dir)) + (user-error "Couldn't find your Quicklisp directory (customize `+lisp-quicklisp-paths')")))) diff --git a/modules/lang/common-lisp/config.el b/modules/lang/common-lisp/config.el index 8f866be0c..0044697f7 100644 --- a/modules/lang/common-lisp/config.el +++ b/modules/lang/common-lisp/config.el @@ -1,5 +1,9 @@ ;;; lang/common-lisp/config.el -*- lexical-binding: t; -*- +(defcustom +lisp-quicklisp-paths '("~/quicklisp" "~/.quicklisp") + "A list of directories to search for Quicklisp's site files." + :type '(repeat directory)) + ;; `lisp-mode' is loaded at startup. In order to lazy load its config we need to ;; pretend it isn't loaded (defer-feature! lisp-mode)