help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Running emacs lisp programs from command line or script


From: Kevin Rodgers
Subject: Re: Running emacs lisp programs from command line or script
Date: Thu, 11 Dec 2003 10:52:59 -0700
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2

Tim Heaney wrote:

Ryan Newton <address@hidden> writes:

If I want to make a command line invokable script to, say, convert
emacs enriched text documents to plain ones, how do I do it?  I want
emacs to start up, open said document, save it in plain text mode.
Easy to write the emacs lisp code, but how do I call it from the
command line.  What's the "batch" mode for emacs?


Batch. You can just run something like

  emacs -batch -l elispfile -f function inputfile

from the command line.


Note that command line action arguments (including files to visit) are
processed in order (see the Command Arguments and Action Arguments nodes
of the Emacs manual), so:

        emacs --batch TEXT_FILE -l ELISP_FILE -f FUNCTION -f save-buffer


--
Kevin Rodgers



reply via email to

[Prev in Thread] Current Thread [Next in Thread]