How do I speed up emacs output from an asynchronous shell-command? How do I speed up emacs output from an asynchronous shell-command? shell shell

How do I speed up emacs output from an asynchronous shell-command?


Like the documentation says, shell-command runs the command in an inferior shell, implying shell-mode. If you just want the output and none of the features, running the command with start-process may be closer to what you want.

(start-process "*verbose-app*" "*verbose-app*" "/bin/sh" "-c" "verbose-app")

Wrapping this into a function should not be too hard. You might want to look at how shell-command implements async commands; for example, it will ask whether it should terminate an existing process if you attempt to create one when another already exists. http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/simple.el#n2447 might be a good starting point. (In case the link goes bad, this is a link to inside defun shell-command, pointing to a a comment about handling the ampersand. If it's there, the command will be run asynchronously.)


If the command is that verbose, is there any use in capturing the full output in real time? Maybe you could run verbose-app > app.log in the background and then run something like while true; do tail -n50 app.log; sleep 1; done within emacs to keep updating the buffer to view the last few lines of the log file. Later when you want the full output you can open the log file in emacs.