In GNU Emacs, I want to run a program, figlet, on the currently selected text. I then want to comment the region which is produced.
I have figured out how to do it using
I'm unsure what you're trying to accomplish with the pushing and popping of the marks, I believe you'd get the same functionality by doing this:
(defun figlet-region (&optional b e)
(interactive "r")
(shell-command-on-region b e "figlet")
(comment-region b e))
The argument to interactive tells Emacs to pass the region (point and mark) in as the first two arguments to the command.