[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: piping through emacs from shell
From: |
Kevin Rodgers |
Subject: |
Re: piping through emacs from shell |
Date: |
Wed, 23 Jul 2003 17:39:08 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 |
Shaddin Doghmi wrote:
I have an executable that makes some formatted parenthesized output to
stdout. The output from that executable is unindented and ugly, but
looks nice when indented in emacs latex mode. I have an indent-all
function defined in my .emacs that indents an entire buffer. Now, what i
want is for the executable to pipe its output through emacs somehow, and
get it back all indented nicely, without me actually interactively
opening up an emacs window and executing the indent-all function. is
there anyway i can "use" emacs uninteractively in a pipe like this?
Sure, but you'll have to use a temporary file:
make-formatted-parenthesized-output |
{
cat > /tmp/unique-file-name &&
emacs --batch /tmp/unique-file-name -f latex-mode -f indent-all -f save-buffer
&&
cat /tmp/unique-file-name
} |
do-something-with-indented-output
--
Kevin Rodgers