unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Robert Pollard <rpollard@apple.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: [NEWBIE] exec path not expanding
Date: Tue, 21 Oct 2003 14:28:01 -0700	[thread overview]
Message-ID: <72D0EE81-040D-11D8-A446-000A957A7EA8@apple.com> (raw)
In-Reply-To: <86n0bupdp5.fsf@slowfox.dyndns.org>

Hello again,

On Tuesday, October 21, 2003, at 12:56 PM, Kai Grossjohann wrote:

> Robert Pollard <rpollard@apple.com> writes:
>
>> On Tuesday, October 14, 2003, at 02:20 PM, Kai Grossjohann wrote:
>>
>>> Robert Pollard <rpollard@apple.com> 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
>

  reply	other threads:[~2003-10-21 21:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.654.1064432009.21628.help-gnu-emacs@gnu.org>
2003-09-24 21:18 ` [NEWBIE] exec path not expanding Kevin Rodgers
2003-09-25 15:38   ` John Russell
2003-09-25 21:58     ` Kevin Rodgers
2003-10-21 16:16   ` Robert Pollard
2003-10-14 21:20 ` Kai Grossjohann
2003-10-21 16:12   ` Robert Pollard
2003-10-21 19:56     ` Kai Grossjohann
2003-10-21 21:28       ` Robert Pollard [this message]
2003-10-22 18:23         ` Kai Grossjohann
     [not found] <mailman.2117.1066772419.21628.help-gnu-emacs@gnu.org>
2003-10-21 23:34 ` Kevin Rodgers
2003-10-22 12:38 ` Hugh Wolf
2003-11-09 17:58   ` Robert Pollard
     [not found] <mailman.2081.1066753006.21628.help-gnu-emacs@gnu.org>
2003-10-21 16:56 ` Kevin Rodgers
2003-10-21 21:32   ` Robert Pollard
     [not found] <mailman.2080.1066752801.21628.help-gnu-emacs@gnu.org>
2003-10-21 16:36 ` Hugh Wolf
2003-10-21 21:39   ` Robert Pollard
2003-09-24 19:33 Robert Pollard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=72D0EE81-040D-11D8-A446-000A957A7EA8@apple.com \
    --to=rpollard@apple.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).