Skip to content

Run a shell command when saving a buffer

Notifications You must be signed in to change notification settings

emacsmirror/watch-buffer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published

Languages

  • Emacs Lisp 100.0%