aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/simple.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index aec30025f35..f8f676e59b0 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -732,13 +732,15 @@ This cannot be done asynchronously."
732 (unwind-protect 732 (unwind-protect
733 (progn 733 (progn
734 (set-buffer buffer) 734 (set-buffer buffer)
735 (setq opoint (point)) 735 (or (= (point) (point-max))
736 (setq opoint (point)))
736 (goto-char (point-max)) 737 (goto-char (point-max))
737 (insert-before-markers string)) 738 (insert-before-markers string))
738 ;; insert-before-markers moved this marker: set it back. 739 ;; insert-before-markers moved this marker: set it back.
739 (set-window-start window pos) 740 (set-window-start window pos)
740 ;; Finish our save-excursion. 741 ;; Finish our save-excursion.
741 (goto-char opoint) 742 (if opoint
743 (goto-char opoint))
742 (set-buffer obuf)))) 744 (set-buffer obuf))))
743 745
744(defun shell-command-on-region (start end command &optional flag interactive) 746(defun shell-command-on-region (start end command &optional flag interactive)