Browse Source

babel: Fix bug in shell-command-on-region

Prior to this commit,

OUTPUT-BUFFER nil
REPLACE 'replace
ERROR-BUFFER 'current-buffer

resulted in stdout going with stderr to the current buffer, contra the
docstring. With this change stdout is discarded in this case. The
docstring does stipulate that stdout always should go to *Shell
Command Output*; this change does not make that happen in this case.
Dan Davison 15 years ago
parent
commit
4e9a2d4efd
1 changed files with 2 additions and 2 deletions
  1. 2 2
      contrib/babel/lisp/org-babel.el

+ 2 - 2
contrib/babel/lisp/org-babel.el

@@ -1125,7 +1125,7 @@ Fixes a bug in `tramp-handle-call-process-region'."
 				      error-buffer display-error-buffer)
   "Execute string COMMAND in inferior shell with region as input.
 
-A copy of the emacs 23.1.1 function.
+Fixes bugs in the emacs 23.1.1 version of `shell-command-on-region'
 
 Normally display output (if any) in temp buffer `*Shell Command Output*';
 Prefix arg means replace the region with it.  Return the exit code of
@@ -1209,7 +1209,7 @@ specifies the value of ERROR-BUFFER."
 	  (setq exit-status
 		(call-process-region start end shell-file-name t
 				     (if error-file
-					 (list t error-file)
+					 (list output-buffer error-file)
 				       t)
 				     nil shell-command-switch command))
 	  ;; It is rude to delete a buffer which the command is not using.