Subject: bug#36828: 27.0.50; Uninstalled emacs shows installed documentation

From: Eli Zaretskii <[email-masked]>
Date: Sat, 26 Oct 2019 16:45:54 +0300

> From: Óscar Fuentes <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Sat, 26 Oct 2019 15:27:00 +0200
> 
> > OK, but then the logic in your proposed change changes too radically
> > what we've been doing until now: it will cause Emacs to use the NEWS
> > in the source tree even if you run the installed binary.  That is not
> > TRT, IMO.
> 
> If my change causes that, it is no acceptable, indeed.

AFAICT, decode_env_path (0, PATH_DUMPLOADSEARCH, 0) returns the lisp
directory in the source tree, even in the installed binary, as I'd
expect.  Then ../etc relative to that will point to the source tree as
well.

> > We need some way of detecting the situation whereby Emacs is being run
> > from a separate build directory, and using the NEWS from the source
> > tree only then, as fallback.
> 
> Right now I must leave so a quick question: what about beginning with
> setting data-directory to the source tree in init_callproc_1 when we are
> running from a non-installed Emacs? (Assuming that we can detect that
> condition)

We currently detect that by the condition that doesn't work in your
case:

      if (!NILP (Fequal (srcdir, Vinvocation_directory))

If we solve that problem, we can solve your problem as side effect,
right?