www.delorie.com/gnu/docs/emacs/emacs_531.html   search  
 
Buy the book!


GNU Emacs Manual

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

AE.3 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 the current buffer, expected to be a C program.

 
emacs -batch foo.c -l hack-c -f save-buffer >& 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 back to the shell (because of `-batch'). `-batch' also guarantees there will be no problem redirecting output to `log', because Emacs will not assume that it has a display terminal to work with.


  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003