From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Joakim Hove Newsgroups: gmane.emacs.help Subject: Re: Emacs as a command line tool Date: Tue, 17 Feb 2004 12:46:36 +0100 Organization: University of Bergen Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <4y4qtqc4ir.fsf@skjellgran.ii.uib.no> References: <1033tptqvoesicc@corp.supernews.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1077018584 1537 80.91.224.253 (17 Feb 2004 11:49:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 17 Feb 2004 11:49:44 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Feb 17 12:49:31 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1At3jH-0003r2-00 for ; Tue, 17 Feb 2004 12:49:31 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1At3ig-00075a-0v for geh-help-gnu-emacs@m.gmane.org; Tue, 17 Feb 2004 06:48:54 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed1.e.nsc.no!nsc.no!nextra.com!uio.no!nntp.uib.no!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 47 Original-NNTP-Posting-Host: skjellgran.ii.uib.no Original-X-Trace: toralf.uib.no 1077018175 15668 129.177.20.52 (17 Feb 2004 11:42:55 GMT) Original-X-Complaints-To: abuse@uib.no Original-NNTP-Posting-Date: 17 Feb 2004 11:42:55 GMT User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux) Cancel-Lock: sha1:1/IHXYKyHKq+dFUhtCg8zN5ccbw= Original-Xref: shelby.stanford.edu gnu.emacs.help:120985 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:16934 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:16934 David Rasmussen writes: > I considered that, but it just outputs the results to stdout, which > makes it hard to use in batch runs. Or am I missing something? Well, how about redirection: expand file > tmp_file ; mv tmp_file file Here is an e-lisp solution: (defun untabify-file (file) (find-file file) (untabify (point-min) (point-max)) (save-buffer) (kill-buffer (current-buffer))) (defun untabify-script () (interactive) (dolist (file command-line-args-left) (untabify-file file))) which can be invoked as follows: bash% emacs -f untabify-script file1 file2 file3 .... But, as you can see the use of emacs from the command-line will typically require some lisp programming to write wrappers around the emacs functions, like e.g. the function (untabify) HTH - Joakim -- /--------------------------------------------------------------------\ / Joakim Hove / hove@bccs.no / (55 5) 84076 | \ | Unifob AS, Avdeling for Beregningsvitenskap (BCCS) | Stabburveien 18 | | CMU | 5231 Paradis | \ Thormøhlensgt.55, 5020 Bergen. | 55 91 28 18 / \--------------------------------------------------------------------/