[net.emacs] Using GNU Emacs as an "edit server".

wesommer@ATHENA.MIT.EDU (03/05/86)

From: Bill Sommerfeld <wesommer@ATHENA.MIT.EDU>

Gnu Emacs is well known as being very slow to start up.  This makes it
rather inconvenient to use with systems which like to fork off their
own editors, such as notes, Berkeley mail, MH (without MH-RMAIL), and
innumerable other programs which assume that forking editors is a
"cheap" operation.

Recently, Rob Krawitz, Ron Newman, and I came up with an idea:
Have your emacs process sitting as a server, listening on a socket for
connections from a small client program.  I managed to implement this
this afternoon.  It's somewhat "crude" at this time; but it works.

The basic idea: You run a function in GNU Emacs (called
"server-start") which starts up a subprocess ("emacs-server") and
corresponding sentinel function.  The subprocess creates a UNIX domain
socket in your home directory, and listens for connections.  You then
(in a shell sitting somewhere), run the "client" program (called
"fast-emacs").  It connects to the socket, shoves its first argument
over, and waits for an answer.  The server then outputs the filename,
and stops itself.  This triggers the process sentinel function, which
looks up the filename in the buffer, and finds it.  You can then hit
C-C C-C in that buffer to quit out (which asks you "do you want to
save", and if so saves).  The server process is restarted, and then
tells the client that it is done, and the client exits.

It works quite well (only misfeature: you have to use absolute
pathnames for guaranteed success).

Needless to say, this hasn't a chance of working in its current form
on a non-BSD system.

For RMS: I'm mailing a tar format file of the system in a separate message.
You'll have to play with the install areas (don't forget to set the
server process name in server.el to match this).  Then just "make" and
"make install", and it should all work.

For you watchmakers: It's installed on Paris in the
/usr/unsupported/watchmkr area.  In gnuemacs, M-X load "server" to get it,
and run M-X server-start.

For the rest of you:  If you want it, I'll ship you the tar file (say
how you want it delivered).


					Bill Sommerfeld
					Student Systems Programmer
					MIT Project Athena

davidk@dartvax.UUCP (David C. Kovar) (03/06/86)

Is anyone else getting articles twice? I am on the info-gnu mailing
list and I read net.emacs. I tend to see four copies of each article,
two in each location. Is this happening to anyone else?

-- 
David C. Kovar    
    USNET:      {ihnp4|linus|decvax|cornell|astrovax}!dartvax!davidk%amber
    ARPA:	davidk%amber%dartmouth@csnet-relay
    CSNET:	davidk%amber@dartmouth

" It's the policies of debugging, it's the Programmer's Blues ...
  Programmer's Blues ... "