Subject: Re: bug#44128: [feature/native-comp]

From: Eli Zaretskii <[email-masked]>
Date: Fri, 16 Apr 2021 15:20:13 +0300

> Cc: [email-masked], [email-masked], [email-masked]
> From: Phil Sainty <[email-masked]>
> Date: Sat, 17 Apr 2021 00:04:12 +1200
> 
> >> The second problem is that this type of behaviour feels rather
> >> like something you mentioned earlier: having "." in your PATH,
> >> which is widely considered a bad idea.
> > 
> > But that ship has sailed long, long, LONG ago: Emacs was always
> > looking for its Lisp files in the directory "../lisp" relative to
> > where it was invoked since about forever.  How else can we support
> > both installed and uninstalled invocations?  When Emacs is run
> > uninstalled, the Lisp files can be anywhere on the system.  The only
> > difference is that now we _also_ look for the *.eln files in a similar
> > fashion.
> 
> For clarity, by the directory "where it was invoked" do you mean
> the arbitrary directory from which the user runs "emacs", or do
> you mean the directory containing the (real) emacs executable?

The latter, of course.

> If we are able to successfully establish where the (real) emacs
> executable is (and your recent patch looked like it achieved this),
> then surely that can account for the "uninstalled invocations"
> cases as well?

No, because if Emacs is invoked as just "emacs" (or, more generally,
any string without directory separators), then we don't know whether
Emacs was run installed or uninstalled.

> My only concern is that looking for particular filenames in the
> user's arbitrary CWD will be prone to false-positives; so if this
> *is* happening, and there's a better solution at hand, perhaps
> there's no longer any need to do it.

We never look in CWD, unless it happens to be invocation-directory.