]> git.eshelyaron.com Git - emacs.git/commitdiff
Nikolaj Schumacher <n_schumacher at web.de> (tiny change)
authorGlenn Morris <rgm@gnu.org>
Wed, 23 May 2007 08:09:37 +0000 (08:09 +0000)
committerGlenn Morris <rgm@gnu.org>
Wed, 23 May 2007 08:09:37 +0000 (08:09 +0000)
(compilation-handle-exit): `compilation-finish-function' may change
the current buffer.

lisp/progmodes/compile.el

index d3e8ec85d05c099ba1c0f63684b106eb4efe94bb..9a630ace9aa8b07970f8994519c0cc9d3938043d 100644 (file)
@@ -1426,7 +1426,8 @@ Turning the mode on runs the normal hook `compilation-minor-mode-hook'."
                             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 @@ Turning the mode on runs the normal hook `compilation-minor-mode-hook'."
        (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)