From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Sanford Selznick Newsgroups: gmane.emacs.help Subject: Re: M-x indent-region Date: Tue, 06 May 2003 20:47:37 -0700 Organization: www.selznick.com Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <84k7d5kz3h.fsf@lucy.is.informatik.uni-duisburg.de> <84el3cuiqd.fsf@lucy.is.informatik.uni-duisburg.de> NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1052279571 5182 80.91.224.249 (7 May 2003 03:52:51 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 7 May 2003 03:52:51 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Wed May 07 05:52:49 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19DFyW-0001Jx-00 for ; Wed, 07 May 2003 05:52:12 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19DFx4-00068O-06 for gnu-help-gnu-emacs@m.gmane.org; Tue, 06 May 2003 23:50:42 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!nntp.cs.ubc.ca!nntp-relay.ihug.net!ihug.co.nz!west.cox.net!cox.net!p01!fed1read03.POSTED!see-message Original-Newsgroups: gnu.emacs.help User-Agent: MT-NewsWatcher/3.3b1 (PPC Mac OS X) Original-Lines: 25 Original-NNTP-Posting-Host: 68.0.153.214 Original-X-Complaints-To: abuse@cox.net Original-X-Trace: fed1read03 1052279255 68.0.153.214 (Tue, 06 May 2003 23:47:35 EDT) Original-NNTP-Posting-Date: Tue, 06 May 2003 23:47:35 EDT Original-Xref: shelby.stanford.edu gnu.emacs.help:112875 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:9370 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:9370 In article <84el3cuiqd.fsf@lucy.is.informatik.uni-duisburg.de>, kai.grossjohann@gmx.net (Kai Grossjohann) wrote: > Yeah. Maybe it helps to set a really long max line length, and to > tell it to honor existing newlines. > > But so far I've still only read the documentation, not tested it. > It's not important enough for me... Obviously. ;-) Here's how the final version ended up... emacs -batch -eval '(find-file "~/test")' -eval '(c-mode)' -eval '(indent-region (point-min) (point-max) nil)' -eval '(save-buffer)' -eval '(kill-buffer (current-buffer))' Where '~/test' is the file that will be wrapped in place, keeping all tokens on the line they started on. Note the '(c-mode)' in case the file doesn't end in a c-program extension. And note the third argument on indent-region, which I'm not entirely sure is necessary or not. But it's working fine. Thanks again for your help. -Sanford