From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#8340: 23.2; recompile does not retain compilation-environment needed by vc-git-grep Date: Tue, 06 Sep 2011 14:39:58 -0400 Message-ID: References: <4D8B9138.5070701@ieee.org> <871uvvtkwi.fsf@mail.jurta.org> <87ehzukolk.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1315334426 7572 80.91.229.12 (6 Sep 2011 18:40:26 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 6 Sep 2011 18:40:26 +0000 (UTC) Cc: 8340@debbugs.gnu.org, Trevor Spiteri To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Sep 06 20:40:22 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1R10ZI-0007JK-5D for geb-bug-gnu-emacs@m.gmane.org; Tue, 06 Sep 2011 20:40:20 +0200 Original-Received: from localhost ([::1]:32995 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R10ZH-0002EE-OQ for geb-bug-gnu-emacs@m.gmane.org; Tue, 06 Sep 2011 14:40:19 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:49272) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R10ZF-0002Dt-8U for bug-gnu-emacs@gnu.org; Tue, 06 Sep 2011 14:40:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R10ZC-0002TK-VF for bug-gnu-emacs@gnu.org; Tue, 06 Sep 2011 14:40:17 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45329) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R10ZC-0002TG-SP for bug-gnu-emacs@gnu.org; Tue, 06 Sep 2011 14:40:14 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1R10cs-0001AX-Sq; Tue, 06 Sep 2011 14:44:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 06 Sep 2011 18:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8340 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8340-submit@debbugs.gnu.org id=B8340.13153346354474 (code B ref 8340); Tue, 06 Sep 2011 18:44:02 +0000 Original-Received: (at 8340) by debbugs.gnu.org; 6 Sep 2011 18:43:55 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R10ck-0001A6-A1 for submit@debbugs.gnu.org; Tue, 06 Sep 2011 14:43:54 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R10ce-00019u-AJ for 8340@debbugs.gnu.org; Tue, 06 Sep 2011 14:43:49 -0400 Original-Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id p86IdwcY023027; Tue, 6 Sep 2011 14:39:58 -0400 Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 270141300D2; Tue, 6 Sep 2011 14:39:58 -0400 (EDT) In-Reply-To: <87ehzukolk.fsf@mail.jurta.org> (Juri Linkov's message of "Tue, 06 Sep 2011 12:27:19 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3972=0 X-NAI-Spam-Version: 2.2.0.9286 : core <3972> : streams <679106> : uri <952943> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Tue, 06 Sep 2011 14:44:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:50641 Archived-At: > -(defvar compilation-environment nil > - "*List of environment variables for compilation to inherit. > +(defcustom compilation-environment nil > + "List of environment variables for compilation to inherit. > Each element should be a string of the form ENVVARNAME=VALUE. > This list is temporarily prepended to `process-environment' prior to > -starting the compilation process.") > +starting the compilation process." > + :type '(repeat (string :tag "ENVVARNAME=VALUE")) > + :options '(("LANG=C")) > + :group 'compilation > + :version "24.1") What is this supposed to fix? > ;; History of compile commands. > (defvar compile-history nil) > @@ -1482,6 +1491,7 @@ (defun compilation-start (command &optio > "compilation" > (replace-regexp-in-string "-mode\\'" "" (symbol-name mode)))) > (thisdir default-directory) > + (thisenv compilation-environment) > outwin outbuf) > (with-current-buffer > (setq outbuf > @@ -1530,6 +1541,7 @@ (defun compilation-start (command &optio > ;; affected by the special handling of "cd ...;". > ;; NB: must be fone after (funcall mode) as that resets local variables > (set (make-local-variable 'compilation-directory) thisdir) > + (set (make-local-variable 'compilation-environment) thisenv) > (if highlight-regexp > (set (make-local-variable 'compilation-highlight-regexp) > highlight-regexp)) > === modified file 'lisp/vc/vc-git.el' > --- lisp/vc/vc-git.el 2011-09-01 07:29:56 +0000 > +++ lisp/vc/vc-git.el 2011-09-06 09:19:48 +0000 > @@ -998,7 +998,7 @@ (defun vc-git-grep (regexp &optional fil > (add-to-history 'grep-history command)))) > (when command > (let ((default-directory dir) > - (compilation-environment '("PAGER="))) > + (compilation-environment (cons "PAGER=" compilation-environment))) > ;; Setting process-setup-function makes exit-message-function work > ;; even when async processes aren't supported. > (compilation-start command 'grep-mode)) Mixing defcustom+bufferlocal+letbinding is really asking for trouble, although I think in this case it might just fall within the limits of what does work. The vc-git.el patch looks perfectly good and so does the (set...thisenv). But I'd prefer to refrain from making compilation-environment a defcustom for now, until we find a really good use for it. Stefan