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.
This commit is contained in:
Henrik Lissner 2018-07-30 23:02:06 +02:00
parent 1211c2c7f7
commit a820bbd468
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -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)