From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: recompile uses wrong buffer.. hint Date: Mon, 07 Jun 2004 15:36:48 +0300 Organization: JURTA Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <87ekortuhr.fsf@mail.jurta.org> References: <49418.217.194.34.123.1086597616.squirrel@wwws.franken.de> <87lliz90o3.fsf@mail.jurta.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1086612424 30980 80.91.224.253 (7 Jun 2004 12:47:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 7 Jun 2004 12:47:04 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Mon Jun 07 14:46:54 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BXJWg-00022i-00 for ; Mon, 07 Jun 2004 14:46:54 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BXJWf-0003kO-00 for ; Mon, 07 Jun 2004 14:46:53 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BXJXD-0000pC-1A for emacs-devel@quimby.gnus.org; Mon, 07 Jun 2004 08:47:27 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BXJX5-0000nj-Nq for emacs-devel@gnu.org; Mon, 07 Jun 2004 08:47:20 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BXJX3-0000n0-C4 for emacs-devel@gnu.org; Mon, 07 Jun 2004 08:47:18 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BXJX3-0000mc-7P for emacs-devel@gnu.org; Mon, 07 Jun 2004 08:47:17 -0400 Original-Received: from [66.33.219.4] (helo=spork.dreamhost.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BXJW4-0001ga-Vi for emacs-devel@gnu.org; Mon, 07 Jun 2004 08:46:17 -0400 Original-Received: from mail.jurta.org (80-235-35-47-dsl.mus.estpak.ee [80.235.35.47]) by spork.dreamhost.com (Postfix) with ESMTP id C161C11DC1E; Mon, 7 Jun 2004 05:46:14 -0700 (PDT) Original-To: "Stephan Stahl" In-Reply-To: <87lliz90o3.fsf@mail.jurta.org> (Juri Linkov's message of "Mon, 07 Jun 2004 12:29:00 +0300") User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:24666 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:24666 > ((eq major-mode (nth 1 compilation-arguments)) > (buffer-name)) I think exactly the same condition should be used in `recompile' to get the right directory when invoked in the compilation buffer: Index: lisp/progmodes/compile.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/progmodes/compile.el,v retrieving revision 1.320 diff -u -r1.320 compile.el --- lisp/progmodes/compile.el 28 May 2004 21:11:41 -0000 1.320 +++ lisp/progmodes/compile.el 7 Jun 2004 12:20:15 -0000 @@ -787,7 +787,10 @@ original use. Otherwise, recompile using `compile-command'." (interactive) (save-some-buffers (not compilation-ask-about-save) nil) - (let ((default-directory (or compilation-directory default-directory))) + (let ((default-directory + (or (and (not (eq major-mode (nth 1 compilation-arguments))) + compilation-directory) + default-directory))) (apply 'compilation-start (or compilation-arguments `(,(eval compile-command)))))) @@ -814,8 +817,7 @@ (funcall name-function mode-name)) (compilation-buffer-name-function (funcall compilation-buffer-name-function mode-name)) - ((and (eq major-mode 'compilation-mode) - (equal mode-name (nth 2 compilation-arguments))) + ((eq major-mode (nth 1 compilation-arguments)) (buffer-name)) (t (concat "*" (downcase mode-name) "*")))) -- Juri Linkov http://www.jurta.org/emacs/