Run a shell command when saving a buffer
Emacs Lisp
Switch branches/tags
Nothing to show
Pull request Compare This branch is even with mjsteger:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


This extension provides a way to connect updating a buffer with running a shell command. So you can have a shell script which makes and runs a c program, and then you would M-x watch-buffer, enter the shell script to run, and every time you save the file it will run the shell script asynchronously in a seperate buffer.

Commands currently supported:

watch-buffer, which will prompt at the minibuffer for a command, and then run that command in the shell every time the buffer is saved, and pop up a buffer showing the results

watch-buffer-silently, which will do the same thing, but will not pop up a buffer

watch-buffer-elisp, which will run arbitrary elisp when the file is saved

watch-buffer-compile, which seeks to provide a do-what-I-mean compilation for files. For example, invoking watch-buffer-compile on a python file will run that python file with whatever argv is supplied every time the file is saved

New commands can be easily added in watch-buffer.el: Simply add a cons cell into watch-buffer-types with the format
(tag . (name-to-call-from-M-x command-to-run-on-save)). For example, watch-buffer is defined as:
("watch-buffer" . (watch-buffer watch-buffer-async-shell-command))
where watch-buffer-async-shell-command is simply async-shell-command with the buffer name already supplied as "*Watch-Process*"

If you have any feature requests, bugs, or comments, feel free create an issue or send me an email