I am writing a simple package for myself to try and learn some elisp - and to begin extending Emacs for my own personal workflow. This function processes the current buffer contents with a command line utility and pipes the output into a temporary buffer. This is what I have so far, and it processes the buffer as desired
(defun doStuff () (interactive) (with-output-to-temp-buffer "*stuffed*" (shell-command (..cli stuff here...) (pop-to-buffer "*stuffed*") )) )
What I'm looking for is a way to replace the contents of the current buffer, in such a way that if I press "q" it will revert to the original buffer contents. Can anyone give me some pointers on how I might go about that?