diff lisp/prim/process.el @ 48:56c54cf7c5b6 r19-16b90

Import from CVS: tag r19-16b90
author cvs
date Mon, 13 Aug 2007 08:56:04 +0200
parents 0293115a14e9
children 131b0175ea99
line wrap: on
line diff
--- a/lisp/prim/process.el	Mon Aug 13 08:55:32 2007 +0200
+++ b/lisp/prim/process.el	Mon Aug 13 08:56:04 2007 +0200
@@ -160,7 +160,7 @@
 	  (progn
 	    (require 'background) ; whizzy comint background code
 	    (background (substring command 0 (match-beginning 0))))
-	(shell-command-on-region (point) (point) command nil)))))
+	(shell-command-on-region (point) (point) command output-buffer)))))
 
 ;; We have a sentinel to prevent insertion of a termination message
 ;; in the buffer itself.
@@ -192,19 +192,17 @@
 If OUTPUT-BUFFER is not a buffer and not nil,
 insert output in the current buffer.
 In either case, the output is inserted after point (leaving mark after it)."
-  (interactive (if (not (region-exists-p))
-		   (error "The region is not active now")
-		 (let ((string
+  (interactive (let ((string
 		      ;; Do this before calling region-beginning
 		      ;; and region-end, in case subprocess output
 		      ;; relocates them while we are in the minibuffer.
-			(read-shell-command "Shell command on region: ")))
-		   ;; call-interactively recognizes region-beginning and
-		   ;; region-end specially, leaving them in the history.
-		   (list (region-beginning) (region-end)
-			 string
-			 current-prefix-arg
-			 current-prefix-arg))))
+		      (read-shell-command "Shell command on region: ")))
+		 ;; call-interactively recognizes region-beginning and
+		 ;; region-end specially, leaving them in the history.
+		 (list (region-beginning) (region-end)
+		       string
+		       current-prefix-arg
+		       current-prefix-arg)))
   (if (or replace
 	  (and output-buffer
 	       (not (or (bufferp output-buffer) (stringp output-buffer)))))