Search code examples
shellemacselisp

Emacs and Long Shell Commands


Is there a way to run a shell command, have the output show up in a new buffer and have that output show up incrementally? Eshell and other emacs terminal emulators do a find job of this but I see no way to script them.

What I'd like to do is write little elisp functions to do stuff like run unit tests, etc. and watch the output trickle into a buffer.

The elisp function shell-command is close to what I want but it shows all the output at once when the process finishes.


Solution

  • As doublep mentioned, there is M-x compile, and there's also just the simple M-x shell and in that shell you run whatever you want.