changeset 81047:9f8e1f35816d

Nikolaj Schumacher <n_schumacher at web.de> (tiny change) (compilation-handle-exit): `compilation-finish-function' may change the current buffer.
author Glenn Morris <rgm@gnu.org>
date Wed, 23 May 2007 08:11:59 +0000
parents e4d3cd3503d7
children 3b0453fee5b3
files lisp/progmodes/compile.el
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/compile.el	Wed May 23 04:43:42 2007 +0000
+++ b/lisp/progmodes/compile.el	Wed May 23 08:11:59 2007 +0000
@@ -1426,7 +1426,8 @@
 			     process-status exit-status msg)
 		  (cons msg exit-status)))
 	(omax (point-max))
-	(opoint (point)))
+	(opoint (point))
+	(cur-buffer (current-buffer)))
     ;; Record where we put the message, so we can ignore it later on.
     (goto-char omax)
     (insert ?\n mode-name " " (car status))
@@ -1447,8 +1448,8 @@
 	(goto-char opoint))
     (with-no-warnings
       (if compilation-finish-function
-	  (funcall compilation-finish-function (current-buffer) msg)))
-    (run-hook-with-args 'compilation-finish-functions (current-buffer) msg)))
+	  (funcall compilation-finish-function cur-buffer msg)))
+    (run-hook-with-args 'compilation-finish-functions cur-buffer msg)))
 
 ;; Called when compilation process changes state.
 (defun compilation-sentinel (proc msg)