(if (string-match "[ \t]*&[ \t]*$" command)
;; Command ending with ampersand means asynchronous.
(progn
- (background (substring command 0 (match-beginning 0))))
+ (background (substring command 0 (match-beginning 0)) output-buffer))
(shell-command-on-region (point) (point) command output-buffer)))))
;; We have a sentinel to prevent insertion of a termination message
;; then replace that region with the output.
(progn (setq buffer-read-only nil)
(delete-region (max start end) (point-max))
- (delete-region (point-min) (max start end))
+ (delete-region (point-min) (min start end))
(setq exit-status
(call-process-region (point-min) (point-max)
shell-file-name t t nil