diff lisp/progmodes/compile.el @ 740:b39d858a0b19

*** empty log message ***
author Roland McGrath <roland@gnu.org>
date Sun, 05 Jul 1992 05:11:16 +0000
parents a8d94735277e
children cd00bdacc17b
line wrap: on
line diff
--- a/lisp/progmodes/compile.el	Sat Jul 04 16:51:02 1992 +0000
+++ b/lisp/progmodes/compile.el	Sun Jul 05 05:11:16 1992 +0000
@@ -68,6 +68,12 @@
   "The buffer in which the last compilation was started,
 or which was used by the last \\[next-error] or \\[compile-goto-error].")
 
+(defvar compilation-in-progress nil
+  "List of compilation processes now running.")
+(or (assq 'compilation-in-progress minor-mode-alist)
+    (setq minor-mode-alist (cons '(compilation-in-progress " Compiling")
+				 minor-mode-alist)))
+
 (defvar compilation-parsing-end nil
   "Position of end of buffer when last error messages were parsed.")
 
@@ -292,10 +298,11 @@
 				      (window-height))))
 	       (select-window w))))
       ;; Start the compilation.
-      (set-process-sentinel (start-process-shell-command (downcase mode-name)
-							 outbuf
-							 command)
-			    'compilation-sentinel))
+      (let ((proc (start-process-shell-command (downcase mode-name)
+					       outbuf
+					       command)))
+	(set-process-sentinel proc 'compilation-sentinel)
+	(setq compilation-in-progress (cons proc compilation-in-progress))))
     ;; Make it so the next C-x ` will use this buffer.
     (setq compilation-last-buffer outbuf)))
 
@@ -331,46 +338,48 @@
 (defun compilation-sentinel (proc msg)
   "Sentinel for compilation buffers."
   (let ((buffer (process-buffer proc)))
-    (cond ((null (buffer-name buffer))
-	   ;; buffer killed
-	   (set-process-buffer proc nil))
-	  ((memq (process-status proc) '(signal exit))
-	   (let ((obuf (current-buffer))
-		 omax opoint)
-	     ;; save-excursion isn't the right thing if
-	     ;; process-buffer is current-buffer
-	     (unwind-protect
-		 (progn
-		   ;; Write something in the compilation buffer
-		   ;; and hack its mode line.
-		   (set-buffer buffer)
-		   (setq buffer-read-only nil)
-		   (setq omax (point-max)
-			 opoint (point))
-		   (goto-char omax)
-		   ;; Record where we put the message, so we can ignore it
-		   ;; later on.
-		   (insert ?\n mode-name " " msg)
-		   (forward-char -1)
-		   (insert " at " (substring (current-time-string) 0 19))
-		   (forward-char 1)
-		   (setq mode-line-process
-			 (concat ": "
-				 (symbol-name (process-status proc))))
-		   ;; Since the buffer and mode line will show that the
-		   ;; process is dead, we can delete it now.  Otherwise it
-		   ;; will stay around until M-x list-processes.
-		   (delete-process proc))
-	       ;; Force mode line redisplay soon.
-	       (set-buffer-modified-p (buffer-modified-p))
-	       (setq buffer-read-only t))
-	     (if (and opoint (< opoint omax))
-		 (goto-char opoint))
-	     (set-buffer obuf)
-	     (if compilation-finish-function
-		 (funcall compilation-finish-function buffer msg))
-	     ))
-	  )))
+    (if (memq (process-status proc) '(signal exit))
+	(progn
+	  (if (null (buffer-name buffer))
+	      ;; buffer killed
+	      (set-process-buffer proc nil)
+	    (let ((obuf (current-buffer))
+		  omax opoint)
+	      ;; save-excursion isn't the right thing if
+	      ;; process-buffer is current-buffer
+	      (unwind-protect
+		  (progn
+		    ;; Write something in the compilation buffer
+		    ;; and hack its mode line.
+		    (set-buffer buffer)
+		    (setq buffer-read-only nil)
+		    (setq omax (point-max)
+			  opoint (point))
+		    (goto-char omax)
+		    ;; Record where we put the message, so we can ignore it
+		    ;; later on.
+		    (insert ?\n mode-name " " msg)
+		    (forward-char -1)
+		    (insert " at " (substring (current-time-string) 0 19))
+		    (forward-char 1)
+		    (setq mode-line-process
+			  (concat ": "
+				  (symbol-name (process-status proc))))
+		    ;; Since the buffer and mode line will show that the
+		    ;; process is dead, we can delete it now.  Otherwise it
+		    ;; will stay around until M-x list-processes.
+		    (delete-process proc)
+		    ;; Force mode line redisplay soon.
+		    (set-buffer-modified-p (buffer-modified-p))
+		    (setq buffer-read-only t) ;I think is this wrong --roland
+		    (if (and opoint (< opoint omax))
+			(goto-char opoint)))
+		(set-buffer obuf))
+	      (if compilation-finish-function
+		  (funcall compilation-finish-function buffer msg))
+	      ))
+	  (setq compilation-in-progress (delq proc compilation-in-progress))
+	  ))))
 
 (defun kill-compilation ()
   "Kill the process made by the \\[compile] command."