(emacs)Command Example

Next: Resume Arguments Prev: Initial Options Up: Command Arguments

Command Argument Example

   Here is an example of using Emacs with arguments and options.  It
assumes you have a Lisp program file called `hack-c.el' which, when
loaded, performs some useful operation on current buffer, expected to be
a C program.

     emacs -batch foo.c -l hack-c -f save-buffer -kill > log

This says to visit `foo.c', load `hack-c.el' (which makes changes in
the visited file), save `foo.c' (note that `save-buffer' is the
function that `C-x C-s' is bound to), and then exit to the shell that
this command was done with.  The initial option `-batch' guarantees
there will be no problem redirecting output to `log', because Emacs
will not assume that it has a display terminal to work with.

automatically generated by info2www