From: Richard M. Stallman Date: Sat, 23 Dec 1995 07:13:31 +0000 (+0000) Subject: (compile-internal): On systems with no asynchronous X-Git-Tag: emacs-19.34~2041 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d3e568911541fcb1c10a4cbe26c875e30197cb7d;p=emacs.git (compile-internal): On systems with no asynchronous processes: do relevant parts of compilation-sentinel after the process exits; make modeline during and after compilation be similar to what compilation-sentinel displays. --- diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index b093158dcea..b4db10e3082 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -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)))