From: Jonathan Siegel
Subject: One lisp many emacs connections?
Date: 
Message-ID: <1HMiOQBi0iUO6NWtSGJqXFpap3JD@4ax.com>
Hi,

I am wondering if it is possible to start a lisp process on a machine
independent from an emacs session and then have many emacs sessions
connect to this process through the emacs-lisp interface (ELI). Right
now I believe one lisp process is started per emacs eli session, and I
am not sure what steps I need to take to modify this current setup. I
am using Solaris and RedHat OS's and Allegro CL.

Thanks,
Jonathan

From: Erik Naggum
Subject: Re: One lisp many emacs connections?
Date: 
Message-ID: <3167603062944137@naggum.no>
* Jonathan Siegel <···@scorekeep.com>
| I am wondering if it is possible to start a lisp process on a machine
| independent from an emacs session and then have many emacs sessions
| connect to this process through the emacs-lisp interface (ELI).

  I have been looking for ways to accomplish this myself.  After much
  chagrin and wasting of time, I settled for Lisp listeners reachable
  with ordinary Telnet sessions, and use those almost exclusively
  where I need "multi-port access", while Allegro CL runs under an
  Emacs in a screen that I normally stay detached from.

  The core problem is that ELI uses a separate channel to communicate
  signals and a few other situations that are hard to communicate
  in-band.  E.g., it would be confusing if Allegro CL wanted to open a
  new background stream to an Emacs buffer and it did so in the wrong
  Emacs.  How to communicate which Emacs to talk to is unsolved.

#:Erik
-- 
  If this is not what you expected, please alter your expectations.
From: ········@thcsv01.trafford.ford.com
Subject: Re: One lisp many emacs connections?
Date: 
Message-ID: <wkwvksqisz.fsf@thcsv01.trafford.ford.com>
Erik Naggum <····@naggum.no> writes:

> * Jonathan Siegel <···@scorekeep.com>
> | I am wondering if it is possible to start a lisp process on a machine
> | independent from an emacs session and then have many emacs sessions
> | connect to this process through the emacs-lisp interface (ELI).
> 
>   I have been looking for ways to accomplish this myself.  After much
>   chagrin and wasting of time, I settled for Lisp listeners reachable
>   with ordinary Telnet sessions, and use those almost exclusively
>   where I need "multi-port access", while Allegro CL runs under an
>   Emacs in a screen that I normally stay detached from.
> 
>   The core problem is that ELI uses a separate channel to communicate
>   signals and a few other situations that are hard to communicate
>   in-band.  E.g., it would be confusing if Allegro CL wanted to open a
>   new background stream to an Emacs buffer and it did so in the wrong
>   Emacs.  How to communicate which Emacs to talk to is unsolved.
> 
> #:Erik
> -- 
>   If this is not what you expected, please alter your expectations.

The Lucid Lisp distribution used to have something called a LEP-server
that let you remote connect from an Emacs session to the running Lisp
image.  I don't know if that code is still around and whether it managed
to solve any of the problems you mention.

Guy.
From: Jonathan Siegel
Subject: Re: One lisp many emacs connections?
Date: 
Message-ID: <HvAlOZhUmkJY2GiG8Cv8YqhDSdKg@4ax.com>
Erik,

Thank you for this reponse. You mention opening up telnet sessions to
the main lisp process. I remember seeing this code in a posting
before, but cannot seem to find it. Any chance you wouldn't mind
posting a snippit if you have one handy?

Thanks again,
Jonathan


On 18 May 2000 01:44:22 +0000, Erik Naggum <····@naggum.no> wrote:

>* Jonathan Siegel <···@scorekeep.com>
>| I am wondering if it is possible to start a lisp process on a machine
>| independent from an emacs session and then have many emacs sessions
>| connect to this process through the emacs-lisp interface (ELI).
>
>  I have been looking for ways to accomplish this myself.  After much
>  chagrin and wasting of time, I settled for Lisp listeners reachable
>  with ordinary Telnet sessions, and use those almost exclusively
>  where I need "multi-port access", while Allegro CL runs under an
>  Emacs in a screen that I normally stay detached from.
>
>  The core problem is that ELI uses a separate channel to communicate
>  signals and a few other situations that are hard to communicate
>  in-band.  E.g., it would be confusing if Allegro CL wanted to open a
>  new background stream to an Emacs buffer and it did so in the wrong
>  Emacs.  How to communicate which Emacs to talk to is unsolved.
>
>#:Erik
From: Christian Lynbech
Subject: Re: One lisp many emacs connections?
Date: 
Message-ID: <ofln0yu041.fsf@chl.tbit.dk>
>>>>> "Jonathan" == Jonathan Siegel <···@scorekeep.com> writes:

Jonathan> I am wondering if it is possible to start a lisp process on
Jonathan> a machine independent from an emacs session and then have
Jonathan> many emacs sessions connect to this process through the
Jonathan> emacs-lisp interface (ELI).

Others have commented that this is not easily done directly through
the ELI interface itself, but something superficially like it could be
achieved the other way around, so to say.

