Subject: Re: bug#78304: 31.0.50; Support --early-eval on the command line

From: Eli Zaretskii <[email-masked]>
Date: Fri, 16 May 2025 15:42:11 +0300

> From: Ship Mints <[email-masked]>
> Date: Fri, 16 May 2025 08:24:07 -0400
> Cc: [email-masked], [email-masked], [email-masked]
> 
> The documentation for -L doesn't say that it doesn't affect
> site-start.el.

It does now.

> If one specifies EMACSLOADPATH before starting Emacs, that does work to find site-start.el,
> ignoring whatever system-wide site-start.el exists (which is what I'd want).  I expected the behavior of -L and
> EMACSLOADPATH to be in sync.

You cannot expect that, in general.  The command-line arguments are
processed in certain unspecified order, some of them in C, others in
Lisp.  Those that are processed in Lisp are handled at some stage of
the startup, and it should be clear that before a command-line option
is processed, it cannot take its effect.  So it should be clear that
_some_ part of the startup process runs without the effect of the
option.  Which part exactly is unspecified, so it is best to consider
the startup process as a single monolith, and assume the options are
in effect only after the startup is done.

Also, EMACSLOADPATH is _not_ the equivalent of -L.  The Emacs user
manual says:

  ‘EMACSLOADPATH’
       A colon-separated list of directories(1) to search for Emacs Lisp
       files.  If set, it modifies the usual initial value of the
       ‘load-path’ variable (*note Lisp Libraries::).

Note the "initial" part.  IOW, EMACSLOADPATH is intended to completely
replace the built-in value of load-path, not to augment it.

In any case, I don't think that this subtle issue is related to the
bug being discussed here.  It's a tangent.