From: Unknownmat
Subject: Beginner emacs / SLIME / ACL / ASDF question
Date: 
Message-ID: <1152928699.309181.244750@35g2000cwc.googlegroups.com>
Hello,

How do I modify the ASDF *central-registry* variable, so that the new
value is loaded each time I start Emacs?

I'm still fairly new to LISP and very new to the whole emacs / LISP
interaction.  It's an intriguing idea, but I'm not yet fully
comfortable with it.

I am running Windows XP, and recently installed LispBox0.7 using
ACL-express, from the "Practical Common Lisp" page:
http://www.gigamonkeys.com/lispbox/

*central-registry* defaults to *default-pathname-defaults*, which is
somehow fed the default LispBox installation directory: C:\program
files\lispbox-0.7.  Instead, I would like to specify where to keep my
".asd" files.  In fact, I am very comfortable with Visual Studio's
".sln" files, and would prefer if, similarly, each project were
contained in it's own directory with its own.asd file (and without the
need for a *central-registry*), but based on my understanding, I do not
think this is how ASDF works.

l cannot figure out how to change *central-registry*, short of
hand-editing it each time I open my environment.  I'm uncertain where
this value gets set.  I believe it is after Emacs loads, and so it is
not appropriate to set this in an ".emacs" file.  I am uncertain if
ASDF is loaded by SLIME, or ACL.  To make matters more complicated, I
have 3 "asdf.lisp" files on my system, and I do not know which is being
loaded by my system.  In any case, I tried hand editing the asdf.lisp
(defvar *central-registry*...) statement in all 3 files (which seems
like a terrible way to configure my system, but I don't know what the
standard way to configure this is supposed to be... ), but this has not
made the slighest difference.

I'm not at all familiar with Usenet either, and I apologize if I've
gone about posting this in the wrong way.  Any help would be greatly
appreciated.

Thanks,
Matt

From: Luke J Crook
Subject: Re: Beginner emacs / SLIME / ACL / ASDF question
Date: 
Message-ID: <dbOdnagG_Y4c5iXZnZ2dnUVZ_qmdnZ2d@giganews.com>
Unknownmat wrote:
> Hello,
> 
> How do I modify the ASDF *central-registry* variable, so that the new
> value is loaded each time I start Emacs?


*central-registry* is in asdf.lisp file. I just edit asdf.lisp and add
my paths to the *central-registry* variable.

Here is a handy link:

http://svn.sourceforge.net/viewcvs.cgi/*checkout*/lispbuilder/trunk/lispbuilder-sdl/documentation/index.html#Win32:
Configuration

- Luke
From: Unknownmat
Subject: Re: Beginner emacs / SLIME / ACL / ASDF question
Date: 
Message-ID: <1153023438.250652.113680@p79g2000cwp.googlegroups.com>
Luke J Crook wrote:
> Unknownmat wrote:
> > Hello,
> >
> > How do I modify the ASDF *central-registry* variable, so that the new
> > value is loaded each time I start Emacs?
>
>
> *central-registry* is in asdf.lisp file. I just edit asdf.lisp and add
> my paths to the *central-registry* variable.
>
> Here is a handy link:
>
> http://svn.sourceforge.net/viewcvs.cgi/*checkout*/lispbuilder/trunk/lispbuilder-sdl/documentation/index.html#Win32:
> Configuration
>
> - Luke

Thanks for the help.  I have 3 versions of ASDF.lisp on my system, and
was not certain which version was being loaded.  I tried modifying them
as you suggested and this made no difference.  I finally figured out
that ACL was keeping an asdf.fasl file in its ./code directory that is
loaded when the system loads.  I had to recompile asdf.lisp, and then
copy the corresponding asdf.fasl into ./code directory.  This FINALLY
managed to modify *central-registry*.
From: Ari Johnson
Subject: Re: Beginner emacs / SLIME / ACL / ASDF question
Date: 
Message-ID: <m2r70nv5e3.fsf@hermes.theari.com>
"Unknownmat" <··········@gmail.com> writes:

> Hello,
>
> How do I modify the ASDF *central-registry* variable, so that the new
> value is loaded each time I start Emacs?
>
> I'm still fairly new to LISP and very new to the whole emacs / LISP
> interaction.  It's an intriguing idea, but I'm not yet fully
> comfortable with it.
>
> I am running Windows XP, and recently installed LispBox0.7 using
> ACL-express, from the "Practical Common Lisp" page:
> http://www.gigamonkeys.com/lispbox/
>
> *central-registry* defaults to *default-pathname-defaults*, which is
> somehow fed the default LispBox installation directory: C:\program
> files\lispbox-0.7.  Instead, I would like to specify where to keep my
> ".asd" files.  In fact, I am very comfortable with Visual Studio's
> ".sln" files, and would prefer if, similarly, each project were
> contained in it's own directory with its own.asd file (and without the
> need for a *central-registry*), but based on my understanding, I do not
> think this is how ASDF works.
>
> l cannot figure out how to change *central-registry*, short of
> hand-editing it each time I open my environment.  I'm uncertain where
> this value gets set.  I believe it is after Emacs loads, and so it is
> not appropriate to set this in an ".emacs" file.  I am uncertain if
> ASDF is loaded by SLIME, or ACL.  To make matters more complicated, I
> have 3 "asdf.lisp" files on my system, and I do not know which is being
> loaded by my system.  In any case, I tried hand editing the asdf.lisp
> (defvar *central-registry*...) statement in all 3 files (which seems
> like a terrible way to configure my system, but I don't know what the
> standard way to configure this is supposed to be... ), but this has not
> made the slighest difference.

