From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Pascal Bourguignon Newsgroups: gmane.emacs.help Subject: Re: running emacs in batch mode Date: Sat, 03 Feb 2007 23:16:23 +0100 Organization: Informatimago Message-ID: <87ps8qubt4.fsf@thalassa.informatimago.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1170542432 16287 80.91.229.12 (3 Feb 2007 22:40:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 3 Feb 2007 22:40:32 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Feb 03 23:40:24 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HDTYV-00059J-LL for geh-help-gnu-emacs@m.gmane.org; Sat, 03 Feb 2007 23:40:23 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HDTYW-0001nx-98 for geh-help-gnu-emacs@m.gmane.org; Sat, 03 Feb 2007 17:40:24 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news1.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 30 Original-X-Trace: individual.net nRtFuo2nBhPNy9W0JNDh2QOtUtPT4U5rp2asp3KMfRhWt5qhB9 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en X-Disabled: X-No-Archive: no User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux) Cancel-Lock: sha1:pcFajVlEuUKH6cUOpUhZUu3aV1Q= Original-Xref: shelby.stanford.edu gnu.emacs.help:145271 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:40877 Archived-At: Helfer Thomas 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