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

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

Re: running emacs in batch mode


From: Pascal Bourguignon
Subject: Re: running emacs in batch mode
Date: Sat, 03 Feb 2007 23:16:23 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux)

Helfer Thomas <helferthomas@free.fr> writes:

> I want to use emacs to indent a lot of C++ files.
> I tried to do this :
>
> $ emacs --batch youpie.cxx -f mark-whole-buffer -f indent-region -f
> save-buffer 
>
> but didnot work. Can somebody tell me what I shall do ?

I would rather use a script file:

emacs --batch -q -l script.el

with script.el containing whatever you want, in emacs lisp, something
like:

(dolist (file (file-expand-wildcards "/home/ht/src/*.cxx"))
  (find-file file)
  (mark-whole-buffer)
  (indent-region (point-min) (point-max))
  (save-buffer 0)
  (kill-buffer (current-buffer)))

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

Pour moi, la grande question n'a jamais été: «Qui suis-je? Où vais-je?» 
comme l'a formulé si adroitement notre ami Pascal, mais plutôt: 
«Comment vais-je m'en tirer?» -- Jean Yanne


reply via email to

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