Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!triceratops.cis.ohio-state.edu!karl From: karl@triceratops.cis.ohio-state.edu (Karl Kleinpaste) Newsgroups: comp.emacs Subject: Re: GNUemacs server/client mode Message-ID: Date: 8 Mar 89 13:36:03 GMT References: Sender: news@tut.cis.ohio-state.edu Organization: OSU Lines: 35 In-reply-to: gnb@bby.oz's message of 7 Mar 89 04:10:44 GMT In your .emacs, put this line: (server-edit) and thereafter, you can run `emacsclient /some/file/name' to edit files. It'll open a connection to the existing emacs, tell it what file to edit, and emacs will go get that file. Edit a while, and when you're done, type C-x # which will tell the (waiting) emacsclient that you're done. It is in your best interest to setenv EDITOR /usr/local/bin/emacsclient and so forth, so that programs which invoke editors on their own will do it The Right Way. (Of course, since you're a GNUS user, this may not matter much to you.) From emacs/lisp/server.el: ;;; Load this library and do M-x server-edit to enable Emacs as a server. ;;; Emacs runs the program ../etc/server as a subprocess ;;; for communication with clients. If there are no client buffers to edit, ;;; server-edit acts like (switch-to-buffer (other-buffer)) ;;; When some other program runs "the editor" to edit a file, ;;; "the editor" can be the Emacs client program ../etc/emacsclient. ;;; This program transmits the file names to Emacs through ;;; the server subprocess, and Emacs visits them and lets you edit them. ;;; Note that any number of clients may dispatch files to emacs to be edited. ;;; When you finish editing a Server buffer, again call server-edit ;;; to mark that buffer as done for the client and switch to the next ;;; Server buffer. When all the buffers for a client have been edited ;;; and exited with server-edit, the client "editor" will return ;;; to the program that invoked it. --Karl