Rather than having multiple emacs', you could have one emacs and
multiple frames (on different displays). Emacs has a nifty function
called `make-frame-on-display' which can be used to open frames on
another host (running X).

It is also quite simple to make some code that is able to trigger an
emacs into doing something active, kind of like `emacsclient' only
executing code rather than just specifying a file to read in (I did it
some years back, may even still have the source somewhere).

Using this you could trigger a remotely running emacs to open a frame
on your display, starting a new listener towards the existing ACL
(which the ELI can do).

Obviously, this is not quite as good as the real thing, especially if
two different people wants to connect to the lisp (it will work, but
they need to be conscious about what they do to the emacs), but if one
does not to quit ones emacs at work, but still connect from home, it
could a sensible thing to do.

Obviously, there are a bunch of security issues if not within a safe
and trusted environment, but I'll leave those as exercises for the
reader :-)


---------------------------+--------------------------------------------------
Christian Lynbech          | Ericsson Telebit, Fabrikvej 11, DK-8260 Viby J  
Fax:   +45 8675 6881       | email: ···@ericssontelebit.com
Phone: +45 8675 6828       | web:   www.ericssontelebit.com
---------------------------+--------------------------------------------------
Hit the philistines three times over the head with the Elisp reference manual.
                                        - ·······@hal.com (Michael A. Petonic)
From: Tim Bradshaw
Subject: Re: One lisp many emacs connections?
Date: 
Message-ID: <ey3itw28vsy.fsf@cley.com>
* Christian Lynbech wrote:


> It is also quite simple to make some code that is able to trigger an
> emacs into doing something active, kind of like `emacsclient' only
> executing code rather than just specifying a file to read in (I did it
> some years back, may even still have the source somewhere).

gnuclient (which may or may not be the same thing as emacsclient) can
do this.  It's bundled with xemacs, I don't know about fsf emacs.

--tim
From: Daniel Barlow
Subject: Re: One lisp many emacs connections?
Date: 
Message-ID: <878zwy5s77.fsf@tninkpad.telent.net>
Christian Lynbech <···@ericssontelebit.com> writes:

> Rather than having multiple emacs', you could have one emacs and
> multiple frames (on different displays). Emacs has a nifty function
> called `make-frame-on-display' which can be used to open frames on
> another host (running X).

Unfortunately it's not as bulletproof as it could be.  If the network
connection to one of its displays goes away, emacs will dump core and
die anything up to half an hour later.  This is an xlib problem not an
emacs problem

Manual page XSetErrorHandler(3x):

       The XSetIOErrorHandler sets the fatal I/O error handler.
       Xlib calls the program's supplied error handler if any
       sort of system call error occurs (for example, the connec�
       tion to the server was lost).  This is assumed to be a
       fatal condition, and the called routine should not return.

Unless anyone knows different, anyway.  I'd be very happy to be
corrected; I'd love to be able to export a frame from my laptop's
emacs to my work box, without having the thing die when I get home.

-dan
From: Bulent Murtezaoglu
Subject: Re: One lisp many emacs connections?
Date: 
Message-ID: <87k8giqqe6.fsf@kapi.internal>
[...]
    DB> Unless anyone knows different, anyway.  I'd be very happy to
    DB> be corrected; I'd love to be able to export a frame from my
    DB> laptop's emacs to my work box, without having the thing die
    DB> when I get home.

You can approximate this behaviour by vnc (http://www.uk.research.att.com/vnc/)
which runs the X server on the laptop and can send the display to 
wherever you want.  You don't lose your state or the Xserver unless the 
laptop goes down.  

(incf *OT-cll-posts-by-BM*)
From: Paul Foley
Subject: Re: One lisp many emacs connections?
Date: 
Message-ID: <m2u2fmkok5.fsf@mycroft.actrix.gen.nz>
On 25 May 2000 17:21:18 +0200, Christian Lynbech wrote:

>>>>>> "Jonathan" == Jonathan Siegel <···@scorekeep.com> writes:
Jonathan> I am wondering if it is possible to start a lisp process on
Jonathan> a machine independent from an emacs session and then have
Jonathan> many emacs sessions connect to this process through the
Jonathan> emacs-lisp interface (ELI).

> Others have commented that this is not easily done directly through
> the ELI interface itself, but something superficially like it could be

You can do something like

  (autoload 'fi::make-tcp-connection "fi-site-init" nil t)

  (defun open-lisp-listener (&optional buffer-name host port password
                                       ipc-version)
    (fi::make-tcp-connection (or buffer-name "lisp-listener")
                             -1
                             'fi:lisp-listener-mode
                             fi:common-lisp-prompt-pattern
                             (or host fi::lisp-host)
                             (or port fi::lisp-port)
                             (or password fi::lisp-password)
                             (or ipc-version fi::lisp-ipc-version 1)
                             'fi::setup-tcp-connection))

and use, e.g., (open-lisp-listener "*ACL*" "localhost" 1025 123456) to 
open a new connection to ACL.  [The port and password are the first two 
values returned by START-EMACS-LISP-INTERFACE.]

[At least, this used to work on ACL 4.3 Trial Ed.; only seems to work
after running fi:common-lisp once, though...]

-- 
If that makes any sense to you, you have a big problem.
                                    -- C. Durance, Computer Science 234
(setq reply-to
  (concatenate 'string "Paul Foley " "<mycroft" '(··@) "actrix.gen.nz>"))