From 9a98fa641d6d3389d644272d0751d61f778486df Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Wed, 27 Feb 2002 23:03:34 +0000 Subject: [PATCH] (shell-command-on-region): Report non-zero exit status in mode line instead of buffer. --- lisp/ChangeLog | 5 +++++ lisp/simple.el | 13 +++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3814ef2262b..f979bcfcc25 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2002-02-28 Kim F. Storm + + * simple.el (shell-command-on-region): Report non-zero exit + status in mode line instead of buffer. + 2002-02-27 Richard M. Stallman * comint.el (comint-preoutput-filter-functions): Doc fix. diff --git a/lisp/simple.el b/lisp/simple.el index 6a0808c2cd6..676264dc31a 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -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 -- 2.39.2