[slime-devel] request for pecifying location fasl-files

Gary King gwking at metabang.com
Tue Sep 9 13:34:20 UTC 2008


Hi Knut,

I'd like this feature too but think it would be better implemented to  
use ASDF-Binary-Locations if that extension was present. If I have  
time this week, I'll try to merge your work (for when ABL isn't there)  
and my ABL hack and put it up as a patch.

On Sep 9, 2008, at 6:58 AM, Knut Olav Bøhmer wrote:

> Hi,
>
> I would like to be able to specify where slime should place it's
> fasl-files when running slime-compile-and-load-file.
> The location should be per-buffer/filename configurable by placing
> variable-definition in the header of a .lisp file or by a hook that  
> runs
> when a .lisp file is opened.
> I have attached an example implementation that I use, and have used  
> for
> a long time. It works for me.
>
>
> -- 
> Free Software Consultant
> Cell: +47 - 47 34 40 08
> Phone: +47 - 21 53 69 00, Fax: +47 - 21 53 69 09
> Addr: Nydalsveien 30b, 0484 Oslo
> <http://www.freecode.no/>
>
> Index: slime.el
> ===================================================================
> RCS file: /project/slime/cvsroot/slime/slime.el,v
> retrieving revision 1.1008
> diff -u -r1.1008 slime.el
> --- slime.el	30 Aug 2008 15:33:46 -0000	1.1008
> +++ slime.el	9 Sep 2008 09:03:41 -0000
> @@ -222,6 +222,11 @@
>   :type 'boolean
>   :group 'slime-mode)
>
> +(defcustom slime-compile-location ""
> +  "Where should slime put fasl files"
> +  :type 'string
> +  :group 'slime)
> +
> ;;;;; slime-mode-faces
>
> (defgroup slime-mode-faces nil
> @@ -3893,8 +3898,16 @@
> underlined and annotated with the relevant information. The commands
> `slime-next-note' and `slime-previous-note' can be used to navigate
> between compiler notes and to display their full details."
> +
>   (interactive)
> -  (slime-compile-file t))
> +
> +  (let ((location (slime-eval 'swank:*binary-location*)))
> +    (slime-eval (list 'cl-user::setf 'swank:*binary-location* slime- 
> compile-location))
> +    (unwind-protect
> +         (slime-compile-file t)
> +      (slime-eval (list 'cl-user::setf 'swank:*binary-location*  
> location)))))
> +
> +
>
> (defun slime-compile-file (&optional load)
>   "Compile current buffer's file and highlight resulting compiler  
> notes.
> Index: swank-lispworks.lisp
> ===================================================================
> RCS file: /project/slime/cvsroot/slime/swank-lispworks.lisp,v
> retrieving revision 1.113
> diff -u -r1.113 swank-lispworks.lisp
> --- swank-lispworks.lisp	11 Aug 2008 07:39:15 -0000	1.113
> +++ swank-lispworks.lisp	9 Sep 2008 09:03:41 -0000
> @@ -25,6 +25,7 @@
> (defun swank-mop:compute-applicable-methods-using-classes (gf classes)
>   (clos::compute-applicable-methods-from-classes gf classes))
>
> +
> ;; lispworks doesn't have the eql-specializer class, it represents
> ;; them as a list of `(EQL ,OBJECT)
> (deftype swank-mop:eql-specializer () 'cons)
> @@ -396,7 +397,7 @@
>
> (defimplementation swank-compile-file (filename load-p external- 
> format)
>   (with-swank-compilation-unit (filename)
> -    (compile-file filename :load load-p :external-format external- 
> format)))
> +    (compile-file filename :load load-p :external-format external- 
> format :output-file (symbol-value (find-symbol (string '*binary- 
> location*) :swank)))))
>
> (defvar *within-call-with-compilation-hooks* nil
>   "Whether COMPILE-FILE was called from within CALL-WITH-COMPILATION- 
> HOOKS.")
> Index: swank.lisp
> ===================================================================
> RCS file: /project/slime/cvsroot/slime/swank.lisp,v
> retrieving revision 1.581
> diff -u -r1.581 swank.lisp
> --- swank.lisp	31 Aug 2008 11:58:01 -0000	1.581
> +++ swank.lisp	9 Sep 2008 09:03:41 -0000
> @@ -27,6 +27,7 @@
>            #:emacs-inspect
>            ;;#:inspect-slot-for-emacs
>            ;; These are user-configurable variables:
> +           #:*binary-location*
>            #:*communication-style*
>            #:*dont-close*
>            #:*log-events*
> @@ -662,6 +663,9 @@
> (defvar *dedicated-output-stream-port* 0
>   "Which port we should use for the dedicated output stream.")
>
> +(defvar *binary-location* "."
> +  "path to directory where swank should place fasl files when")
> +
> (defvar *communication-style* (preferred-communication-style))
>
> (defvar *dont-close* nil
>
>
> _______________________________________________
> slime-devel site list
> slime-devel at common-lisp.net
> http://common-lisp.net/mailman/listinfo/slime-devel

--
Gary Warren King, metabang.com
Cell: (413) 559 8738
Fax: (206) 338-4052
gwkkwg on Skype * garethsan on AIM







More information about the slime-devel mailing list