Path: utzoo!utgpu!water!watmath!uunet!tut.cis.ohio-state.edu!EDDIE.MIT.EDU!think!compass!worley From: think!compass!worley@EDDIE.MIT.EDU (Dale Worley) Newsgroups: gnu.emacs Subject: Whoops! Fix for shell-command-on-buffer Message-ID: <8810261557.AA19066@galaxy.compass.com> Date: 26 Oct 88 15:57:21 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 15 The definition I gave for shell-command-on-buffer didn't work if there was no mark set in the buffer. This should fix the problem: (defun shell-command-on-buffer (command &optional flag) "Execute string COMMAND in inferior shell with buffer as input; display output (if any) in temp buffer; Prefix arg means replace the buffer with it." (interactive "sShell command (on buffer): \nP") (if flag (progn (goto-char (point-min)) (push-mark (point-max)))) (shell-command-on-region (point-min) (point-max) command flag t)) Dale