changeset 12838:7e28ff12e682

(shell-command-on-region): Don't examine order of point and mark; use order of START and END instead. Interactively pass point and mark, not region-beg and region-end.
author Richard M. Stallman <rms@gnu.org>
date Sat, 12 Aug 1995 09:22:04 +0000
parents 9b1559218458
children 40a12a81cc06
files lisp/simple.el
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/simple.el	Fri Aug 11 23:47:16 1995 +0000
+++ b/lisp/simple.el	Sat Aug 12 09:22:04 1995 +0000
@@ -847,7 +847,7 @@
 		      (read-from-minibuffer "Shell command on region: "
 					    nil nil nil
 					    'shell-command-history)))
-		 (list (region-beginning) (region-end)
+		 (list (point) (mark)
 		       string
 		       current-prefix-arg
 		       current-prefix-arg)))
@@ -855,7 +855,7 @@
 	  (and output-buffer
 	       (not (or (bufferp output-buffer) (stringp output-buffer)))))
       ;; Replace specified region with output from command.
-      (let ((swap (and replace (< (point) (mark)))))
+      (let ((swap (and replace (< start end))))
 	;; Don't muck with mark unless REPLACE says we should.
 	(goto-char start)
 	(and replace (push-mark))
@@ -877,8 +877,8 @@
 	      ;; delete everything but the specified region,
 	      ;; then replace that region with the output.
 	      (progn (setq buffer-read-only nil)
-		     (delete-region end (point-max))
-		     (delete-region (point-min) start)
+		     (delete-region (max start end) (point-max))
+		     (delete-region (point-min) (max start end))
 		     (call-process-region (point-min) (point-max)
 					  shell-file-name t t nil
 					  shell-command-switch command)