aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1995-08-12 09:22:04 +0000
committerRichard M. Stallman1995-08-12 09:22:04 +0000
commit6db3a963aba155d0d144413ea3a2890f6e8e3a80 (patch)
tree5cd3decf623fa0a3cb937f865b0b5f1f297fc692
parent3a0b426081a0f660238e063efdc482682efbb5f9 (diff)
downloademacs-6db3a963aba155d0d144413ea3a2890f6e8e3a80.tar.gz
emacs-6db3a963aba155d0d144413ea3a2890f6e8e3a80.zip
(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.
-rw-r--r--lisp/simple.el8
1 files 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)."
847 (read-from-minibuffer "Shell command on region: " 847 (read-from-minibuffer "Shell command on region: "
848 nil nil nil 848 nil nil nil
849 'shell-command-history))) 849 'shell-command-history)))
850 (list (region-beginning) (region-end) 850 (list (point) (mark)
851 string 851 string
852 current-prefix-arg 852 current-prefix-arg
853 current-prefix-arg))) 853 current-prefix-arg)))
@@ -855,7 +855,7 @@ In either case, the output is inserted after point (leaving mark after it)."
855 (and output-buffer 855 (and output-buffer
856 (not (or (bufferp output-buffer) (stringp output-buffer))))) 856 (not (or (bufferp output-buffer) (stringp output-buffer)))))
857 ;; Replace specified region with output from command. 857 ;; Replace specified region with output from command.
858 (let ((swap (and replace (< (point) (mark))))) 858 (let ((swap (and replace (< start end))))
859 ;; Don't muck with mark unless REPLACE says we should. 859 ;; Don't muck with mark unless REPLACE says we should.
860 (goto-char start) 860 (goto-char start)
861 (and replace (push-mark)) 861 (and replace (push-mark))
@@ -877,8 +877,8 @@ In either case, the output is inserted after point (leaving mark after it)."
877 ;; delete everything but the specified region, 877 ;; delete everything but the specified region,
878 ;; then replace that region with the output. 878 ;; then replace that region with the output.
879 (progn (setq buffer-read-only nil) 879 (progn (setq buffer-read-only nil)
880 (delete-region end (point-max)) 880 (delete-region (max start end) (point-max))
881 (delete-region (point-min) start) 881 (delete-region (point-min) (max start end))
882 (call-process-region (point-min) (point-max) 882 (call-process-region (point-min) (point-max)
883 shell-file-name t t nil 883 shell-file-name t t nil
884 shell-command-switch command) 884 shell-command-switch command)