*** empty log message ***
This commit is contained in:
parent
528415e7be
commit
ebff767cd0
1 changed files with 53 additions and 44 deletions
|
@ -68,6 +68,12 @@ describing how the process finished.")
|
|||
"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 @@ means the default). The defaults for these variables are the global values of
|
|||
(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 @@ Runs `compilation-mode-hook' with `run-hooks' (which see)."
|
|||
(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."
|
||||
|
|
Loading…
Add table
Reference in a new issue