[slime-devel] Re: default connections

Knut Olav Bøhmer knut-olav.bohmer at telenor.com
Fri Sep 26 15:00:28 UTC 2008

Tobias C. Rittweiler wrote:
> Knut Olav Bøhmer <knut-olav.bohmer at telenor.com> writes:
>>> I just committed not to do that when we're inside a REPL buffer; but it
>>> doesn't make much sense for .lisp buffers either, or SLDB buffers, or
>>> the inspector, or..
>> Right, it does not make sense for REPL, SLDB or inspector. But as you
>> can see from the example above: It makes a lot of sense for .lisp files,
>> and I use it every day.
> I didn't understand your example. Perhaps you're looking for an extra
> command to make the current connection buffer-local in a buffer.
Ok, say stop where you fall off.
--- Example ---
I have two different lisp images running in one emacs. One
business-logic-image, and one web-server-image
There is one source file for image the business-logic-image (lets call
it the business-logic-file), and a different file for the
web-server-image (lets call it the web-server-file)
When I press C-x C-e in the business-logic-file, I want the lisp-form to
be evaluated in the business-logic-file
When I press C-x C-e in the web-server-file, I want the lisp-form to be
evaluated in the web-server-file
Then if I shall do a change in my system that requires changes in both
web-server and business-logic, then I have to change default connection,
at least once.
If the development-cycle requires several iterations. Either because I
want to improve the code, add features, or debug. I would have to change
default connection back and fourth several times.
Then it would be better to have the connection buffer-local, so I would
not have to change it in every development cycle.

And I  don't want to make the current default-connection buffer-local.
In my experience, this would require many more steps of interacting with
Emacs to get the desired result.
(step 1: selcect a different default-connection. Step 2: make it
buffer-local. Step 3: go to a different-buffer, that does not have a
buffer-local default-connection. Step 4: select the original
default-connection, to restore desired behaviour. So that we don't
forget this later. Step 5: jump back to the special customized buffer,
to complete your work)

I want a different connection from the current default-connection to be
the buffer-local default-connection.
The reason that I don't what the current default-connection to be
buffer-local, should be obvious. If I wanted to use the
default-connection, then I would not have to make it buffer-local.

> Slime-cycle-connections making the new connection buffer-local means for
> example that making another connection the default connection via
> slime-list-connections will lead to surprises.
There will be no surprises. You will anyway need to keep track of your
connection. You can do that by looking at the connection-name in the
mode-line. You will also have to have to know what kind of source-code
you are evaluating, then you would know which lisp-image it should be
evaluated in.
> Additionally, buffer-local connections can become stale, rendering the
> .lisp buffer useless.
If the buffer-local connection become sale, you will avoid running
lisp-commands in another random default connection.
You would then have to restart your lisp-image, or connect again. Then
select the connection as buffer-local for that buffer.
Anyway this is not an hindrance, to implement this functionality. It's
merely an interesting beginners hacking assignment, to
pop up buffer with the connection-list if the connection is broken.

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/slime-devel/attachments/20080926/9b2d004e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logo_horizontal.png
Type: image/png
Size: 7619 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/slime-devel/attachments/20080926/9b2d004e/attachment.png>

More information about the slime-devel mailing list