From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Edward Welbourne Newsgroups: gmane.emacs.bugs Subject: Re: kill-compilation failing when there are several compilation buffers Date: Tue, 07 Aug 2007 11:30:01 +0200 Message-ID: References: Reply-To: eddy@opera.com NNTP-Posting-Host: lo.gmane.org X-Trace: sea.gmane.org 1186479120 9860 80.91.229.12 (7 Aug 2007 09:32:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 7 Aug 2007 09:32:00 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org To: rms@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Aug 07 11:31:58 2007 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IILPs-0007XE-SZ for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 Aug 2007 11:31:58 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IILPm-00046f-VK for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 Aug 2007 05:31:46 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IILPk-00046B-0w for bug-gnu-emacs@gnu.org; Tue, 07 Aug 2007 05:31:44 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IILPi-00045l-DL for bug-gnu-emacs@gnu.org; Tue, 07 Aug 2007 05:31:43 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IILPi-00045i-5T for bug-gnu-emacs@gnu.org; Tue, 07 Aug 2007 05:31:42 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IILPM-0000iN-Po; Tue, 07 Aug 2007 05:31:21 -0400 Original-Received: from sam.opera.com ([213.236.208.81]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IILOv-000732-MB; Tue, 07 Aug 2007 05:30:53 -0400 Original-Received: from whorl (pat-tdc.opera.com [213.236.208.22]) by sam.opera.com (8.13.4/8.13.4/Debian-3sarge3) with ESMTP id l779UCnY008853 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Tue, 7 Aug 2007 09:30:16 GMT Original-Received: from eddy by whorl with local (Exim 4.67) (envelope-from ) id 1IILO5-0001iU-Bj; Tue, 07 Aug 2007 11:30:01 +0200 In-reply-to: (message from Richard Stallman on Wed, 01 Aug 2007 01:38:39 -0400) X-Virus-Scanned: ClamAV 0.90.1/3879/Tue Aug 7 00:27:49 2007 on sam.opera.com X-Virus-Status: Clean X-detected-kernel: Linux 2.4-2.6 X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:16294 Archived-At: ah ! I tried evaluating sub-expressions, albeit not in a compile-buffer. When I evaluate (compilation-buffer-internal-p (current-buffer)) I get thrown to the debugger: Debugger entered--Lisp error: (wrong-number-of-arguments #[nil "ŽÀŽÁ!‡" [local-variable-p compilation-locs] 2 ("/usr/share/emacs/22.1/lisp/progmodes/compile.elc" . 48467)] 1) compilation-buffer-internal-p(#) eval((compilation-buffer-internal-p (current-buffer))) eval-last-sexp-1(nil) eval-last-sexp(nil) call-interactively(eval-last-sexp) so the problem's there. C-h f says compilation-buffer-internal-p is a compiled Lisp function in `compile.el'. (compilation-buffer-internal-p) Test if inside a compilation buffer. and /usr/share/emacs/22.1/lisp/progmodes/compile.el.gz (helpfully uncompressed on the fly by emacs) says: ;;; test if a buffer is a compilation buffer, assuming we're in the buffer (defsubst compilation-buffer-internal-p () "Test if inside a compilation buffer." (local-variable-p 'compilation-locs)) ;;; test if a buffer is a compilation buffer, using compilation-buffer-internal-p (defsubst compilation-buffer-p (buffer) "Test if BUFFER is a compilation buffer." (with-current-buffer buffer (compilation-buffer-internal-p))) so it looks like a typo in your patch - it should either call compilation-buffer-p or omit the (current-buffer) parameter to compilation-buffer-internal-p. (I should also note that the error message produced, claiming and got the wrong number of arguments, was was not so helpful !) Changing the defun to (defun compilation-find-buffer (&optional avoid-current) "Return a compilation buffer. If AVOID-CURRENT is nil, and the current buffer is a compilation buffer, return it. If AVOID-CURRENT is non-nil, return the current buffer only as a last resort." (if (and (compilation-buffer-internal-p) (not avoid-current)) (current-buffer) (next-error-find-buffer avoid-current 'compilation-buffer-internal-p))) and doing C-c C-e to that fixes the bug :-) Eddy.