diff options
| author | Richard M. Stallman | 1996-09-01 20:23:30 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-09-01 20:23:30 +0000 |
| commit | 4cc36b1786ad1d18c6e754e2636f14e2ccc69577 (patch) | |
| tree | 6651563e7fdf8c7b31b3df8f26bda4f8843f7d5e | |
| parent | 20ddcdc06829f0714deaf42ff1534bf233b97534 (diff) | |
| download | emacs-4cc36b1786ad1d18c6e754e2636f14e2ccc69577.tar.gz emacs-4cc36b1786ad1d18c6e754e2636f14e2ccc69577.zip | |
(compilation-finish-functions): New variable.
(compilation-handle-exit): Run compilation-finish-functions.
| -rw-r--r-- | lisp/progmodes/compile.el | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index c485f2169ce..102e508d426 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el | |||
| @@ -80,6 +80,12 @@ nil means compute the name with `(concat \"*\" (downcase major-mode) \"*\")'.") | |||
| 80 | It is called with two arguments: the compilation buffer, and a string | 80 | It is called with two arguments: the compilation buffer, and a string |
| 81 | describing how the process finished.") | 81 | describing how the process finished.") |
| 82 | 82 | ||
| 83 | ;;;###autoload | ||
| 84 | (defvar compilation-finish-functions nil | ||
| 85 | "*Functions to call when a compilation process finishes. | ||
| 86 | Each function is called with two arguments: the compilation buffer, | ||
| 87 | and a string describing how the process finished.") | ||
| 88 | |||
| 83 | (defvar compilation-last-buffer nil | 89 | (defvar compilation-last-buffer nil |
| 84 | "The most recent compilation buffer. | 90 | "The most recent compilation buffer. |
| 85 | A buffer becomes most recent when its compilation is started | 91 | A buffer becomes most recent when its compilation is started |
| @@ -613,7 +619,11 @@ Turning the mode on runs the normal hook `compilation-minor-mode-hook'." | |||
| 613 | (if (and opoint (< opoint omax)) | 619 | (if (and opoint (< opoint omax)) |
| 614 | (goto-char opoint)) | 620 | (goto-char opoint)) |
| 615 | (if compilation-finish-function | 621 | (if compilation-finish-function |
| 616 | (funcall compilation-finish-function (current-buffer) msg)))) | 622 | (funcall compilation-finish-function (current-buffer) msg)) |
| 623 | (let ((functions compilation-finish-functions)) | ||
| 624 | (while functions | ||
| 625 | (funcall (car functions) (current-buffer) msg) | ||
| 626 | (setq functions (cdr functions)))))) | ||
| 617 | 627 | ||
| 618 | ;; Called when compilation process changes state. | 628 | ;; Called when compilation process changes state. |
| 619 | (defun compilation-sentinel (proc msg) | 629 | (defun compilation-sentinel (proc msg) |