all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Joakim Hove <hove@bccs.no>
Subject: Re: Emacs as a command line tool
Date: Tue, 17 Feb 2004 12:46:36 +0100	[thread overview]
Message-ID: <4y4qtqc4ir.fsf@skjellgran.ii.uib.no> (raw)
In-Reply-To: c0ssnd$hvr$1@news.net.uni-c.dk


David Rasmussen <david.rasmussen@gmx.net> 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     /
  \--------------------------------------------------------------------/

  reply	other threads:[~2004-02-17 11:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-17 10:54 Emacs as a command line tool David Rasmussen
2004-02-17 10:57 ` Billy O'Connor
2004-02-17 11:08   ` David Rasmussen
2004-02-17 15:16     ` Pascal Bourguignon
2004-02-17 16:02       ` David Rasmussen
2004-02-17 17:06         ` Pascal Bourguignon
2004-02-19  0:29           ` Kevin Rodgers
2004-02-17 11:14 ` Roodwriter
2004-02-17 11:19   ` David Rasmussen
2004-02-17 11:46     ` Joakim Hove [this message]
2004-02-17 12:06       ` David Rasmussen
2004-02-17 13:20         ` expand tabs in a shell Bruce Ingalls
2004-02-17 17:24           ` Bruce Ingalls
2004-02-19  7:01         ` Emacs as a command line tool Roodwriter
2004-02-17 13:35 ` Floyd Davidson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4y4qtqc4ir.fsf@skjellgran.ii.uib.no \
    --to=hove@bccs.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.