From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Bo Johansson" Newsgroups: gmane.emacs.bugs Subject: bug#10980: 23.4; Variable initial-environment incorrectly set Date: Fri, 23 Mar 2012 21:20:23 +0100 Message-ID: <638D93647FE24F879BBCDB56FB6C91E0@spc2> References: <91BFD8A43A0C4F29ADF1BB30E3861DAD@spc2> <83d383uwri.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1332534075 1781 80.91.229.3 (23 Mar 2012 20:21:15 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 23 Mar 2012 20:21:15 +0000 (UTC) Cc: 10980@debbugs.gnu.org To: "Eli Zaretskii" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 23 21:21:14 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1SBAz4-0002ws-44 for geb-bug-gnu-emacs@m.gmane.org; Fri, 23 Mar 2012 21:21:14 +0100 Original-Received: from localhost ([::1]:41915 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBAz3-0004He-8y for geb-bug-gnu-emacs@m.gmane.org; Fri, 23 Mar 2012 16:21:13 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38304) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBAz0-0004GC-8Z for bug-gnu-emacs@gnu.org; Fri, 23 Mar 2012 16:21:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SBAyy-0003Id-Bx for bug-gnu-emacs@gnu.org; Fri, 23 Mar 2012 16:21:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:57176) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBAyy-0003IV-9L for bug-gnu-emacs@gnu.org; Fri, 23 Mar 2012 16:21:08 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SBBSr-00047x-Rf for bug-gnu-emacs@gnu.org; Fri, 23 Mar 2012 16:52:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Bo Johansson" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Mar 2012 20:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10980 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 10980-submit@debbugs.gnu.org id=B10980.133253592015857 (code B ref 10980); Fri, 23 Mar 2012 20:52:01 +0000 Original-Received: (at 10980) by debbugs.gnu.org; 23 Mar 2012 20:52:00 +0000 Original-Received: from localhost ([127.0.0.1]:35775 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SBBSo-00047g-BJ for submit@debbugs.gnu.org; Fri, 23 Mar 2012 16:51:59 -0400 Original-Received: from seluib4vp34.perspektivbredband.net ([81.186.254.26]:47054) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SBBSG-00046o-I2 for 10980@debbugs.gnu.org; Fri, 23 Mar 2012 16:51:57 -0400 Original-Received: from spc2 (hd5b913e4.seluldx.dyn.perspektivbredband.net [213.185.19.228]) by seluib4vp34.perspektivbredband.net (Postfix) with SMTP id 7C6D363ADB; Fri, 23 Mar 2012 21:20:28 +0100 (CET) In-Reply-To: <83d383uwri.fsf@gnu.org> X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 15.4.3538.513 X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3538.513 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:58038 Archived-At: >From: Eli Zaretskii >Date: Fri, 23 Mar 2012 18:06:57 +0200 >> From: "Bo Johansson" >> Date: Fri, 23 Mar 2012 07:30:42 +0100 >> >> On Windows the Emacs variable initial-environment is NOT set according to >> the >> documentation: >> "The variable initial-environment stores the initial environment >> inherited by >> Emacs". > >I'm sorry, I'm not sure I understand the essence of your report. What >exactly would you like the documentation to say that it doesn't say >now? Or, to put it differently, what in the way initial-environment >is set on Windows contradicts the documentation? > >Thanks. Hej Eli! My goal is: I want to get the same result doing something from within Emacs as doing it from a Windows command prompt. To do "(compile "make" nil)" within Emacs should give the same result as doing "make" from the Windows command prompt. The problem is: The environment variables inherited by Emacs is changed. The changes in the environment leads to diffren results doing something from within Emacs compared to doing it from a Windows command prompt. The BUG in Emacs is: In Windows the variable initial-environment is set first after "the initial environment inherited by Emacs" is changed. The function init_environment (char ** argv) (in emacs-git/src/w32.c at line 1528) changes the environment variables. The CHANGED "initial environment" is stored in the variable initial_environment by the function set_initial_environment (in emacs-git/src/callproc.c at line 1616). However the documentation says: "The variable initial-environment stores the initial environment inherited by Emacs". My goal can be achieved if the bug is corrected: A correct value in the variable initial-environment is need to be able to know "the environment inherited by Emacs". This make it possible to use initial-environment in the lisp function (defun compilation-start (command &optional mode name-function highlight-regexp) in emacs-git/lisp/progmodes/simple.el:2088. The in emacs internal used environment variables can temporary be override by those in the variable initial-environment. (It is of course also possible to use a new variable which contains "the initial environment inherited by Emacs".) Summary: A value in the variable initial-environment according to the documentation makes it possible to "get the same result doing something from within Emacs as doing it from a Windows command prompt". (See also http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-03/msg00178.html.) Best regards Bosse