From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Alfred M. Szmidt" Newsgroups: gmane.emacs.devel Subject: Re: [ams@kemisten.nu: Re: compile and the current directory] Date: Tue, 20 Jan 2004 08:12:05 +0100 (MET) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200401200712.i0K7C5up029436@hamberg.it.uu.se> References: <200401181419.i0IEJebD006785@hamberg.it.uu.se> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1074582940 1908 80.91.224.253 (20 Jan 2004 07:15:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 20 Jan 2004 07:15:40 +0000 (UTC) Cc: dapfy@t-online.de, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue Jan 20 08:15:35 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 1Aiq6p-0002ZX-00 for ; Tue, 20 Jan 2004 08:15:35 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1Aiq6o-0003fU-00 for ; Tue, 20 Jan 2004 08:15:35 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Aiq5y-0002Fk-2R for emacs-devel@quimby.gnus.org; Tue, 20 Jan 2004 02:14:42 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1Aiq4Y-0001r7-NH for emacs-devel@gnu.org; Tue, 20 Jan 2004 02:13:14 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1Aiq40-0001dp-M3 for emacs-devel@gnu.org; Tue, 20 Jan 2004 02:13:11 -0500 Original-Received: from [130.238.12.36] (helo=aun.it.uu.se) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1Aiq3U-0001Sp-4V; Tue, 20 Jan 2004 02:12:08 -0500 Original-Received: from hamberg.it.uu.se (daemon@hamberg.it.uu.se [130.238.9.198]) by aun.it.uu.se (8.12.10/8.12.10) with ESMTP id i0K7C6HN007137; Tue, 20 Jan 2004 08:12:06 +0100 (MET) Original-Received: (from alsz8747@localhost) by hamberg.it.uu.se (8.12.10+Sun/8.12.10) id i0K7C5up029436; Tue, 20 Jan 2004 08:12:05 +0100 (MET) Original-To: rms@gnu.org In-reply-to: (message from Richard Stallman on Mon, 19 Jan 2004 05:01:43 -0500) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 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:19320 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:19320 + (let (olddir default-directory) + (unless (eq compilation-directory nil) + (setq default-directory compilation-directory)) + (apply 'compile-internal (or compilation-arguments + `(,(eval compile-command) "No more errors"))) + (setq default-directory olddir))) This is a roundabout and unreliable way to bind default-directory. Why not just bind it with let? (let ((default-directory (or compilation-directory default-directory))) (apply 'compile-internal (or compilation-arguments `(,(eval compile-command) "No more errors")))) There wasn't any particular reason not to use let, here is a updated version with the above suggestion, thanks. *** compile.el.~1.282.~ Sun Nov 23 21:57:47 2003 --- compile.el Tue Jan 20 08:10:23 2004 *************** *** 386,391 **** --- 386,394 ---- try; %s in the string is replaced by the text matching the FILE-IDX'th subexpression.") + (defvar compilation-directory nil + "Directory to restore to when doing `recompile'.") + (defvar compilation-enter-directory-regexp-alist '( ;; Matches lines printed by the `-w' option of GNU Make. *************** *** 578,583 **** --- 581,587 ---- (unless (equal command (eval compile-command)) (setq compile-command command)) (save-some-buffers (not compilation-ask-about-save) nil) + (setq compilation-directory default-directory) (compile-internal command "No more errors")) ;; run compile with the default command line *************** *** 587,594 **** original use. Otherwise, it recompiles using `compile-command'." (interactive) (save-some-buffers (not compilation-ask-about-save) nil) ! (apply 'compile-internal (or compilation-arguments ! `(,(eval compile-command) "No more errors")))) (defcustom compilation-scroll-output nil "*Non-nil to scroll the *compilation* buffer window as output appears. --- 591,599 ---- original use. Otherwise, it recompiles using `compile-command'." (interactive) (save-some-buffers (not compilation-ask-about-save) nil) ! (let ((default-directory (or compilation-directory default-directory))) ! (apply 'compile-internal (or compilation-arguments ! `(,(eval compile-command) "No more errors"))))) (defcustom compilation-scroll-output nil "*Non-nil to scroll the *compilation* buffer window as output appears.