]> git.eshelyaron.com Git - emacs.git/commitdiff
(compile-internal): On systems with no asynchronous
authorRichard M. Stallman <rms@gnu.org>
Sat, 23 Dec 1995 07:13:31 +0000 (07:13 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 23 Dec 1995 07:13:31 +0000 (07:13 +0000)
processes: do relevant parts of compilation-sentinel after the
process exits; make modeline during and after compilation be
similar to what compilation-sentinel displays.

lisp/progmodes/compile.el

index b093158dceaa3e0d3d76a07346ea77991557b5f5..b4db10e3082f1c1f26968cd8af2a6958b82e6ae9 100644 (file)
@@ -436,10 +436,34 @@ Returns the compilation buffer created."
                    (cons proc compilation-in-progress)))
          ;; No asynchronous processes available
          (message (format "Executing `%s'..." command))
+         ;; Fake modeline display as if `start-process' were run.
+         (setq mode-line-process ":run")
          (sit-for 0) ;; Force redisplay
          (let ((status (call-process shell-file-name nil outbuf nil "-c"
-                                     command))))
-         (message (format "Executing `%s'...done" command)))))
+                                     command))
+               finish-msg)
+           ;; Fake modeline after exit.
+           (setq mode-line-process
+                 (cond ((numberp status) (format ":exit[%d]" status))
+                       ((stringp status) (format ":exit[-1: %s]" status))
+                       (t ":exit[???]")))
+           ;; Call `compilation-finish-function' as `compilation-sentinel'
+           ;; would, and finish up the compilation buffer with the same
+           ;; message we would get from `start-process'.
+           (setq finish-msg
+                 (if (numberp status)
+                     (if (zerop status)
+                         "finished\n"
+                       (format "exited abnormally with code %d\n" status))
+                   "exited abnormally with code -1\n"))
+           (goto-char (point-max))
+           (insert "\nCompilation " finish-msg)
+           (forward-char -1)
+           (insert " at " (substring (current-time-string) 0 19)) ; no year
+           (forward-char 1)
+           (if compilation-finish-function
+               (funcall compilation-finish-function outbuf finish-msg)))
+       (message (format "Executing `%s'...done" command)))))
     ;; Make it so the next C-x ` will use this buffer.
     (setq compilation-last-buffer outbuf)))