From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Vincent LADEUIL Newsgroups: gmane.emacs.devel Subject: [MAC_OSX] [PATCH] Paths setting for bundle Date: 11 Apr 2003 22:03:37 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <45354.821792762$1050091769@news.gmane.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1050091769 14263 80.91.224.249 (11 Apr 2003 20:09:29 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 11 Apr 2003 20:09:29 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Fri Apr 11 22:09:26 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1944py-0003hd-00 for ; Fri, 11 Apr 2003 22:09:26 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 1944vZ-0008O2-00 for ; Fri, 11 Apr 2003 22:15:13 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 1944p8-0008Py-05 for emacs-devel@quimby.gnus.org; Fri, 11 Apr 2003 16:08:34 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 1944oj-0008DQ-00 for emacs-devel@gnu.org; Fri, 11 Apr 2003 16:08:09 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 1944kx-000750-00 for emacs-devel@gnu.org; Fri, 11 Apr 2003 16:04:16 -0400 Original-Received: from postfix4-2.free.fr ([213.228.0.176]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 1944kS-0006rx-00 for emacs-devel@gnu.org; Fri, 11 Apr 2003 16:03:44 -0400 Original-Received: from vila.local. (unknown [82.64.92.73]) by postfix4-2.free.fr (Postfix) with ESMTP id 6B38EC199 for ; Fri, 11 Apr 2003 22:03:42 +0200 (CEST) Original-To: emacs-devel@gnu.org Original-Lines: 63 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:13167 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:13167 The following patch solve a weird side-effect regarding access to files embedded in a bundle : as installation paths cannot be determined at build time, init_mac_osx_environment elegantly use environment variables to restore simple access. The weird part is : these variables are inherited by child processes, when this child is a different version of emacs to be debugged, wrong paths are obtained. 2003-04-11 Vincent LADEUIL * emacs.c (main): Under MAC_OSX, avoid polluting environment of child processes with variables related to bundle paths. Index: src/emacs.c =================================================================== RCS file: /cvsroot/emacs/emacs/src/emacs.c,v retrieving revision 1.325 diff -u -r1.325 emacs.c --- src/emacs.c 18 Dec 2002 06:16:28 -0000 1.325 +++ src/emacs.c 11 Apr 2003 19:41:10 -0000 @@ -1381,11 +1381,6 @@ init_ntproc (); /* must precede init_editfns. */ #endif -#ifdef HAVE_CARBON - if (initialized) - init_mac_osx_environment (); -#endif - /* 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. */ @@ -1398,6 +1393,16 @@ putenv ("LANG=C"); #endif +#ifdef HAVE_CARBON + /* init_mac_osx_environment will use environment variables to + * setup various emacs paths iff installed as a bundle. By + * setting environment variables *AFTER* calling + * set_process_environment (above), we avoid polluting child + * processes */ + if (initialized) + init_mac_osx_environment (); +#endif + init_buffer (); /* Init default directory of main buffer. */ init_callproc_1 (); /* Must precede init_cmdargs and init_sys_modes. */ This is my first contribution, feel free to educate me if I've made something wrong, Vincent