emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: path, cwd in NS port


From: Perry E. Metzger
Subject: Re: path, cwd in NS port
Date: Thu, 28 May 2020 12:31:37 -0400

On Thu, 28 May 2020 19:10:43 +0300 Eli Zaretskii <eliz@gnu.org> wrote:
> > Date: Thu, 28 May 2020 11:00:37 -0400
> > From: "Perry E. Metzger" <perry@piermont.com>
> > 
> > Howdy! For years, it has irritated me a bit that when Emacs is
> > invoked by double-clicking the icon in the NS port, that the
> > user's path is basically empty and the selected cwd is sometimes
> > "/".
> > 
> > I would like to make it possible for a user to at least correct
> > this situation in their .emacs by knowing when Emacs has been
> > invoked by launching the .app versus when it has been invoked
> > from the command line (and has the proper PATH set etc.)
> > 
> > Does anyone have ideas for ways that the user could figure out
> > which it is correctly inside their init file? (It's okay if the
> > method doesn't currently exist and it would require hacking to
> > Emacs to add such a feature; I'll happily do that.)  
> 
> Is this the same problem as discussed in bug#40924?  (I don't use
> macOS, so apologies if I;m confused about this issue.)

It's certainly a version of the same issue; something happened such
that the default CWD is no longer set to ~/ recently. That should be
fixed independently if anyone knows what changed. (I've noticed this
issue myself and it is quite irritating.)

However, the user's PATH has always been non-optimal on invocation
from the dock, spotlight, clicking in the Applications directory, etc.
If the thing invoking Emacs doesn't already have the user's PATH in
its environment, it can't pass it to Emacs, and it would be nice for
Emacs users to have an easy solution to fix this.

I imagine such problems will also exist in some Linux window managers
etc. as well.

This issue was brought up on the list only a week or two ago I
believe. I've started poking and prodding at it.

One option that occurred to me was that it would be pretty easy to
invoke an "echo $PATH" shell command in my .emacs and parse it into
the exec-path, though I'd prefer only to do this if Emacs was invoked
a certain way (from the dock, spotlight, etc.) where the PATH is
known not to be set. 

Perry
-- 
Perry E. Metzger                perry@piermont.com



reply via email to

[Prev in Thread] Current Thread [Next in Thread]