emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: shell-command-on-region


From: Richard Stallman
Subject: Re: shell-command-on-region
Date: Tue, 17 Aug 2004 21:34:34 -0400

Does this give you good results?

*** simple.el   16 Aug 2004 18:43:58 -0400      1.652
--- simple.el   17 Aug 2004 16:10:52 -0400      
***************
*** 1628,1634 ****
  
  (defun shell-command-on-region (start end command
                                      &optional output-buffer replace
!                                     error-buffer)
    "Execute string COMMAND in inferior shell with region as input.
  Normally display output (if any) in temp buffer `*Shell Command Output*';
  Prefix arg means replace the region with it.  Return the exit code of
--- 1628,1634 ----
  
  (defun shell-command-on-region (start end command
                                      &optional output-buffer replace
!                                     error-buffer interactive)
    "Execute string COMMAND in inferior shell with region as input.
  Normally display output (if any) in temp buffer `*Shell Command Output*';
  Prefix arg means replace the region with it.  Return the exit code of
***************
*** 1675,1681 ****
  or buffer name to which to direct the command's standard error output.
  If it is nil, error output is mingled with regular output.
  In an interactive call, the variable `shell-command-default-error-buffer'
! specifies the value of ERROR-BUFFER."
    (interactive (let (string)
                 (unless (mark)
                   (error "The mark is not set now, so there is no region"))
--- 1675,1682 ----
  or buffer name to which to direct the command's standard error output.
  If it is nil, error output is mingled with regular output.
  In an interactive call, the variable `shell-command-default-error-buffer'
! specifies the value of ERROR-BUFFER, and this command displays
! the error buffer if any text was output to it."
    (interactive (let (string)
                 (unless (mark)
                   (error "The mark is not set now, so there is no region"))
***************
*** 1691,1697 ****
                       string
                       current-prefix-arg
                       current-prefix-arg
!                      shell-command-default-error-buffer)))
    (let ((error-file
         (if error-buffer
             (make-temp-file
--- 1692,1699 ----
                       string
                       current-prefix-arg
                       current-prefix-arg
!                      shell-command-default-error-buffer
!                      t)))
    (let ((error-file
         (if error-buffer
             (make-temp-file
***************
*** 1800,1806 ****
              (format-insert-file error-file nil)
              ;; Put point after the inserted errors.
              (goto-char (- (point-max) pos-from-end)))
!           (display-buffer (current-buffer))))
        (delete-file error-file))
      exit-status))
  
--- 1802,1809 ----
              (format-insert-file error-file nil)
              ;; Put point after the inserted errors.
              (goto-char (- (point-max) pos-from-end)))
!           (and interactive
!                (display-buffer (current-buffer)))))
        (delete-file error-file))
      exit-status))
  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]