Let sly access the current project root asdf system
This commit is contained in:
parent
20eaed7051
commit
6ab04f3dce
15
init.el
15
init.el
|
@ -587,6 +587,21 @@
|
|||
(sly-symbol-completion-mode nil)
|
||||
:config
|
||||
(setq inferior-lisp-program "sbcl")
|
||||
(defun my--sly-add-project-root-to-asdf (old-init)
|
||||
(let ((dir (if-let* ((proj (project-current))
|
||||
(root (project-root proj)))
|
||||
root
|
||||
default-directory)))
|
||||
(if (directory-files dir nil "\\.asd\\'" t 1)
|
||||
(let ((old-init-list (read old-init)))
|
||||
(setf (cddadr old-init-list)
|
||||
(cons `(push (pathname ,(sly-to-lisp-filename dir))
|
||||
(symbol-value
|
||||
(read-from-string "asdf:*central-registry*")))
|
||||
(cddadr old-init-list)))
|
||||
(format "%S\n\n" old-init-list))
|
||||
old-init)))
|
||||
(advice-add #'sly-init-using-asdf :filter-return #'my--sly-add-project-root-to-asdf)
|
||||
(sly-setup)
|
||||
(with-eval-after-load 'meow
|
||||
(add-to-list 'meow-mode-state-list '(sly-db-mode . motion))))
|
||||
|
|
Loading…
Reference in a new issue