In case you prefer to start an editor every time there is some editing to do,
we recommend you use MicroEmacs (mem),
vi or vim.
These editors are small and load quickly, and yet they
provide all the features you need for simple editing
(there are a couple of other editors which are not available on all systems,
such as EDT, PICO and JOVE).
However, GNU emacs can be a very useful tool if you know how to use its features. One emacs process can edit many files, allowing you to switch between them. And one copy of GNU emacs takes less memory than three copies of MicroEmacs.
Now, this is all fine, but what if an editor is started automaticlly, e.g. from
a mailer like elm ? Well, you can make such programs use the
existing emacs, using a client-server protocol, implemented through the
emacsclient command and the -f server-start command
in Emacs.
To make the use of this system easier, Sfinx provides a command
Emacs (note the capital E !!)
which will show the appropriate behaviour in (almost) every case:
emacs. (It is assumed that
      you need this editor here, on this screen, even if another copy is
      running anywhere else)
  emacsclient program, passing the name
      of the file to be edited. If the server is running on another host (but
      on the same display), it is contacted through a remote shell.
      This works, as long as:
      /tmp), a local copy of
      emacs is started.
  .cshrc or .settings file:
setenv EDITOR Emacs alias emacs EmacsYou might also have to edit your
elm options (press o
in elm, then e to change the editor). The editor should be set to
$EDITOR.
NOTE: to tell emacs that you are finished with the client
buffer, use C-x # (server-edit). Of course you can re-bind this
function to a more convenient function key, e.g.
(global-set-key [f7] 'server-edit)
NOTE: If you intend to use Emacs from elm, make sure to tell elm to store its temporary files in a directory that is shared by all machines. To do this, include in ~/.elm/elmrc something like:
tmpdir = $HOME/Mail/tmp/
See also then Emacs (l), emacs (1) and emacsclient (1) man-pages.