emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/simple.el


From: Andreas Schwab
Subject: [Emacs-diffs] Changes to emacs/lisp/simple.el
Date: Sat, 29 Jun 2002 14:08:22 -0400

Index: emacs/lisp/simple.el
diff -c emacs/lisp/simple.el:1.553 emacs/lisp/simple.el:1.554
*** emacs/lisp/simple.el:1.553  Wed Jun 26 04:59:32 2002
--- emacs/lisp/simple.el        Sat Jun 29 14:08:22 2002
***************
*** 1466,1473 ****
        ;; No prefix argument: put the output in a temp buffer,
        ;; replacing its entire contents.
        (let ((buffer (get-buffer-create
!                    (or output-buffer "*Shell Command Output*")))
!           (success nil))
        (unwind-protect
            (if (eq buffer (current-buffer))
                ;; If the input is the same buffer as the output,
--- 1466,1472 ----
        ;; No prefix argument: put the output in a temp buffer,
        ;; replacing its entire contents.
        (let ((buffer (get-buffer-create
!                    (or output-buffer "*Shell Command Output*"))))
        (unwind-protect
            (if (eq buffer (current-buffer))
                ;; If the input is the same buffer as the output,
***************
*** 1499,1510 ****
                                             (list buffer error-file)
                                           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
              (display-message-or-buffer buffer)
--- 1498,1512 ----
                                             (list buffer error-file)
                                           buffer)
                                         nil shell-command-switch command)))
          ;; Report the output.
          (with-current-buffer buffer
            (setq mode-line-process 
!                 (cond ((null exit-status)
!                        " - Error")
!                       ((stringp exit-status)
!                        (format " - Signal [%s]" exit-status))
!                       ((not (equal 0 exit-status))
!                        (format " - Exit [%d]" exit-status)))))
          (if (with-current-buffer buffer (> (point-max) (point-min)))
              ;; There's some output, display it
              (display-message-or-buffer buffer)
***************
*** 1514,1524 ****
                            (< 0 (nth 7 (file-attributes error-file))))
                       "some error output"
                     "no output")))
!             (if (equal 0 exit-status)
!                 (message "(Shell command succeeded with %s)"
!                          output)
!               (message "(Shell command failed with code %d and %s)"
!                        exit-status output)))
            ;; Don't kill: there might be useful info in the undo-log.
            ;; (kill-buffer buffer)
            ))))
--- 1516,1532 ----
                            (< 0 (nth 7 (file-attributes error-file))))
                       "some error output"
                     "no output")))
!             (cond ((null exit-status)
!                    (message "(Shell command failed with error)"))
!                   ((equal 0 exit-status)
!                    (message "(Shell command succeeded with %s)"
!                             output))
!                   ((stringp exit-status)
!                    (message "(Shell command killed by signal %s)"
!                             exit-status))
!                   (t
!                    (message "(Shell command failed with code %d and %s)"
!                             exit-status output))))
            ;; Don't kill: there might be useful info in the undo-log.
            ;; (kill-buffer buffer)
            ))))



reply via email to

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