From 6db3a963aba155d0d144413ea3a2890f6e8e3a80 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 12 Aug 1995 09:22:04 +0000 Subject: [PATCH] (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. --- lisp/simple.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/simple.el b/lisp/simple.el index 809fd316b2c..38ae6528fd7 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -847,7 +847,7 @@ In either case, the output is inserted after point (leaving mark after it)." (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 @@ In either case, the output is inserted after point (leaving mark after it)." (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 @@ In either case, the output is inserted after point (leaving mark after it)." ;; 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) -- 2.39.2