aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1996-09-01 20:23:30 +0000
committerRichard M. Stallman1996-09-01 20:23:30 +0000
commit4cc36b1786ad1d18c6e754e2636f14e2ccc69577 (patch)
tree6651563e7fdf8c7b31b3df8f26bda4f8843f7d5e
parent20ddcdc06829f0714deaf42ff1534bf233b97534 (diff)
downloademacs-4cc36b1786ad1d18c6e754e2636f14e2ccc69577.tar.gz
emacs-4cc36b1786ad1d18c6e754e2636f14e2ccc69577.zip
(compilation-finish-functions): New variable.
(compilation-handle-exit): Run compilation-finish-functions.
-rw-r--r--lisp/progmodes/compile.el12
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) \"*\")'.")
80It is called with two arguments: the compilation buffer, and a string 80It is called with two arguments: the compilation buffer, and a string
81describing how the process finished.") 81describing how the process finished.")
82 82
83;;;###autoload
84(defvar compilation-finish-functions nil
85 "*Functions to call when a compilation process finishes.
86Each function is called with two arguments: the compilation buffer,
87and 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.
85A buffer becomes most recent when its compilation is started 91A 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)