I'm using the elisp snippet below(courtesy of Stas Boukarev with some modifications) to reload a .asd file. Is asdf::load-sysdef the best way to trigger a reload(but not recompilation) ?
Use case: I want to work on a system that isn't in the ASDF path, it being one of the many development trees I have around(e.g. CFFI), so I want to be able to say that "this cffi.asd is the CFFI to use during this session". Any ideas ?
(defvar slime-custom-file-loaders '(("asd" . slime-load-asdf) ("lisp" . slime-load-file)))
(defun slime-load-asdf (filename) (slime-eval-with-transcript `(asdf::load-sysdef ,(file-name-sans-extension filename) ,(slime-to-lisp-filename (expand-file-name filename)))))
(defun slime-custom-load-file () (interactive) (unless buffer-file-name (error "Buffer %s is not associated with a file." (buffer-name))) (check-parens) (when (and (buffer-modified-p) (y-or-n-p (format "Save file %s? " (buffer-file-name)))) (save-buffer)) (let* ((type (file-name-extension buffer-file-name)) (loader (cdr (assoc-string type slime-custom-file-loaders t)))) (funcall (or loader 'slime-load-file) buffer-file-name)))
(define-key slime-mode-map (kbd "C-c C-l") 'slime-custom-load-file)