Skip to content

Instantly share code, notes, and snippets.

@bhyde
Created June 17, 2013 19:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save bhyde/5799707 to your computer and use it in GitHub Desktop.
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.
;;; 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