From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Robert Pollard Newsgroups: gmane.emacs.help Subject: Re: [NEWBIE] exec path not expanding Date: Tue, 21 Oct 2003 14:28:01 -0700 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <72D0EE81-040D-11D8-A446-000A957A7EA8@apple.com> References: <86n0bupdp5.fsf@slowfox.dyndns.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 (Apple Message framework v551) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1066772249 4041 80.91.224.253 (21 Oct 2003 21:37:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 21 Oct 2003 21:37:29 +0000 (UTC) Cc: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Oct 21 23:37:26 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AC4By-0004oL-00 for ; Tue, 21 Oct 2003 23:37:26 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AC49K-0000TJ-PE for geh-help-gnu-emacs@m.gmane.org; Tue, 21 Oct 2003 17:34:42 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AC43q-0007cI-P5 for help-gnu-emacs@gnu.org; Tue, 21 Oct 2003 17:29:02 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AC437-0007Sl-4T for help-gnu-emacs@gnu.org; Tue, 21 Oct 2003 17:28:48 -0400 Original-Received: from [17.254.13.22] (helo=mail-out3.apple.com) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AC431-0007Qm-5N for help-gnu-emacs@gnu.org; Tue, 21 Oct 2003 17:28:11 -0400 Original-Received: from mailgate1.apple.com (a17-128-100-225.apple.com [17.128.100.225]) by mail-out3.apple.com (8.12.10/8.12.9) with ESMTP id h9LLS7Ti028209 for ; Tue, 21 Oct 2003 14:28:07 -0700 (PDT) Original-Received: from scv3.apple.com (scv3.apple.com) by mailgate1.apple.com (Content Technologies SMTPRS 4.2.1) with ESMTP id ; Tue, 21 Oct 2003 14:27:35 -0700 Original-Received: from apple.com ([17.101.117.23]) by scv3.apple.com (8.12.9/8.12.9) with ESMTP id h9LLRe0m002813; Tue, 21 Oct 2003 14:27:40 -0700 (PDT) Original-To: Kai Grossjohann In-Reply-To: <86n0bupdp5.fsf@slowfox.dyndns.org> X-Mailer: Apple Mail (2.551) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:13443 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:13443 Hello again, On Tuesday, October 21, 2003, at 12:56 PM, Kai Grossjohann wrote: > Robert Pollard writes: > >> On Tuesday, October 14, 2003, at 02:20 PM, Kai Grossjohann wrote: >> >>> Robert Pollard writes: >>> >>>> I am curious as to why my exec path is not expanding the PATH >>>> variable. Does it expand it when it uses it or should it be expanded >>>> in the exec-path variable? >>> >>> I guess that $PATH should be expanded already. I think that >>> exec-path is initialized from $PATH. >> >> You are correct! > > Okay. So what does M-: (getenv "PATH") RET say in Emacs? Here's the question and answers from another poster: > Hmmm. What do (getenv "SYBASE"), (getenv "SYBASE_OCS"), (getenv > "SYBASE_ASE"), > and (getenv "PATH") return? SYBASE = /Applications/Sybase/System SYBASE_OCS = OCS-12_5 SYBASE_ASE = ASE-12_5 PATH = /$SYBASE/$SYBASE_OCS/bin:$SYBASE/$SYBASE_ASE/bin:$PATH But in the terminal the variables are expanded as expected when using printenv PATH. > >>> In the shell where you start Emacs, have a look at $PATH. Does it >>> contain them "$SYBASE" strings literally, dollar-sign and all? >> >> Technically, I don't start Emacs from a shell since it is a Mac OS X >> app > > Hm, yeah. I hate that. How can people do any debugging in this > circumstance? Argh :-( > > Do you have a menu item similar to the "Start/Run..." item in > Windows? Then you could try to enter as the command "env" and check > the "run in terminal" checkbox. If there is one. I just tried it and it worked. If I run it from the command line it works fine (after I moved Emacs from the Applications folder to my Applications folder). It installed in the system's Application folder for whatever reason. When I double-click on the app it errors out as before. But, when I launch using the command line it works just fine. Would this be an indicator that my environment variables are not set up right when my system boots? Although, the terminal shows they are fine. Maybe there is another place the Mac sets environment variables for the user when they boot. I'll have to check on this. > >> but in a round about way it starts from my home, which does have the >> expanded versions of the path names. If I go to the terminal and >> printenv for PATH it has the path names expanded out. > > Home doesn't have much to do with PATH. But I think what you mean is > that if you open a terminal window, then your current working > directory is your home dir, and in that terminal window, the > environment looks sane. > > But it could be that ~/.cshrc or ~/.login (I'm wildly guessing that > MacOS is following the BSDish tradition of using csh by default) is > playing psychotherapist to make your environment sane. It uses .tcshrc. tcshrc is the default shell for OS X. > > Hm. Can't you start Emacs from the shell? Like "start Emacs.app" or > "open Emacs.app" or something like this? Then you could compare an > Emacs started from the shell with an Emacs started by double-clicking > or whatever it is that one does on MacOS to start Emacs. This is the problem. > >>> Maybe PATH="$PATH" or setenv PATH "$PATH" might be useful things to >>> type in the shell before starting Emacs. >> >> I believe it is correct. However, I don't know why Emacs doesn't see >> it the same. Maybe it expands the variables before it uses and it is >> some other problem??? I don't know what's is going on. For now, I'm >> dragging the documents to Emacs instead of using Dired to find files. > > My guess is that the environment that Emacs starts in is different > from the environment set up by the shell. Does this make sense? You got it! Now I have to figure out why! Thanks, Robert Pollard > > Kai >