unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* running emacs in batch mode
@ 2007-02-03 20:30 Helfer Thomas
  2007-02-06  7:31 ` Kevin Rodgers
  0 siblings, 1 reply; 4+ messages in thread
From: Helfer Thomas @ 2007-02-03 20:30 UTC (permalink / raw)
  To: help-gnu-emacs

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 ?

Thanks,

Helfer Thomas

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: running emacs in batch mode
       [not found] <mailman.3966.1170534615.2155.help-gnu-emacs@gnu.org>
@ 2007-02-03 22:16 ` Pascal Bourguignon
  2007-02-14 12:55 ` Peter Tury
  1 sibling, 0 replies; 4+ messages in thread
From: Pascal Bourguignon @ 2007-02-03 22:16 UTC (permalink / raw)
  To: help-gnu-emacs

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: running emacs in batch mode
  2007-02-03 20:30 running emacs in batch mode Helfer Thomas
@ 2007-02-06  7:31 ` Kevin Rodgers
  0 siblings, 0 replies; 4+ messages in thread
From: Kevin Rodgers @ 2007-02-06  7:31 UTC (permalink / raw)
  To: help-gnu-emacs

Helfer Thomas wrote:
> 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 ?

Use `C-h f' to see what arguments each function requires.

emacs --batch youpie.cxx --eval '(indent-region (point-min) 
(point-max))' --funcall save-buffer

-- 
Kevin Rodgers
Denver, Colorado, USA

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: running emacs in batch mode
       [not found] <mailman.3966.1170534615.2155.help-gnu-emacs@gnu.org>
  2007-02-03 22:16 ` Pascal Bourguignon
@ 2007-02-14 12:55 ` Peter Tury
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Tury @ 2007-02-14 12:55 UTC (permalink / raw)
  To: help-gnu-emacs

Maybe you also want to try "emacs --script FILE"?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-02-14 12:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-03 20:30 running emacs in batch mode Helfer Thomas
2007-02-06  7:31 ` Kevin Rodgers
     [not found] <mailman.3966.1170534615.2155.help-gnu-emacs@gnu.org>
2007-02-03 22:16 ` Pascal Bourguignon
2007-02-14 12:55 ` Peter Tury

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).