Mercurial > hg > xemacs-beta
diff lisp/process.el @ 377:d883f39b8495 r21-2b4
Import from CVS: tag r21-2b4
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:05:42 +0200 |
parents | cc15677e0335 |
children | 8626e4521993 |
line wrap: on
line diff
--- a/lisp/process.el Mon Aug 13 11:04:53 2007 +0200 +++ b/lisp/process.el Mon Aug 13 11:05:42 2007 +0200 @@ -245,6 +245,7 @@ (let ((buffer (get-buffer-create (or output-buffer "*Shell Command Output*"))) (success nil) + (exit-status nil) (directory default-directory)) (unwind-protect (if (eq buffer (current-buffer)) @@ -254,9 +255,10 @@ (progn (setq buffer-read-only nil) (delete-region (max start end) (point-max)) (delete-region (point-min) (max start end)) - (call-process-region (point-min) (point-max) - shell-file-name t t nil - shell-command-switch command) + (setq exit-status + (call-process-region (point-min) (point-max) + shell-file-name t t nil + shell-command-switch command)) (setq success t)) ;; Clear the output buffer, ;; then run the command with output there. @@ -266,9 +268,10 @@ ;; XEmacs change (setq default-directory directory) (erase-buffer)) - (call-process-region start end shell-file-name - nil buffer nil - shell-command-switch command) + (setq exit-status + (call-process-region start end shell-file-name + nil buffer nil + shell-command-switch command)) (setq success t)) ;; Report the amount of output. (let ((lines (save-excursion @@ -280,7 +283,9 @@ (if success (display-message 'command - "(Shell command completed with no output)")) + (if (eql exit-status 0) + "(Shell command succeeded with no output)" + "(Shell command failed with no output)"))) (kill-buffer buffer)) ((and success (= lines 1)) (message "%s"