From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: running ./temacs Date: Thu, 18 Nov 2010 09:26:53 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1290110196 14534 80.91.229.12 (18 Nov 2010 19:56:36 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 18 Nov 2010 19:56:36 +0000 (UTC) Cc: emacs-devel@gnu.org To: Dan Nicolaescu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 18 20:56:31 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PJAas-0006RL-J9 for ged-emacs-devel@m.gmane.org; Thu, 18 Nov 2010 20:56:30 +0100 Original-Received: from localhost ([127.0.0.1]:42947 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PJAar-0007jB-3B for ged-emacs-devel@m.gmane.org; Thu, 18 Nov 2010 14:56:29 -0500 Original-Received: from [140.186.70.92] (port=50257 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PJAal-0007it-Ol for emacs-devel@gnu.org; Thu, 18 Nov 2010 14:56:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PJAaj-0004Xc-Pd for emacs-devel@gnu.org; Thu, 18 Nov 2010 14:56:23 -0500 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:39448) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PJAaj-0004WO-Mx; Thu, 18 Nov 2010 14:56:21 -0500 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id oAIJuIQa016819; Thu, 18 Nov 2010 14:56:19 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id A577DA82D9; Thu, 18 Nov 2010 09:26:53 -0500 (EST) In-Reply-To: (Dan Nicolaescu's message of "Wed, 17 Nov 2010 23:44:36 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3683=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:132824 Archived-At: >> [Hacking around this so that Vprocess_environment is initialized when >> not dumping makes ./temacs work correctly] > In case anyone wants to see the difference in behavior, here's the ugly hack: Could you explain your code (i.e. why you need those strcmp hacks, why you need to set&unset initialized, ...)? Basically, the control flow around these parts of the code is a bit too intricate for my poor head right now, and on top of that, I don't know what it's trying to achieve. > --- src/emacs.c 2010-11-15 06:10:35 +0000 > +++ src/emacs.c 2010-11-17 07:40:04 +0000 > @@ -1455,7 +1455,15 @@ main (int argc, char **argv) > /* egetenv is a pretty low-level facility, which may get called in > many circumstances; it seems flimsy to put off initializing it > until calling init_callproc. */ > - set_initial_environment (); > + > + if (!initialized && !((strcmp (argv[argc-1], "dump") == 0 > + || strcmp (argv[argc-1], "bootstrap") == 0))){ > + initialized = 1; > + set_initial_environment (); > + initialized = 0; > + } > + else > + set_initial_environment (); > /* AIX crashes are reported in system versions 3.2.3 and 3.2.4 > if this is not done. Do it after set_global_environment so that we > don't pollute Vglobal_environment. */ -- Stefan