# HG changeset patch # User Richard M. Stallman # Date 808219324 0 # Node ID 7e28ff12e682ef909e793b1931de074d4ade5ab2 # Parent 9b1559218458b64ee9b8d720d85089cb275e24b9 (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. diff -r 9b1559218458 -r 7e28ff12e682 lisp/simple.el --- 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)