I'd like to set up a function that does the equivalent of marking the whole buffer, and running C-u M-| to prompt for a command, pipe the buffer to the command and replace the buffer with the output. Then maybe set it to shift-f5 or something.
I've only got as far as this:
(defun shell-command-on-buffer ()
(interactive)
(mark-whole-buffer))
How can I do the rest?