Controlling fasl location

Paul Bowyer pbowyer at olynet.com
Mon Jun 17 22:54:17 UTC 2013


Hello Ben,

At first, I downloaded slime-plz-use-asdf-cache.el and tried to use that 
in my ~/.emacs file, but that didn't work, so tried following the 
directions :=) and just used the contents of slime-plz-use-asdf-cache.el 
in my ~/.emacs file and that worked.

Any lisp file I compile/load is placed in a folder in the asdf fasl 
location that has the same name as the folder containing the lisp file.

As I've played around with this code, I've come to the realization that 
Max's code was working also. I just didn't give it enough testing to see.

I have this one lisp file that I use to build the project that I was 
working on, and the fasl always showed up in my source directory, but 
that file is the one that calls asdf and it's not in the asdf system 
file so it never shows up in the asdf fasl location. So I thought Max's 
code wasn't working, but when I did compile/load with other code, Max's 
code worked fine.

My apologies Max, for thinking your code wasn't working.

Thanks, Ben, for the code that you put together awhile ago. I find that 
I have so much to learn that I may never live long enough to learn it.

Sincerely,

Paul Bowyer


On 06/17/2013 12:48 PM, Ben Hyde wrote:
> Max, nice, thanks!  Since I prefer to limit how many files i need to 
> install on each machine I repackaged it to I could put it in my emacs 
> init file: https://gist.github.com/bhyde/5799707
>
> On Jun 17, 2013, at 1:52 PM, Paul Bowyer <pbowyer at olynet.com 
> <mailto:pbowyer at olynet.com>> wrote:
>
>> Hello Max,
>>
>> I tried the code in *inferior-lisp* and it produced this function
>> #<FUNCTION (LAMBDA (PATH OPTIONS)) {100657C57B}>
>>
>> I then tried compiling/loading a file, but the fasl still goes in my 
>> source directory.
>>
>> I tried placing the code in ~/.swank.lisp, started emacs/slime, 
>> compiled/loaded a file, and still the fasl ends up in my source 
>> directory.
>>
>> Is there some glue code that connect this function to compile-file in 
>> slime that might be missing?
>>
>> By the way, when you email me, I get two messages per mailing.
>>
>> Sincerely,
>>
>> Paul Bowyer
>>
>> On 06/17/2013 09:20 AM, Max Mikhanosha wrote:
>>> No this is on Common Lisp side, not the Elisp side, it needs to run
>>> after SLIME is already loaded. I have it in a ~/.swank.lisp file, which
>>> Slime loads on CommonLisp side when its initializing.
>>>
>>>
>>> I suggest that you test drive the code to verify that it works for
>>> you, you can execute it from REPL without making it permanent.
>>>
>>>
>>> At Mon, 17 Jun 2013 09:15:17 -0700,
>>> Paul Bowyer wrote:
>>>> Hello Max,
>>>>
>>>> Thanks for the lisp code. Now I would like to know where you place this
>>>> code. Is it placed in .emacs or some other place? If it's placed in
>>>> .emacs, is there a particular location there? The reason I ask is 
>>>> that I
>>>> tried placing a defun in .emacs and I couldn't get it to work. 
>>>> Sorry for
>>>> my ignorance...
>>>>
>>>> Sincerely,
>>>>
>>>> Paul Bowyer
>>>>
>>>> On 06/17/2013 08:03 AM, Max Mikhanosha wrote:
>>>>> Here is what I been using for a few years, C-c C-k output goes to the
>>>>> same place as asdf.  Note I don't remember why it does this through
>>>>> find-symbol, but I it could be that Slime not always had the
>>>>> *FASL-PATHNAME-FUNCTION* thing, and I wanted it to work on both new
>>>>> and old slime.. You can probably convert find-symbol to defvar or
>>>>> such.
>>>>>
>>>>>
>>>>> ;; Make C-c C-k in SLIME also use the correct directory
>>>>> (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
>>>>>           (lambda (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))))))
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> At Sun, 16 Jun 2013 15:39:38 -0700,
>>>>> Paul Bowyer wrote:
>>>>>> Hello Helmut,
>>>>>>
>>>>>> I found this link on the slime-developer mailing list and I 
>>>>>> wondered if
>>>>>> it is usable and if so, how would I implement it? I don't have a 
>>>>>> lot of
>>>>>> experience fiddling with slime's internals.
>>>>>> http://article.gmane.org/gmane.lisp.slime.devel/8378/match=fasl
>>>>>>
>>>>>> Is there some other convenient way to set the location for fasl files
>>>>>> from within a slime session so that when I do a compile/load, the 
>>>>>> fasl
>>>>>> goes to the same location as the output from asdf. Currently the 
>>>>>> output
>>>>>> from asdf goes to one place, and the output from compile/load 
>>>>>> goes to my
>>>>>> source directory.
>>>>>>
>>>>>> I'm looking for a simple function call that would pass a pathname or
>>>>>> would return to the default if no pathname was passed or maybe just a
>>>>>> variable that I can set from within a slime session that would do the
>>>>>> job. I only want this to to happen for some projects and not 
>>>>>> happen for
>>>>>> others that don't yet use asdf.
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Paul Bowyer
>>>>>>
>>>>>>
>>>
>>
>>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/slime-devel/attachments/20130617/10a87e68/attachment.html>


More information about the slime-devel mailing list