From: David Steuber
Subject: SLIME ming SBCL on OS X
Date: 
Message-ID: <m21xt48218.fsf@verizon.net>
I'm trying to get the final configuration of my Carbonated Emacs for
OSX going with SBCL and SLIME, all from CVS.  Yes, I am a masochist
at times, even though I hate pain.

I have this in my .emacs:

;;; SLIME & SBCL
(add-to-list 'load-path "/Users/david/usr/src/slime/slime")
(require 'slime)
(add-hook 'lisp-mode-hook (lambda () (slime-mode t)))
(add-hook 'inferior-lisp-mode-hook (lambda () (inferior-slime-mode t)))
(require 'hyperspec)
(setq common-lisp-hyperspec-root
  "file:/Users/david/LispStuff/HyperSpec/")

I want to run the SBCL I build from CVS.  It is

/Users/david/usr/bin/sbcl

The core file is

/Users/david/usr/lib/sbcl/sbcl.core

Because Emacs is started from the Dock, it does not get my
.bash_profile settings for $PATH or $SBCL_HOME.  I've looked through
slime.el, but I have not found what I need to set to get the above
SBCL going with its core.

I haven't tested hyperspec either.  I looked through hyperspec.el and
found the DEFVAR for common-lisp-hyperspec-root.  I hope that I did
the correct thing to set it to my local version.  I don't know if I
did a redundant require or not as slime.el does a require on
hyperspec.  I'm hoping that requires don't cause multiple loads.

All this is for Lisp on Mac OS X.  I am hoping to pick up Lisp and
perhaps even get enough skill together to contribute to SBCL.  Time
will tell.  I have an impressive resume of vapor-ware.

-- 
   One Emacs to rule them all.  One Emacs to find them,
   One Emacs to take commands and to the keystrokes bind them,

All other programming languages wish they were Lisp.

From: Thomas F. Burdick
Subject: Re: SLIME ming SBCL on OS X
Date: 
Message-ID: <xcvllrbrgu6.fsf@famine.OCF.Berkeley.EDU>
David Steuber <·············@verizon.net> writes:

> I want to run the SBCL I build from CVS.  It is
> 
> /Users/david/usr/bin/sbcl
> 
> The core file is
> 
> /Users/david/usr/lib/sbcl/sbcl.core
> 
> Because Emacs is started from the Dock, it does not get my
> .bash_profile settings for $PATH or $SBCL_HOME.  I've looked through
> slime.el, but I have not found what I need to set to get the above
> SBCL going with its core.

This is really a unix packaging problem. Here's how I have mine set
up, mimicing the style used by sysadmins on the least brittle systems
I've used:

  /usr/local/packages/sbcl-xxx/bin/start-sbcl.sh

is a shell script:

  #!/bin/sh

  if [ -z "$SBCL_HOME" ]; then
    SBCL_HOME=/usr/local/packages/sbcl-xxx/lib/sbcl';
  fi

  export SBCL_HOME;

  exec /usr/local/packages/sbcl-xxx/bin/sbcl ··@"

and /usr/local/bin/sbcl is a symlink to start-sbcl.sh.

(Actually /usr/local/packages/sbcl -> sbcl-xxx, and
/usr/local/bin/sbcl -> /usr/local/packages/sbcl/bin/start-sbcl.sh)

-- 
           /|_     .-----------------------.                        
         ,'  .\  / | No to Imperialist war |                        
     ,--'    _,'   | Wage class war!       |                        
    /       /      `-----------------------'                        
   (   -.  |                               
   |     ) |                               
  (`-.  '--.)                              
   `. )----'                               
From: Michael Hudson
Subject: Re: SLIME ming SBCL on OS X
Date: 
Message-ID: <7h31xt4j9hs.fsf@pc150.maths.bris.ac.uk>
David Steuber <·············@verizon.net> writes:

> Because Emacs is started from the Dock, it does not get my
> .bash_profile settings for $PATH or $SBCL_HOME.  I've looked through
> slime.el, but I have not found what I need to set to get the above
> SBCL going with its core.

Do you know about ~/.MacOSX/environment.plist?  That's where I set my
$SBCL_HOME.

Cheers,
mwh

-- 
  Reading Slashdot can [...] often be worse than useless, especially
  to young and budding programmers: it can give you exactly the wrong
  idea about the technical issues it raises.
 -- http://www.cs.washington.edu/homes/klee/misc/slashdot.html#reasons
From: David Steuber
Subject: Re: SLIME ming SBCL on OS X
Date: 
Message-ID: <m23cdj7t9b.fsf@verizon.net>
Michael Hudson <···@python.net> writes:

> David Steuber <·············@verizon.net> writes:
> 
> > Because Emacs is started from the Dock, it does not get my
> > .bash_profile settings for $PATH or $SBCL_HOME.  I've looked through
> > slime.el, but I have not found what I need to set to get the above
> > SBCL going with its core.
> 
> Do you know about ~/.MacOSX/environment.plist?  That's where I set my
> $SBCL_HOME.

I don't seem to have such a directory.  Those plist files are some
nasty XML though.

-- 
   One Emacs to rule them all.  One Emacs to find them,
   One Emacs to take commands and to the keystrokes bind them,

All other programming languages wish they were Lisp.
From: Michael Hudson
Subject: Re: SLIME ming SBCL on OS X
Date: 
Message-ID: <7h3r812j3xj.fsf@pc150.maths.bris.ac.uk>
David Steuber <·············@verizon.net> writes:

> Michael Hudson <···@python.net> writes:
> 
> > David Steuber <·············@verizon.net> writes:
> > 
> > > Because Emacs is started from the Dock, it does not get my
> > > .bash_profile settings for $PATH or $SBCL_HOME.  I've looked through
> > > slime.el, but I have not found what I need to set to get the above
> > > SBCL going with its core.
> > 
> > Do you know about ~/.MacOSX/environment.plist?  That's where I set my
> > $SBCL_HOME.
> 
> I don't seem to have such a directory.

Yeah, you have to create it.

> Those plist files are some nasty XML though.

[hmm, good sigmonster]

Use the Property List Editor.  Actually looking into a plist file is
the wrong thing to do.

This is the only way I know to get environment variables to all the
processes you start and even then you have to log out and in again to
change anything so it still sucks a bit.

Cheers,
,wj

-- 
  Structure is _nothing_ if it is all you got.  Skeletons _spook_
  people if they try to walk around on their own.  I really wonder 
  why XML does not.                     -- Erik Naggum, comp.lang.lisp
From: David Steuber
Subject: Re: SLIME ming SBCL on OS X
Date: 
Message-ID: <m265iem6oa.fsf@verizon.net>
Michael Hudson <···@python.net> writes:

> Use the Property List Editor.  Actually looking into a plist file is
> the wrong thing to do.

Hmmm.  Another tool included with OS X that I did not know about?
Learn something new every day.  Cool.

> This is the only way I know to get environment variables to all the
> processes you start and even then you have to log out and in again to
> change anything so it still sucks a bit.

To be fair, if you make changes to, say, ~/.bash_profile you have to
log out and in again (within that shell) or execute the changes in
the shell seperate from the edited changes to the profile.

Anyway, I'll check that property list editor out.  It would be nice
to have Emacs (which I run from Dock) inherit the same environment
that I use in Bash.

At this point in time, I am still treating my Mac as a pretty Unix
box.  I do like iTunes though.  I ripped my entire CD collection with
it.  It fits.  I think that means my collection is too small.

-- 
   One Emacs to rule them all.  One Emacs to find them,
   One Emacs to take commands and to the keystrokes bind them,

All other programming languages wish they were Lisp.
From: Håkon Alstadheim
Subject: Re: SLIME ming SBCL on OS X
Date: 
Message-ID: <m0znfozaue.fsf@alstadhome.dyndns.org>
David Steuber <·············@verizon.net> writes:

> Michael Hudson <···@python.net> writes:
>
...  It would be nice
> to have Emacs (which I run from Dock) inherit the same environment
> that I use in Bash.

To avoid losing state in emacs, check out (getenv ...) and (setenv
...) elisp functions. Switch to the *scratch* buffer, make sure you
are in "lisp-interaction-mode", run (getenv ...), edit and paste the
result into a (setenv...) call.

-- 
H�kon Alstadheim, hjemmepappa.
From: Sean O'Rourke
Subject: Re: SLIME ming SBCL on OS X
Date: 
Message-ID: <m21xt0qaof.fsf@rh220-50.resnet.ucsd.edu>
······@online.no (H�kon Alstadheim) writes:

> David Steuber <·············@verizon.net> writes:
>
>> Michael Hudson <···@python.net> writes:
>>
> ...  It would be nice
>> to have Emacs (which I run from Dock) inherit the same environment
>> that I use in Bash.
>
> To avoid losing state in emacs, check out (getenv ...) and (setenv
> ...) elisp functions. Switch to the *scratch* buffer, make sure you
> are in "lisp-interaction-mode", run (getenv ...), edit and paste the
> result into a (setenv...) call.

This doesn't help.  The problem is that applications launched from the
finder don't have their environments set up by the various ~/.*rc
files run by the shell.  One solution is to fake getenv() by forking
a shell to echo the environment variable's value.  Another, which I
choose, is to only launch Emacs from the command-line by running 
/Applications/Emacs.app/Contents/MacOS/Emacs.

It's almost unix...

/s
From: Luke Gorrie
Subject: Re: SLIME ming SBCL on OS X
Date: 
Message-ID: <lhwuaw6mvy.fsf@dodo.bluetail.com>
David Steuber <·············@verizon.net> writes:

> Because Emacs is started from the Dock, it does not get my
> .bash_profile settings for $PATH or $SBCL_HOME.  I've looked through
> slime.el, but I have not found what I need to set to get the above
> SBCL going with its core.

You can do e.g.:

  (setq inferior-lisp-program
        "/Users/david/usr/bin/sbcl --core /Users/david/usr/lib/sbcl/sbcl.core")

Or if you do `C-u M-x slime' you'll be prompted for how to start the
inferior lisp.

> I haven't tested hyperspec either.  I looked through hyperspec.el and
> found the DEFVAR for common-lisp-hyperspec-root.  I hope that I did
> the correct thing to set it to my local version.  I don't know if I
> did a redundant require or not as slime.el does a require on
> hyperspec.  I'm hoping that requires don't cause multiple loads.

The require is redundant, but it won't cause multiple loads.

In my .emacs I use:

(setq common-lisp-hyperspec-root "/home/luke/docs/HyperSpec-6-0/HyperSpec/")

i.e. non-URL, just a directory name. I'm not sure if that matters. It
might depend on your browser, my `browse-url-browser-function' is
`w3m-browse-url'

Cheers,
Luke
From: Raymond Wiker
Subject: Re: SLIME ming SBCL on OS X
Date: 
Message-ID: <86he202dgq.fsf@raw.grenland.fast.no>
        This is all very interesting - does SLIME work with
non-threaded SBCL now? 

        I just downloaded SLIME onto my FreeBSD machine, and tried to
start SLIME with SBCL. The first stumbling block was that SBCL tried
to find sb-bsd-sockets.lisp - I *think* this is because I need to load
asdf first; anyhow, adding a (require 'asdf) to swank-sbcl.lisp seemed
to fix this. 

        I'm now at the stage where I can start up SLIME, but SBCL (in
ther "inferior lisp" buffer) complains about "Connection to Emacs
Lost".

-- 
Raymond Wiker                        Mail:  ·············@fast.no
Senior Software Engineer             Web:   http://www.fast.no/
Fast Search & Transfer ASA           Phone: +47 23 01 11 60
P.O. Box 1677 Vika                   Fax:   +47 35 54 87 99
NO-0120 Oslo, NORWAY                 Mob:   +47 48 01 11 60

Try FAST Search: http://alltheweb.com/
From: Michael Hudson
Subject: Re: SLIME ming SBCL on OS X
Date: 
Message-ID: <7h3wuawhthv.fsf@pc150.maths.bris.ac.uk>
Raymond Wiker <·············@fast.no> writes:

>         This is all very interesting - does SLIME work with
> non-threaded SBCL now? 

Well, it seems to work on my iBook, so yeah :-) You need CVS for this,
but luckily SF anon CVS seems to work for the first time in months.

>         I just downloaded SLIME onto my FreeBSD machine, and tried to
> start SLIME with SBCL. The first stumbling block was that SBCL tried
> to find sb-bsd-sockets.lisp - I *think* this is because I need to load
> asdf first; anyhow, adding a (require 'asdf) to swank-sbcl.lisp seemed
> to fix this. 

I think CVS SBCL doesn't need that, either.

Cheers,
mwh

-- 
  Indeed, when I design my killer language, the identifiers "foo" and
  "bar" will be reserved words, never used, and not even mentioned in
  the reference manual. Any program using one will simply dump core
  without comment. Multitudes will rejoice. -- Tim Peters, 29 Apr 1998
From: Luke Gorrie
Subject: Re: SLIME ming SBCL on OS X
Date: 
Message-ID: <lhn0bs6jot.fsf@dodo.bluetail.com>
Raymond Wiker <·············@fast.no> writes:

>         This is all very interesting - does SLIME work with
> non-threaded SBCL now? 

Yes, Dan Barlow SERVE-EVENT'ified the SBCL backend.

For archival purposes, I'd prefer to discuss SLIME on the mailing
list. You can post (without being a member) to
slime-devel<at>common-lisp.net, and it's accessible via Gmane at
http://news.gmane.org/gmane.lisp.slime.devel or via NNTP.

>         I'm now at the stage where I can start up SLIME, but SBCL (in
> ther "inferior lisp" buffer) complains about "Connection to Emacs
> Lost".

I get this with SBCL currently too. It even hangs my whole Emacs. Let
this be a caution to the squeamish. :-)

I'll fix it and get back to you via email with Cc: to the list.

Cheers,
Luke
From: David Steuber
Subject: Re: SLIME ming SBCL on OS X
Date: 
Message-ID: <m28ynb7tbp.fsf@verizon.net>
Luke Gorrie <····@bluetail.com> writes:

> You can do e.g.:
> 
>   (setq inferior-lisp-program
>         "/Users/david/usr/bin/sbcl --core /Users/david/usr/lib/sbcl/sbcl.core")

OK.  I am now getting this message from M-x slime:

Connecting to Swank at localhost:4005. (Abort with `M-x slime-disconnect'.) [190 times]

And counting, it seems.

I'm not sure what's wrong here.  This is my modified .emacs section:

;;; SLIME & SBCL
(add-to-list 'load-path "/Users/david/usr/src/slime/slime")
(require 'slime)
(add-hook 'lisp-mode-hook (lambda () (slime-mode t)))
(add-hook 'inferior-lisp-mode-hook (lambda () (inferior-slime-mode t)))
(setq common-lisp-hyperspec-root
  "/Users/david/LispStuff/HyperSpec/")
(setq inferior-lisp-program
  "/Users/david/usr/bin/sbcl --core /Users/david/usr/lib/sbcl/sbcl.core")

What did I miss?

No sbcl process started.  I'm wondering about the build problems I
had with the socket thing.

I'm also not sure what to do about the ulimit issue with the stack.

-- 
   One Emacs to rule them all.  One Emacs to find them,
   One Emacs to take commands and to the keystrokes bind them,

All other programming languages wish they were Lisp.
From: David Steuber
Subject: Re: SLIME ming SBCL on OS X
Date: 
Message-ID: <m2brs73cdy.fsf@verizon.net>
David Steuber <·············@verizon.net> writes:

> What did I miss?

I am getting much further than I used to.  After a rebuild of SBCL
that goes straight through, and a restart of Emacs, swank got built
and sbcl fired up when I did M-x slime.

Emacs then seems to go into a tight loop and becomes unresponsive.

Yay!

-- 
   One Emacs to rule them all.  One Emacs to find them,
   One Emacs to take commands and to the keystrokes bind them,

All other programming languages wish they were Lisp.
From: Brian Downing
Subject: Re: SLIME ming SBCL on OS X
Date: 
Message-ID: <nLYlb.11477$Fm2.7963@attbi_s04>
In article <··············@verizon.net>,
David Steuber  <·····@david-steuber.com> wrote:
> David Steuber <·············@verizon.net> writes:
> 
> > What did I miss?
> 
> I am getting much further than I used to.  After a rebuild of SBCL
> that goes straight through, and a restart of Emacs, swank got built
> and sbcl fired up when I did M-x slime.
> 
> Emacs then seems to go into a tight loop and becomes unresponsive.
> 
> Yay!

Check out CVS from about two days ago and try that.  Keep going back if
that doesn't work.  This bug was introduced recently.

-bcd
-- 
*** Brian Downing <bdowning at lavos dot net> 
From: David Steuber
Subject: Re: SLIME ming SBCL on OS X
Date: 
Message-ID: <m2ad7ro560.fsf@verizon.net>
Brian Downing <·············@lavos.net> writes:

> Check out CVS from about two days ago and try that.  Keep going back if
> that doesn't work.  This bug was introduced recently.

It looks like the powers that be fixed that bug.

No more updates for a while.

-- 
   One Emacs to rule them all.  One Emacs to find them,
   One Emacs to take commands and to the keystrokes bind them,

All other programming languages wish they were Lisp.
From: Luke Gorrie
Subject: Re: SLIME ming SBCL on OS X
Date: 
Message-ID: <lhvfqesywr.fsf@dodo.bluetail.com>
Brian Downing <·············@lavos.net> writes:

> In article <··············@verizon.net>,
> David Steuber  <·····@david-steuber.com> wrote:
> > [SLIME does some cruel and unusual things to Emacs]
> 
> Check out CVS from about two days ago and try that.  Keep going back if
> that doesn't work.  This bug was introduced recently.

Also, from the README:

  If you have bad luck, you may checkout a copy of SLIME that is
  completely broken, depending on what's happening in CVS at the
  time. To avoid this you can checkout from the CVS tag
  `FAIRLY-STABLE' like this:

      cvs <options> checkout -r FAIRLY-STABLE slime

The FAIRLY-STABLE tag is quite old most of the time, but I move it
each time we have a stable codebase and we're about to do something
Dangerous that's likely to break things for more than a few hours. So
hopefully it's fairly up-to-date at most of the times when the current
CVS version is broken.

But please post about your problem to the mailing list first. I fixed
Raymond's problem about 15 minutes after I read about it, but I don't
read usenet as often as mail.

Cheers,
Luke
From: David Steuber
Subject: Re: SLIME ming SBCL on OS X
Date: 
Message-ID: <m2brs6m6ww.fsf@verizon.net>
Luke Gorrie <····@bluetail.com> writes:

> Brian Downing <·············@lavos.net> writes:
> 
> > In article <··············@verizon.net>,
> > David Steuber  <·····@david-steuber.com> wrote:
> > > [SLIME does some cruel and unusual things to Emacs]
> > 
> > Check out CVS from about two days ago and try that.  Keep going back if
> > that doesn't work.  This bug was introduced recently.
> 
> Also, from the README:
> 
>   If you have bad luck, you may checkout a copy of SLIME that is
>   completely broken, depending on what's happening in CVS at the
>   time. To avoid this you can checkout from the CVS tag
>   `FAIRLY-STABLE' like this:
> 
>       cvs <options> checkout -r FAIRLY-STABLE slime
> 
> The FAIRLY-STABLE tag is quite old most of the time, but I move it
> each time we have a stable codebase and we're about to do something
> Dangerous that's likely to break things for more than a few hours. So
> hopefully it's fairly up-to-date at most of the times when the current
> CVS version is broken.
> 
> But please post about your problem to the mailing list first. I fixed
> Raymond's problem about 15 minutes after I read about it, but I don't
> read usenet as often as mail.

I understand the risk of using code out of CVS.  After all, it is
under active development.

I currently have some minor issues with e-mail that makes it less
convinient to use than I would like.  I'm sure that the issues are
temporary.  If I had an ongoing problem, I would have mailed to the
list.

Anyway, I managed to get a working version from whatever fixes were
done later in the day.  I'll probably not check out again unless I
run into problems.  I shall be wanting to familiarize myself with the
interface now.

Please don't feel put out or anything.  If I sounded at all critical
along the way, it wasn't intentional.  I'm just a neolisper trying to
make my way around the repl.

-- 
   One Emacs to rule them all.  One Emacs to find them,
   One Emacs to take commands and to the keystrokes bind them,

All other programming languages wish they were Lisp.