From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Harry Putnam Newsgroups: gmane.emacs.help Subject: Re: Using indent program as filter to automatically view read-only C files Date: Fri, 03 Feb 2006 17:10:15 -0600 Organization: Still searching... Message-ID: <87u0bgqbs8.fsf@newsguy.com> References: <1138967200.247984.79880@f14g2000cwb.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1139016844 19168 80.91.229.2 (4 Feb 2006 01:34:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 4 Feb 2006 01:34:04 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Feb 04 02:34:03 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1F5CJF-0008RA-A2 for geh-help-gnu-emacs@m.gmane.org; Sat, 04 Feb 2006 02:33:54 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F5CMR-00055M-DX for geh-help-gnu-emacs@m.gmane.org; Fri, 03 Feb 2006 20:37:11 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1F5A80-0002YQ-9z for help-gnu-emacs@gnu.org; Fri, 03 Feb 2006 18:14:08 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1F5A7x-0002Wz-M7 for help-gnu-emacs@gnu.org; Fri, 03 Feb 2006 18:14:07 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F5A7x-0002Wi-3i for help-gnu-emacs@gnu.org; Fri, 03 Feb 2006 18:14:05 -0500 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1F5A71-0002gw-Dp for help-gnu-emacs@gnu.org; Fri, 03 Feb 2006 18:13:07 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1F5A4V-0000QC-Ea for help-gnu-emacs@gnu.org; Sat, 04 Feb 2006 00:10:32 +0100 Original-Received: from adsl-68-74-146-31.dsl.emhril.ameritech.net ([68.74.146.31]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 04 Feb 2006 00:10:31 +0100 Original-Received: from reader by adsl-68-74-146-31.dsl.emhril.ameritech.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 04 Feb 2006 00:10:31 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 15 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: adsl-68-74-146-31.dsl.emhril.ameritech.net User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:XsTOhf1rESgqPROFkCTGY5uoEsQ= 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:32988 Archived-At: Eli Zaretskii writes: > Take a look at format.el, it has a machinery to filter a file through > a program when Emacs visits the file. That machinery was invented for > a different purpose, but perhaps it is general enough to serve yours. > > Btw, Emacs itself can reindent, so one easy way og doing what you want > is to copy the contents of the file into another buffer, set its major > mode to C, and then reindent there. If the buffer has no file name, > you don't risk to overwrite the original files. This may be a little off the wall but after looking at format.el I could not tell if it can do something like format a log file when emacs opens one. Something like just formating each line to column 72 or such.