in reply to Re: Use perl to drive emacs
in thread Use perl to drive emacs

Thanks, that's great. Is it possible to do this dynamically? i.e., I don't have the lisp_file before hand, and would like to decide what to do at runtime. For example, is it possible to run emacs as a server, listening on a port, and I can send it commands over the socket, and see its result on the file on the screen display? Thanks again.

Replies are listed 'Best First'.
Re^3: Use perl to drive emacs
by kvale (Monsignor) on Feb 21, 2005 at 06:11 UTC
    To use emacs as a server, look into gnuserv. From the manpage:
    gnuclient allows the user to request a running emacs pro- cess to edit the named files or directories and/or evalu- ate lisp forms. Depending on your environment, it can be an X frame or a TTY frame. One typical use for this is with a dialup connection to a machine on which an emacs process is currently running. gnuserv is the server program that is set running by emacs to handle all incoming and outgoing requests. It is not usually invoked directly, but is started from emacs by loading the gnuserv package and evaluating the Lisp form (gnuserv-start).
    Using gnuserv and gnuclient also addresses Aristotle's concern about the heavy startup costs of invoking emacs for each separate command.

    -Mark