From 5f45147ca556bd9c97d09ec37a39f429ae9dc3d6 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 9 Apr 2021 17:51:29 -0500 Subject: Load slime-helper.el if it exists I couldn't find a function that would return a filename /if/ it exists, so I had to write one: `expand-file-name-exists-p'. Might change the name at some point. --- init.el | 8 +++++++- lisp/acdw.el | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index d70aeb0..b93f4aa 100644 --- a/init.el +++ b/init.el @@ -759,7 +759,13 @@ if ripgrep is installed, otherwise `consult-grep'." (executable-find "sbcl"))) (setup (:straight slime) (require 'slime-autoloads) - (:option inferior-lisp-program lisp-bin))) + (:option inferior-lisp-program lisp-bin) + + (when-let ((slime-helper (or (expand-file-name-exists-p + "~/quicklisp/slime-helper.el") + (expand-file-name-exists-p + "~/var/quicklisp/slime-helper.el")))) + (load slime-helper)))) (when (executable-find "fennel") (setup (:straight fennel-mode) diff --git a/lisp/acdw.el b/lisp/acdw.el index fd33514..44d15d0 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el @@ -62,6 +62,14 @@ each hook in HOOKS." (when (file-exists-p file) (load-file file)))) +(defun expand-file-name-exists-p (&rest expand-file-name-args) + "Call `expand-file-name' on EXPAND-FILE-NAME-ARGS, returning + its name if it exists, or NIL otherwise." + (let ((file (apply #'expand-file-name expand-file-name-args))) + (if (file-exists-p file) + file + nil))) + (defun acdw/dir (&optional file make-directory) "Place Emacs files in one place. -- cgit 1.4.1-21-gabe81