mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-26 19:18:50 +00:00
(shell-command-on-region): Report non-zero exit
status in mode line instead of buffer.
This commit is contained in:
parent
458a481004
commit
9a98fa641d
@ -1,3 +1,8 @@
|
||||
2002-02-28 Kim F. Storm <storm@cua.dk>
|
||||
|
||||
* simple.el (shell-command-on-region): Report non-zero exit
|
||||
status in mode line instead of buffer.
|
||||
|
||||
2002-02-27 Richard M. Stallman <rms@gnu.org>
|
||||
|
||||
* comint.el (comint-preoutput-filter-functions): Doc fix.
|
||||
|
@ -1475,16 +1475,13 @@ specifies the value of ERROR-BUFFER."
|
||||
nil shell-command-switch command)))
|
||||
(setq success (and exit-status (equal 0 exit-status)))
|
||||
;; Report the output.
|
||||
(with-current-buffer buffer
|
||||
(setq mode-line-process
|
||||
(if (not success)
|
||||
(concat (format " - Exit [%d]" exit-status)))))
|
||||
(if (with-current-buffer buffer (> (point-max) (point-min)))
|
||||
;; There's some output, display it
|
||||
(progn
|
||||
(if (not success)
|
||||
(with-current-buffer buffer
|
||||
(save-excursion
|
||||
(goto-char (point-max))
|
||||
(insert (format "...Shell command failed with code %d"
|
||||
exit-status)))))
|
||||
(display-message-or-buffer buffer))
|
||||
(display-message-or-buffer buffer)
|
||||
;; No output; error?
|
||||
(let ((output
|
||||
(if (and error-file
|
||||
|
Loading…
Reference in New Issue
Block a user