From a820bbd46838170777eb518fff17ef374628cd9b Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 30 Jul 2018 23:02:06 +0200 Subject: [PATCH] lang/common-lisp: fix sly version mismatch prompts Caused by the perfect storm of Emacs, Doom and Sly decision choices, this prevents the mismatched sly version prompts each time you start up sly/lisp-mode. --- modules/lang/common-lisp/config.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/lang/common-lisp/config.el b/modules/lang/common-lisp/config.el index c3b84a961..eac1e33c2 100644 --- a/modules/lang/common-lisp/config.el +++ b/modules/lang/common-lisp/config.el @@ -34,6 +34,16 @@ inferior-lisp-program)))) (add-hook 'sly-mode-hook #'+common-lisp|init-sly) + (defun +common-lisp*refresh-sly-version (version conn) + "Update `sly-protocol-version', which will likely be incorrect or nil due to +an issue where `load-file-name' is incorrect. Because Doom's packages are +installed through an external script (bin/doom), `load-file-name' is set to +bin/doom while packages at compile-time (not a runtime though)." + (unless sly-protocol-version + (setq sly-protocol-version (sly-version nil (locate-library "sly.el")))) + (advice-remove #'sly-check-version #'+common-lisp*refresh-sly-version)) + (advice-add #'sly-check-version :before #'+common-lisp*refresh-sly-version) + ;; evil integration (when (featurep! :feature evil +everywhere) (add-hook 'sly-popup-buffer-mode-hook #'evil-normalize-keymaps)