[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
address@hidden: compilation-finish-functions might be called with wrong
From: |
Richard Stallman |
Subject: |
address@hidden: compilation-finish-functions might be called with wrong buffer] |
Date: |
Mon, 21 May 2007 09:25:09 -0400 |
Would someone please install this in EMACS_22_BASE and the trunk?
------- Start of forwarded message -------
X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY
autolearn=failed version=3.1.0
To: address@hidden
From: Nikolaj Schumacher <address@hidden>
Date: Mon, 21 May 2007 00:27:55 +0200
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Subject: compilation-finish-functions might be called with wrong buffer
- --=-=-=
Hello,
compilation-handle-exit does this:
(with-no-warnings
(if compilation-finish-function
(funcall compilation-finish-function (current-buffer) msg)))
(run-hook-with-args 'compilation-finish-functions (current-buffer) msg)))
However, `compilation-finish-function' might change the current buffer.
In fact, JDEE does this. And while I think it probably shouldn't,
that's not stated anywhere.
regards,
Nikolaj Schumacher
- --=-=-=
Content-Type: text/x-patch
Content-Disposition: inline; filename=emacs-compilation-handle-exit.patch
Content-Description: patch
diff -du
/Users/nik/.emacs.d/backup/\!Applications\!Emacs.app\!Contents\!Resources\!share\!emacs\!22.1.50\!lisp\!progmodes\!compile.el.\~3\~
/Applications/Emacs.app/Contents/Resources/share/emacs/22.1.50/lisp/progmodes/compile.el
- --- lisp/progmodes/compile.el 2007-05-16 17:43:57.000000000 +0200
+++ lisp/progmodes/compile.el 2007-05-21 00:04:44.000000000 +0200
@@ -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)
Diff finished. Mon May 21 00:04:48 2007
- --=-=-=
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
emacs-pretest-bug mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
- --=-=-=--
------- End of forwarded message -------
- address@hidden: compilation-finish-functions might be called with wrong buffer],
Richard Stallman <=