[comp.windows.x] X10 1, GNUemacs 0

jtkohl@ATHENA.MIT.EDU (John T Kohl) (04/19/87)

	From: bob@wiley.UUCP (Bob Amstadt)
	Message-ID: <477@diva.UUCP>
	Date: 18 Apr 87 21:32:06 GMT
	References: <50@ksr.UUCP> <58@ksr.UUCP>
	In-reply-to: benson@ksr.UUCP's message of 15 Apr 87 20:40:14 GMT
	
	>   Third, when I want to use emacs for my editor when posting from rn,
	>   I have to go supply a window size from the mouse, which is a pain.
	
	I don't know anything about rn, but unless the geometry is provided to
	GNU emacs, it will need to be placed. I personally prefer to use GNU emacs
>	as an environment where I read news, read mail, and edit. My experience
>	tells me that GNU emacs is not a good editor for invoking from another
>	program to do quick editing. GNU emacs is huge and takes too long
	to load for that purpose. It seems to me that it would be better to
	start in emacs and deal with news and mail from within emacs.
	
	                Bob Amstadt

If you have version 18 and BSD, you can use a small stub program to talk
to your emacs via a unix-domain socket.  Here's the relevant portion of
the NEWS file:

* Existing Emacs usable as a server.

Programs such as mailers that invoke "the editor" as an inferior
to edit some text can now be told to use an existing Emacs process
instead of creating a new editor.

To do this, you must have an Emacs process running and capable of
doing terminal I/O at the time you want to invoke it.  This means that
either you are using a window system and give Emacs a separate window
or you run the other programs as inferiors of Emacs (such as, using
M-x shell).

First prepare the existing Emacs process by loading the `server'
library and executing M-x server-start.  (Your .emacs can do this
automatically.)

Now tell the other programs to use, as "the editor", the Emacs client
program (etc/emacsclient, located in the same directory as this file).
This can be done by setting the environment variable EDITOR.

When another program invokes the emacsclient as "the editor", the
client actually transfers the file names to be edited to the existing
Emacs, which automatically visits the files.

When you are done editing a buffer for a client, do C-x # (server-edit).
This marks that buffer as done, and selects the next buffer that the client
asked for.  When all the buffers requested by a client are marked in this
way, Emacs tells the client program to exit, so that the program that
invoked "the editor" will resume execution.

You can only have one server Emacs at a time, but multiple client programs
can put in requests at the same time.

The client/server work only on Berkeley Unix, since they use the Berkeley
sockets mechanism for their communication.

-----
John Kohl
MIT/Project Athena

pdg@ihdev.ATT.COM (Joe Isuzu) (04/20/87)

In article <8704191746.AA00326@BINKLEY.MIT.EDU> jtkohl@ATHENA.MIT.EDU (John T Kohl) writes:
>The client/server work only on Berkeley Unix, since they use the Berkeley
>sockets mechanism for their communication.


Wrong.  I wrote a system V version using message queues.  It works
(naturally) only on the local machine, though.  A streams based
version may be available soon.  Send mail to the address in the
signature for more information/the code.  (I'm using it right now for
the same purpose the original poster wanted -  rn invokes the client
to call emacs).
-- 

Paul Guthrie
ihnp4!ihdev!pdg			This Brain left intentionally blank.