[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Run an external program on the file visited in current buffer and op
Re: Run an external program on the file visited in current buffer and open a new buffer with results
Tue, 18 Apr 2006 20:22:39 +0200
On Tue, 18 Apr 2006 10:12:13 -0400, Suttles, Andrew wrote:
> I use emacs to edit large data files which I submit to a computer
> program for analysis. My normal method of operation is to 1) edit the
> file in emacs, 2) close or minimize emacs, 3) run the program on the
> file in a shell window, 4) watch for program completion, then 5) view
> the output file in a new buffer.
Have you considered using compilation-mode? C-h f compile -> "Compile the
program including the current buffer. Default: run `make'.
Runs command, a shell command, in a separate process asynchronously
with output going to the buffer `*compilation*'".
I think M-x grep would work in the same way. Both of these can run any
programs, I guess, and gets their output into *compilation*/*grep* buffer.
So you can use them freely for anything. I use to run a batch file (.cmd on
MS Windows) using M-x compile (or M-x recompile!). See the Emacs manual for
more details: C-h F compile (on cvs Emacs).
Examining compilation-error-regexp-alist's usage can be useful also.
However I don' know if these can be used well in case your program doesn't
write to stdout... maybe you should run a batch file what sends the result
of your "main" program to the stdout...?
Also consult the emacs lisp manual at "Creating an Asynchronous Process"
(e.g. Functions start-process or start-process-shell-command).
- Re: Run an external program on the file visited in current buffer and open a new buffer with results,
Peter Tury <=