emacs-devel
[Top][All Lists]
Advanced

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

Re: eval, load and -l


From: Eli Zaretskii
Subject: Re: eval, load and -l
Date: Tue, 05 Jul 2016 17:52:23 +0300

> From: Stephen Berman <address@hidden>
> Date: Tue, 05 Jul 2016 13:42:13 +0200
> 
> If I understand the Emacs and Lisp reference manuals correctly, I expect
> that, when I have a file foo.el containing Lisp code, the following
> procedures should produce the same results:
> 
> 1. emacs -Q
>    C-x C-f foo.el RET
>    M-x eval-buffer RET
> 
> 2. emacs -Q
>    M-x load-file RET foo.el RET
> 
> 3. emacs -Q -l foo.el

No, item 3 will always be different from the other two.

> But I have code where the result of doing 1 or 2 differs from the result
> of doing 3.

As expected.  In general, everything done by Emacs during startup
might yield different results, because the processing of the command
line and the init files is intertwined with starting a session and
initializing the various sub-systems.  The root cause of all that
complexity is that init files include customizations, some of which
need to be applied before Emacs creates some objects, some after, and
some both before and after.

That is why, for example, evaluating your (or someone else's) .emacs
in a running session doesn't produce identical results as the same
file processed during startup.

> http://lists.gnu.org/archive/html/emacs-devel/2016-07/msg00154.html
> 
> As I noted there, when I evaluate the code in a running Emacs session,
> i.e. as in 1 or 2, I see frame-widening; but when I load the code by
> doing 3, there is no frame-widening.  Is this difference expected

Yes, at least in principle.

> and if so could someone point me to the relevant documentation or
> part of the code that makes the difference?

The order of things done during startup is documented in "Startup
Summary" in the ELisp manual.  The --load command-line argument is
processed in item 21, and then item 26 we recompute frame and window
parameters and other related settings.



reply via email to

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