From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Leake Newsgroups: gmane.emacs.devel Subject: locally modifying `compilation-environment' Date: Sun, 13 Oct 2013 15:37:48 -0500 Message-ID: <85d2n8ewkj.fsf@stephe-leake.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1381696686 23792 80.91.229.3 (13 Oct 2013 20:38:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 13 Oct 2013 20:38:06 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 13 22:38:09 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VVSQT-000226-2c for ged-emacs-devel@m.gmane.org; Sun, 13 Oct 2013 22:38:09 +0200 Original-Received: from localhost ([::1]:34493 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVSQS-0006u3-9K for ged-emacs-devel@m.gmane.org; Sun, 13 Oct 2013 16:38:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34616) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVSQI-0006tk-Fb for emacs-devel@gnu.org; Sun, 13 Oct 2013 16:38:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VVSQB-0004A1-5p for emacs-devel@gnu.org; Sun, 13 Oct 2013 16:37:58 -0400 Original-Received: from cdptpa-outbound-snat.email.rr.com ([107.14.166.225]:43135 helo=cdptpa-oedge-vip.email.rr.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVSQB-00049t-1e for emacs-devel@gnu.org; Sun, 13 Oct 2013 16:37:51 -0400 Original-Received: from [75.87.81.6] ([75.87.81.6:51184] helo=TAKVER) by cdptpa-oedge01 (envelope-from ) (ecelerity 3.5.0.35861 r(Momo-dev:tip)) with ESMTP id 03/D6-15529-D940B525; Sun, 13 Oct 2013 20:37:50 +0000 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (windows-nt) X-RR-Connecting-IP: 107.14.168.118:25 X-Cloudmark-Score: 0 X-detected-operating-system: by eggs.gnu.org: BaiduSpider X-Received-From: 107.14.166.225 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:164184 Archived-At: `compilation-start' uses `make-local-variable' to make `compilation-environment' buffer-local in the created compilation buffer. That complains if it is let-bound, like this: (let ((compilation-environment ...) ...) (compilation-start cmd 'compilation-mode (lambda (mode-name) (concat mode-name "-gnatinspect-overriding"))) ) This gives a message: Making compilation-environment local to compilation-gnatinspect-overriding while let-bound! I assume `compilation-environment' is made buffer-local so it will have the same value for a rerun of the compile command in that buffer, which makes sense. But I don't see any other way to modify compilation-environment for this compilation only. compile-start-hook is run too late, so I can't set compilation-environment there. In this particular application, I can let-bind process-environment instead (it is not made buffer-local); I don't care about re-running the compile command. But that by-passes the purpose of compilation-environment in general. It seems compilation-start needs another parameter, for a local value of compilation-environment. -- -- Stephe