Created
June 17, 2013 19:46
-
-
Save bhyde/5799707 to your computer and use it in GitHub Desktop.
A few lines of elisp to instruct slime to ask swank to use the asdf fasl cache directories when it compiles things. For example using C-c C-k.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; elisp that instructs slime/swank to use the ASDF cache for fasl files. | |
;;; add this to your emacs init file; and the magic happens. | |
(defun setup-to-save-swank-fasls-in-asdf-cache () | |
;; based on http://article.gmane.org/gmane.lisp.slime.devel/11080 | |
(slime-eval-print " | |
(flet ((find-fasl (path options) | |
(declare (ignore options)) | |
(let ((fasl-path | |
(asdf:apply-output-translations | |
(compile-file-pathname path)))) | |
(when fasl-path | |
(ensure-directories-exist fasl-path) | |
fasl-path)))) | |
(let (fasl-finder-sym) | |
(when (and (find-package :swank) | |
(setq fasl-finder-sym | |
(find-symbol \"*FASL-PATHNAME-FUNCTION*\" :swank)) | |
(null (symbol-value fasl-finder-sym))) | |
(set fasl-finder-sym #'find-fasl))))")) | |
(add-to-list 'slime-connected-hook 'setup-to-save-swank-fasls-in-asdf-cache) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment