I would like to set up a function that performs the equivalent of marking the entire buffer, and run C-u M-|to request a command, pass the buffer to the command and replace the buffer with the output. Then maybe set it to shift-f5 or something like that.
I just got to this:
(defun shell-command-on-buffer ()
(interactive)
(mark-whole-buffer))
How can I do the rest?
source
share