*central-registry* is a Common Lisp variable, not an Emacs one, so
 setting it in .emacs will have no effect.  I don't know where ACL
 keeps its startup files, but what you want to do is find its startup
 file and add to that.  For instance, my .sbclrc file in my home
 directory says:
  (require '#:asdf)
  (pushnew "/home/ari/.sbcl/systems/" asdf:*central-registry*)

My .openmcl/startup.lisp says almost exactly the same thing, except
with a different path because it's on a different machine.

Hopefully someone can point you to where ACL (particularly running
within the LispBox setup) loads its startup from.  You might start by
looking through the LispBox files for it.

> I'm not at all familiar with Usenet either, and I apologize if I've
> gone about posting this in the wrong way.  Any help would be greatly
> appreciated.

You did fine on that part. :)
From: Unknownmat
Subject: Re: Beginner emacs / SLIME / ACL / ASDF question
Date: 
Message-ID: <1153023089.072726.88780@p79g2000cwp.googlegroups.com>
Ari,

Thanks for the help.  Please see my comments below.

Ari Johnson wrote:
> *central-registry* is a Common Lisp variable, not an Emacs one, so
>  setting it in .emacs will have no effect.  I don't know where ACL
>  keeps its startup files, but what you want to do is find its startup
>  file and add to that.  For instance, my .sbclrc file in my home
>  directory says:
>   (require '#:asdf)
>   (pushnew "/home/ari/.sbcl/systems/" asdf:*central-registry*)
>
> My .openmcl/startup.lisp says almost exactly the same thing, except
> with a different path because it's on a different machine.
>
> Hopefully someone can point you to where ACL (particularly running
> within the LispBox setup) loads its startup from.  You might start by
> looking through the LispBox files for it.

I'm still trying to dig up the LispBox startup file.  Apparently,
ACL-express uses the file .clinit.cl ... which does not exist on my
system.  And when I tried adding one with the following text:

(require '#:asdf)
(pushnew "D:/My Documents/Development/Projects/LISP/ASDF Files/"
asdf:*central-registry*)

it (very strangely) succeeded only in modifying
*default-pathname-defaults* variable to some absurd directory
("c:\\Program Files\\Common Files\\System\\MAPI\\1033\\").

There's something going on here in the sequence of startup files, and
the Slime / ACL interaction but I haven't quite figured it out.
From: Tel A.
Subject: Re: Beginner emacs / SLIME / ACL / ASDF question
Date: 
Message-ID: <1152984019.122837.72000@p79g2000cwp.googlegroups.com>
Unknownmat wrote:
> Hello,
>
> How do I modify the ASDF *central-registry* variable, so that the new
> value is loaded each time I start Emacs?

Every lisp implementation has a default startup file it runs before
dropping you into the REPL. You should edit this file to load ASDF and
then pushnew where you want to store your files.

ACL-express' is called .clinit.cl and should be placed in your home
folder (whatever that means on XP)

Here's (part of) mine:

(require 'asdf)
; ASDF Configuration
(pushnew "/Users/tel/Library/Lisp/Asdf-Registry/systems/"
	 asdf:*central-registry*
	 :test #'equal)

> I'm still fairly new to LISP and very new to the whole emacs / LISP
> interaction.  It's an intriguing idea, but I'm not yet fully
> comfortable with it.

Check out this movie Marco Baringer made. You might have to watch it
several times to get everything he does, but he shows a wonderful
example of effective use of slime.

http://bc.tech.coop/blog/050728.html

> *central-registry* defaults to *default-pathname-defaults*, which is
> somehow fed the default LispBox installation directory: C:\program
> files\lispbox-0.7.  Instead, I would like to specify where to keep my
> ".asd" files.  In fact, I am very comfortable with Visual Studio's
> ".sln" files, and would prefer if, similarly, each project were
> contained in it's own directory with its own.asd file (and without the
> need for a *central-registry*), but based on my understanding, I do not
> think this is how ASDF works.

There's another system called ASDF-Install that allows the automatic
fetching and installation of systems posted on Cliki. It's very useful,
so I suggest you base your Registry set up off of it.

Here's how I do it:

I have an Asdf-Registry folder in an appropriate location
(/Users/tel/Library/Lisp/Asdf-Registry/) which contains two
subdirectories: site and systems. site contains individual folders for
each project which each have a .asd file at the toplevel. systems
contains symbolic links (apparently this is possible in XP - I've
never done it: http://shell-shocked.org/article.php?id=284) to all of
the .asd files. All you have to do then is point *central-registry* at
the systems folder - as done in my .clinit.cl file.

To make this totally compatible wth ASDF-Install, I also have this as
the second part of my .clinit.cl file:

(unless (featurep 'asdf-install)
  (asdf:oos 'asdf:load-op 'asdf-install))
; ASDF-Install Configuration
(setf asdf-install:*locations*
      '((#P"/Users/tel/Library/Lisp/Asdf-Registry/site/"
	 #P"/Users/tel/Library/Lisp/Asdf-Registry/systems/"
	 "Personal Installation.")))


Hope this gives you some ideas. Good luck!

-ja
From: Unknownmat
Subject: Re: Beginner emacs / SLIME / ACL / ASDF question
Date: 
Message-ID: <1153027566.461036.193520@i42g2000cwa.googlegroups.com>
Tel A. wrote:
> Every lisp implementation has a default startup file it runs before
> dropping you into the REPL. You should edit this file to load ASDF and
> then pushnew where you want to store your files.
>
> ACL-express' is called .clinit.cl and should be placed in your home
> folder (whatever that means on XP)
>
> Here's (part of) mine:
>
> (require 'asdf)
> ; ASDF Configuration
> (pushnew "/Users/tel/Library/Lisp/Asdf-Registry/systems/"
> 	 asdf:*central-registry*
> 	 :test #'equal)
>

Thanks for the response.  XP does not have a concept of Home Folder,
but I *think* that C: is the default.

Digging into this, it seems that the command line option "-qq" will
disable using the .clinit.cl file.  When I kill the Allegro process,
Emacs displays the following text in the mini-buffer:

"d:/program files/acl80-express/allegro-ansi.exe" +B +cm -qq -L
"C:/Program Files/LispBox-0.7/start-slime.lisp" -- -p 4006: finished.

This seems to be the command by which ACL and Slime were launched...
Strangely though I searched through all the files in my LispBox
directory and my ACL directory and could not find that command-string
anywhere.  I can't figure out where that comes from.  However, there
seem to be a number of configurations items happening, as this version
(which was meant to accompany the book "Practical Common Lisp") has a
number of settings that the default "Lisp In a Box" does not have.

> > I'm still fairly new to LISP and very new to the whole emacs / LISP
> > interaction.  It's an intriguing idea, but I'm not yet fully
> > comfortable with it.
>
> Check out this movie Marco Baringer made. You might have to watch it
> several times to get everything he does, but he shows a wonderful
> example of effective use of slime.
>
> http://bc.tech.coop/blog/050728.html

Thanks!  I watched the whole thing.  Definately a lot to learn.  I've
spent a lot of time using Visual Studio, and so the certain aspects of
Emacs are very frustrating to me.  In particular, it's biggest strength
- that it is written in, and understands, LISP - is also the most
frustrating part for me as I don't understand the boundaries between
editor, environment, and Compiler / REPL.

Also, everything's written using Unix file system idioms.  Windows,
unfortunately, uses long directory and file names, and lacks a concept
of "root" or "home".  This often makes these ported-from-unix systems
cumbersome to work with.

> There's another system called ASDF-Install that allows the automatic
> fetching and installation of systems posted on Cliki. It's very useful,
> so I suggest you base your Registry set up off of it.
>
> Here's how I do it:
>
> I have an Asdf-Registry folder in an appropriate location
> (/Users/tel/Library/Lisp/Asdf-Registry/) which contains two
> subdirectories: site and systems. site contains individual folders for
> each project which each have a .asd file at the toplevel. systems
> contains symbolic links (apparently this is possible in XP - I've
> never done it: http://shell-shocked.org/article.php?id=284) to all of
> the .asd files. All you have to do then is point *central-registry* at
> the systems folder - as done in my .clinit.cl file.
>
> To make this totally compatible wth ASDF-Install, I also have this as
> the second part of my .clinit.cl file:
>
> (unless (featurep 'asdf-install)
>   (asdf:oos 'asdf:load-op 'asdf-install))
> ; ASDF-Install Configuration
> (setf asdf-install:*locations*
>       '((#P"/Users/tel/Library/Lisp/Asdf-Registry/site/"
> 	 #P"/Users/tel/Library/Lisp/Asdf-Registry/systems/"
> 	 "Personal Installation.")))
>
>
> Hope this gives you some ideas. Good luck!
>
> -ja

Thanks for the tips.  I will try ASDF-install.  I didn't realize that
there was an automatic download / installation tool.  I hope it works
on Windows :) ... 

Matt
From: Ari Johnson
Subject: Re: Beginner emacs / SLIME / ACL / ASDF question
Date: 
Message-ID: <m2psg5bwsx.fsf@hermes.theari.com>
"Unknownmat" <··········@gmail.com> writes:

> Tel A. wrote:
>> Every lisp implementation has a default startup file it runs before
>> dropping you into the REPL. You should edit this file to load ASDF and
>> then pushnew where you want to store your files.
>>
>> ACL-express' is called .clinit.cl and should be placed in your home
>> folder (whatever that means on XP)
>>
>> Here's (part of) mine:
>>
>> (require 'asdf)
>> ; ASDF Configuration
>> (pushnew "/Users/tel/Library/Lisp/Asdf-Registry/systems/"
>> 	 asdf:*central-registry*
>> 	 :test #'equal)
>>
>
> Thanks for the response.  XP does not have a concept of Home Folder,
> but I *think* that C: is the default.

Sure it does!  See %USERPROFILE%, which points to, on a default
installation to the C: drive and most regular user accounts,
C:\Documents and Settings\username\.

Aside from the profile directory, there is a home directory which can
vary.  This will often be a network share.  I can't remember the
environment variable that points to it, but it's probably %USERHOME%
or %HOME%.

Some programs like things to be in the profile directory.  Others like
to use the home directory.  For instance, PuTTY insists on putting a
state file in your home directory, whereas most programs use the
profile hierarchy to store temporary files.
From: Unknownmat
Subject: Re: Beginner emacs / SLIME / ACL / ASDF question
Date: 
Message-ID: <1153094025.194594.161060@i42g2000cwa.googlegroups.com>
Ari Johnson wrote:
> "Unknownmat" <··········@gmail.com> writes:
>
> > Tel A. wrote:
> >> Every lisp implementation has a default startup file it runs before
> >> dropping you into the REPL. You should edit this file to load ASDF and
> >> then pushnew where you want to store your files.
> >>
> >> ACL-express' is called .clinit.cl and should be placed in your home
> >> folder (whatever that means on XP)
> >>
> >> Here's (part of) mine:
> >>
> >> (require 'asdf)
> >> ; ASDF Configuration
> >> (pushnew "/Users/tel/Library/Lisp/Asdf-Registry/systems/"
> >> 	 asdf:*central-registry*
> >> 	 :test #'equal)
> >>
> >
> > Thanks for the response.  XP does not have a concept of Home Folder,
> > but I *think* that C: is the default.
>
> Sure it does!  See %USERPROFILE%, which points to, on a default
> installation to the C: drive and most regular user accounts,
> C:\Documents and Settings\username\.
>
> Aside from the profile directory, there is a home directory which can
> vary.  This will often be a network share.  I can't remember the
> environment variable that points to it, but it's probably %USERHOME%
> or %HOME%.
>
> Some programs like things to be in the profile directory.  Others like
> to use the home directory.  For instance, PuTTY insists on putting a
> state file in your home directory, whereas most programs use the
> profile hierarchy to store temporary files.

Yes, you are right.  Thanks for clearing that up.  I found this link:
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds_shelloverview.mspx?mfr=true
which lists a bunch of environment variables, a few of which might be
considered a home.

I haven't toyed around yet to see which one ACL actually uses.

Thanks,
Matt
From: Sacha
Subject: Re: Beginner emacs / SLIME / ACL / ASDF question
Date: 
Message-ID: <0Gqug.540337$Co6.12922942@phobos.telenet-ops.be>
> Thanks for the response.  XP does not have a concept of Home Folder,
> but I *think* that C: is the default.

On a standard install that would be :

c:\Documents and Settings\YourUserName\



Sacha 
From: Darren New
Subject: Re: Beginner emacs / SLIME / ACL / ASDF question
Date: 
Message-ID: <Mpvug.16599$MF6.1058@tornado.socal.rr.com>
Sacha wrote:
>>Thanks for the response.  XP does not have a concept of Home Folder,
>>but I *think* that C: is the default.

> On a standard install that would be :
> c:\Documents and Settings\YourUserName\

Well, Windows lacks a specific "home" concept as such. That points to a 
collection of directories that have specific uses - temp directories, 
files on the local machine, files that should roam with the user 
profile, cache directories, etc. So in practice there's no concept of 
"*A* home directory" because having only one such directory is rather 
limiting. But if you actually learn and use the appropriate mechanisms, 
you get good support from the OS.

-- 
   Darren New / San Diego, CA, USA (PST)
     This octopus isn't tasty. Too many
     tentacles, not enough chops.
From: Ari Johnson
Subject: Re: Beginner emacs / SLIME / ACL / ASDF question
Date: 
Message-ID: <m2zmf9o0sc.fsf@hermes.theari.com>
Darren New <····@san.rr.com> writes:

> Sacha wrote:
>>>Thanks for the response.  XP does not have a concept of Home Folder,
>>>but I *think* that C: is the default.
>
>> On a standard install that would be :
>> c:\Documents and Settings\YourUserName\
>
> Well, Windows lacks a specific "home" concept as such. That points to
> a collection of directories that have specific uses - temp
> directories, files on the local machine, files that should roam with
> the user profile, cache directories, etc. So in practice there's no
> concept of "*A* home directory" because having only one such directory
> is rather limiting. But if you actually learn and use the appropriate
> mechanisms, you get good support from the OS.

There absolutely is a concept of a home directory, and
%HOMEDRIVE%%HOMEPATH% should evaluate to its path.  It will not always
be the same as %USERPROFILE%.  Take your pick of which of the home
directory and the profile directory is appropriate to use in a given
situation.
From: Darren New
Subject: Re: Beginner emacs / SLIME / ACL / ASDF question
Date: 
Message-ID: <S2wug.16601$MF6.13261@tornado.socal.rr.com>
Ari Johnson wrote:
> There absolutely is a concept of a home directory, and
> %HOMEDRIVE%%HOMEPATH% should evaluate to its path.  It will not always
> be the same as %USERPROFILE%.

On my machine, it's the same as %USERPROFILE%. Note that applications 
should not be (for example) storing configuration files in this "home 
directory". They should be in %HOMEDRIVE%%HOMEPATH%\Application Settings 
or in %HOMEDRIVE%%HOMEPATH%\Local Settings\Application Settings, just as 
an example. That's all I meant - there's a whole defined tree of 
special-purpose directories under the "home directory" that don't exist 
in UNIX.

-- 
   Darren New / San Diego, CA, USA (PST)
     This octopus isn't tasty. Too many
     tentacles, not enough chops.
From: Unknownmat
Subject: Re: Beginner emacs / SLIME / ACL / ASDF question
Date: 
Message-ID: <1153094280.185470.106050@m79g2000cwm.googlegroups.com>
Darren New wrote:
> Sacha wrote:
> >>Thanks for the response.  XP does not have a concept of Home Folder,
> >>but I *think* that C: is the default.
>
> > On a standard install that would be :
> > c:\Documents and Settings\YourUserName\
>
> Well, Windows lacks a specific "home" concept as such. That points to a
> collection of directories that have specific uses - temp directories,
> files on the local machine, files that should roam with the user
> profile, cache directories, etc. So in practice there's no concept of
> "*A* home directory" because having only one such directory is rather
> limiting. But if you actually learn and use the appropriate mechanisms,
> you get good support from the OS.
>

Darren - I just meant that I personally find it frustrating to use
Unix-orginated tools (such as GNU, and many CL implementations) due to
difficulties in mapping Unix filesystem / configuration idioms onto a
Windows filesystem.

If you are aware of any "appropriate mechanisms" to assist in this,
then I would be interested to hear your thoughts.

I hadn't meant to specifically criticize XP.
From: cmo
Subject: Re: Beginner emacs / SLIME / ACL / ASDF question
Date: 
Message-ID: <1153129255.298166.160220@s13g2000cwa.googlegroups.com>
You can define a home variable:
R-Clk on My Computer, Properties, Advanced, Environment Variables,
then add a new one in System variables list
where the the name is 'Home' and the path is the one you define based
on your liking.

once i did this, most gnu ported app. used that variable.

so if you tried to do the above, and then tried to open a file in emacs
using ~/ , it will try to slurp that file from the path set in HOME
var.

and by the way, check this link (specially the blog) and search for
'windows'
http://bc.tech.coop/


Regards

cmo-0

Unknownmat wrote:
> Darren New wrote:
> > Sacha wrote:
> > >>Thanks for the response.  XP does not have a concept of Home Folder,
> > >>but I *think* that C: is the default.
> >
> > > On a standard install that would be :
> > > c:\Documents and Settings\YourUserName\
> >
> > Well, Windows lacks a specific "home" concept as such. That points to a
> > collection of directories that have specific uses - temp directories,
> > files on the local machine, files that should roam with the user
> > profile, cache directories, etc. So in practice there's no concept of
> > "*A* home directory" because having only one such directory is rather
> > limiting. But if you actually learn and use the appropriate mechanisms,
> > you get good support from the OS.
> >
>
> Darren - I just meant that I personally find it frustrating to use
> Unix-orginated tools (such as GNU, and many CL implementations) due to
> difficulties in mapping Unix filesystem / configuration idioms onto a
> Windows filesystem.
>
> If you are aware of any "appropriate mechanisms" to assist in this,
> then I would be interested to hear your thoughts.
> 
> I hadn't meant to specifically criticize XP.
From: Pascal Bourguignon
Subject: Re: Beginner emacs / SLIME / ACL / ASDF question
Date: 
Message-ID: <87mzbax0jx.fsf@thalassa.informatimago.com>
"Unknownmat" <··········@gmail.com> writes:
> How do I modify the ASDF *central-registry* variable, so that the new
> value is loaded each time I start Emacs?
> [...]
> I am running Windows XP, and recently installed LispBox0.7 using
> ACL-express, from the "Practical Common Lisp" page:
> http://www.gigamonkeys.com/lispbox/

Depends whether you choosed the lispbox with clisp or with sbcl.
With clisp, edit the file: ~/.clisprc.lisp
With sbcl, edit the file:  ~/.sbclrc
Each implementation has a different initialization file.

If like me you find it a bother to duplicate statements in all these
files when you try another lisp implementation, you can merely put in
them a LOAD form to load a common file, for example: ~/common.lisp :

(LOAD (MERGE-PATHNAMES
       (MAKE-PATHNAME :NAME "COMMON" :TYPE "LISP" :CASE :COMMON)
       (USER-HOMEDIR-PATHNAME)
       NIL))


Then, in ~/common.lisp, you can put the forms to modify your
environment that are the same in all the implementations.
(Some things are still specific to each implementation and go to each
implementation specific initialization files).



> *central-registry* defaults to *default-pathname-defaults*, which is
> somehow fed the default LispBox installation directory: C:\program
> files\lispbox-0.7.  Instead, I would like to specify where to keep my
> ".asd" files.  In fact, I am very comfortable with Visual Studio's
> ".sln" files, and would prefer if, similarly, each project were
> contained in it's own directory with its own.asd file (and without the
> need for a *central-registry*), but based on my understanding, I do not
> think this is how ASDF works.

You can do that.  Here is what I have in my ~/common.lisp.  It scans
given directories for .asd files, and add all these directories to the
*central-registry*.  Since this scan can be long when you accumulate a
lot of libraries and projects, this is done only from time to time,
(or on demand), and the result is put in a cache file.

(in-package :common-lisp-user)

(defparameter *asdf-interval-between-rescan* (* 7 24 60 60)
  "Force rescan at least once this amount of seconds.")
(defparameter *asdf-registry-file*
  (make-pathname :name "ASDF-CENTRAL-REGISTRY" :type "DATA" :case :common
                 :defaults (user-homedir-pathname))
  "Cache file.")

(defparameter *original-asdf-registry* ASDF:*CENTRAL-REGISTRY*)

(defun asdf-rescan-packages 
                   (&optional (directories '("/usr/local/asdf-install/")))
  (format *trace-output* "~&;; Scanning ASDF packages...~%")
  (prog1
      (SORT 
       (DELETE-DUPLICATES 
        (MAPCAR
         (LAMBDA (P)
           (MAKE-PATHNAME :NAME NIL :TYPE NIL :VERSION NIL :DEFAULTS P))
         (mapcan (lambda (dir)
                   (DIRECTORY
                    (merge-pathnames
                     (make-pathname :directory '(:relative :wild-inferiors)
                                    :name :wild
                                    :type "ASD"
                                    :case :common
                                    :defaults dir)
                     dir nil)))
                 directories))
        :test (function equal))
       (LAMBDA (A B) (if (= (length a) (length b))
                         (string< a b)
                         (< (length a) (length b))))
       :key (function namestring))
    (format *trace-output* "~&;; Done.~%")))


(defun update-asdf-registry (&key (force-scan nil)
                             (directories nil directoriesp))
  (length
   (setf ASDF:*CENTRAL-REGISTRY*
         (nconc
          (if (and (not force-scan)
                   (probe-file *ASDF-REGISTRY-FILE*)
                   (let ((date (file-write-date *ASDF-REGISTRY-FILE*)))
                     (and date (< (get-universal-time)
                                  (+ date *asdf-interval-between-rescan*)))))
              (with-open-file (in *ASDF-REGISTRY-FILE*)
                (format *trace-output* "~&;; Reading ASDF packages from ~A...~%"
                        *asdf-registry-file*)
                (let ((*read-eval* nil))
                  (read in nil nil)))
              (let ((scan (apply (function asdf-rescan-packages)
                                 (when directoriesp
                                   (list directories)))))
                (unless force-scan
                  (format *trace-output* "~&;; Writing ASDF packages to ~A...~%"
                          *asdf-registry-file*)
                  (with-open-file (out *ASDF-REGISTRY-FILE*
                                       :direction :output
                                       :if-does-not-exist :create
                                       :if-exists :supersede)
                    (print scan out)))
                scan))
          ;;(list CCLAN-GET::*CCLAN-ASDF-REGISTRY*)
          *original-asdf-registry*))))

(EXPORT 'UPDATE-ASDF-REGISTRY)
(update-asdf-registry
   :directory '( #| put here your root directories for asdf systems |# ))

(defun asdf-load        (system) (asdf:operate 'asdf:load-op        system))
(defun asdf-load-source (system) (asdf:operate 'asdf:load-source-op system))

#+sbcl (require 'asdf-install)
#-sbcl (asdf-load :asdf-install)
(setf asdf-install:*locations* (butlast asdf-install:*locations*))
#-sbcl (setf asdf-install:*preferred-location* 0)
(defun asdf-install     (system) (asdf-install:install              system))
(export '(asdf-load asdf-load-source asdf-install))




When you add new asdf systems, you can update the registry immediately with:

(update-asdf-registry
   :force-scan t
   :directory '( #| put here your root directories for asdf systems |# ))


> [...]
> I'm not at all familiar with Usenet either, and I apologize if I've
> gone about posting this in the wrong way.  Any help would be greatly
> appreciated.

It's fine.


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

"What is this talk of "release"?  Klingons do not make software
"releases".  Our software "escapes" leaving a bloody trail of
designers and quality assurance people in its wake."
From: Unknownmat
Subject: Re: Beginner emacs / SLIME / ACL / ASDF question
Date: 
Message-ID: <1153023967.663871.166650@s13g2000cwa.googlegroups.com>
Pascal Bourguignon wrote:
> Depends whether you choosed the lispbox with clisp or with sbcl.
> With clisp, edit the file: ~/.clisprc.lisp
> With sbcl, edit the file:  ~/.sbclrc
> Each implementation has a different initialization file.
>
> If like me you find it a bother to duplicate statements in all these
> files when you try another lisp implementation, you can merely put in
> them a LOAD form to load a common file, for example: ~/common.lisp :
>
> (LOAD (MERGE-PATHNAMES
>        (MAKE-PATHNAME :NAME "COMMON" :TYPE "LISP" :CASE :COMMON)
>        (USER-HOMEDIR-PATHNAME)
>        NIL))
>
>
> Then, in ~/common.lisp, you can put the forms to modify your
> environment that are the same in all the implementations.
> (Some things are still specific to each implementation and go to each
> implementation specific initialization files).
>

Thank you very much for this extensive response.

What do you mean by a LOAD form?  Where do I put this LOAD form to
ensure that it is loaded each time?  If I knew this, I think it would
solve a lot of my troubles.

Also, thanks for the code.  Once I can figure out how to get this
environment working properly, I think that I will definately use that.

> (in-package :common-lisp-user)
>
> (defparameter *asdf-interval-between-rescan* (* 7 24 60 60)
>   "Force rescan at least once this amount of seconds.")
> (defparameter *asdf-registry-file*
>   (make-pathname :name "ASDF-CENTRAL-REGISTRY" :type "DATA" :case :common
>                  :defaults (user-homedir-pathname))
>   "Cache file.")
>
> (defparameter *original-asdf-registry* ASDF:*CENTRAL-REGISTRY*)
>
> (defun asdf-rescan-packages
>                    (&optional (directories '("/usr/local/asdf-install/")))
>   (format *trace-output* "~&;; Scanning ASDF packages...~%")
>   (prog1
>       (SORT
>        (DELETE-DUPLICATES
>         (MAPCAR
>          (LAMBDA (P)
>            (MAKE-PATHNAME :NAME NIL :TYPE NIL :VERSION NIL :DEFAULTS P))
>          (mapcan (lambda (dir)
>                    (DIRECTORY
>                     (merge-pathnames
>                      (make-pathname :directory '(:relative :wild-inferiors)
>                                     :name :wild
>                                     :type "ASD"
>                                     :case :common
>                                     :defaults dir)
>                      dir nil)))
>                  directories))
>         :test (function equal))
>        (LAMBDA (A B) (if (= (length a) (length b))
>                          (string< a b)
>                          (< (length a) (length b))))
>        :key (function namestring))
>     (format *trace-output* "~&;; Done.~%")))
>
>
> (defun update-asdf-registry (&key (force-scan nil)
>                              (directories nil directoriesp))
>   (length
>    (setf ASDF:*CENTRAL-REGISTRY*
>          (nconc
>           (if (and (not force-scan)
>                    (probe-file *ASDF-REGISTRY-FILE*)
>                    (let ((date (file-write-date *ASDF-REGISTRY-FILE*)))
>                      (and date (< (get-universal-time)
>                                   (+ date *asdf-interval-between-rescan*)))))
>               (with-open-file (in *ASDF-REGISTRY-FILE*)
>                 (format *trace-output* "~&;; Reading ASDF packages from ~A...~%"
>                         *asdf-registry-file*)
>                 (let ((*read-eval* nil))
>                   (read in nil nil)))
>               (let ((scan (apply (function asdf-rescan-packages)
>                                  (when directoriesp
>                                    (list directories)))))
>                 (unless force-scan
>                   (format *trace-output* "~&;; Writing ASDF packages to ~A...~%"
>                           *asdf-registry-file*)
>                   (with-open-file (out *ASDF-REGISTRY-FILE*
>                                        :direction :output
>                                        :if-does-not-exist :create
>                                        :if-exists :supersede)
>                     (print scan out)))
>                 scan))
>           ;;(list CCLAN-GET::*CCLAN-ASDF-REGISTRY*)
>           *original-asdf-registry*))))
>
> (EXPORT 'UPDATE-ASDF-REGISTRY)
> (update-asdf-registry
>    :directory '( #| put here your root directories for asdf systems |# ))
>
> (defun asdf-load        (system) (asdf:operate 'asdf:load-op        system))
> (defun asdf-load-source (system) (asdf:operate 'asdf:load-source-op system))
>
> #+sbcl (require 'asdf-install)
> #-sbcl (asdf-load :asdf-install)
> (setf asdf-install:*locations* (butlast asdf-install:*locations*))
> #-sbcl (setf asdf-install:*preferred-location* 0)
> (defun asdf-install     (system) (asdf-install:install              system))
> (export '(asdf-load asdf-load-source asdf-install))
>
>
>
>
> When you add new asdf systems, you can update the registry immediately with:
>
> (update-asdf-registry
>    :force-scan t
>    :directory '( #| put here your root directories for asdf systems |# ))

Thanks,
Matt
From: Pascal Bourguignon
Subject: Re: Beginner emacs / SLIME / ACL / ASDF question
Date: 
Message-ID: <87psg6uhgl.fsf@thalassa.informatimago.com>
"Unknownmat" <··········@gmail.com> writes:

> Pascal Bourguignon wrote:
>> Depends whether you choosed the lispbox with clisp or with sbcl.
>> With clisp, edit the file: ~/.clisprc.lisp
>> With sbcl, edit the file:  ~/.sbclrc
>> Each implementation has a different initialization file.
>>
>> If like me you find it a bother to duplicate statements in all these
>> files when you try another lisp implementation, you can merely put in
>> them a LOAD form to load a common file, for example: ~/common.lisp :
>>
>> (LOAD (MERGE-PATHNAMES
>>        (MAKE-PATHNAME :NAME "COMMON" :TYPE "LISP" :CASE :COMMON)
>>        (USER-HOMEDIR-PATHNAME)
>>        NIL))
>>
>>
>> Then, in ~/common.lisp, you can put the forms to modify your
>> environment that are the same in all the implementations.
>> (Some things are still specific to each implementation and go to each
>> implementation specific initialization files).
>>
>
> Thank you very much for this extensive response.
>
> What do you mean by a LOAD form?  

Forms are S-Expr (Symbolic Expressions) whose purpose is to be executed.
Some S-Expr are data.  Those that are programs are forms.


  (LOAD (MERGE-PATHNAMES
          (MAKE-PATHNAME :NAME "COMMON" :TYPE "LISP" :CASE :COMMON)
          (USER-HOMEDIR-PATHNAME)
          NIL))

is an example of the kind of LOAD form I had in mind.
But you could also use something like:

  (LOAD "/home/matt/common.lisp")

instead.


> Where do I put this LOAD form to ensure that it is loaded each time?  

You cannot do that, given that all Common Lisp implementation I know
have an option to avoid loading any initialization file.

But you can put this LOAD form in the initialization file of the
Common Lisp implementation you use to have it executed when you start
this Common Lisp implementation with the default options.

clisp   --> ~/.clisprc.lisp
sbcl    --> ~/.sbclrc
cmucl   --> ~/.cmucl-init.lisp
ecl     --> ~/.eclrc
gcl     --> ~/.gclrc.lisp
openmcl --> ~/openmcl-init.lisp  ; note: not a dot-file!


> If I knew this, I think it would solve a lot of my troubles.
>
> Also, thanks for the code.  Once I can figure out how to get this
> environment working properly, I think that I will definately use that.

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

In a World without Walls and Fences, 
who needs Windows and Gates?
From: Unknownmat
Subject: Re: Beginner emacs / SLIME / ACL / ASDF question
Date: 
Message-ID: <1153095046.167129.161810@m79g2000cwm.googlegroups.com>
Pascal Bourguignon wrote:
> >> If like me you find it a bother to duplicate statements in all these
> >> files when you try another lisp implementation, you can merely put in
> >> them a LOAD form to load a common file, for example: ~/common.lisp :
> >>
> >> (LOAD (MERGE-PATHNAMES
> >>        (MAKE-PATHNAME :NAME "COMMON" :TYPE "LISP" :CASE :COMMON)
> >>        (USER-HOMEDIR-PATHNAME)
> >>        NIL))
> >>
> >>
> > What do you mean by a LOAD form?
>
> Forms are S-Expr (Symbolic Expressions) whose purpose is to be executed.
> Some S-Expr are data.  Those that are programs are forms.
>
>
>   (LOAD (MERGE-PATHNAMES
>           (MAKE-PATHNAME :NAME "COMMON" :TYPE "LISP" :CASE :COMMON)
>           (USER-HOMEDIR-PATHNAME)
>           NIL))
>

Ah!  I see what you meant now.  I had not previously been aware of the
term "form" as an executable s-exp.

That makes a great deal of sense ... Although I do not intend to use
multiple LISP implementations, I DO have Corman Lisp, CLISP, and ACL
currently on my system.  I think that I will take your advice in
creating a "Common.lisp" file.

Thanks,
Matt