From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: eval, load and -l Date: Tue, 05 Jul 2016 17:52:23 +0300 Message-ID: <83wpl0nnmg.fsf@gnu.org> References: <871t381fca.fsf@gmx.net> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1467730552 23917 80.91.229.3 (5 Jul 2016 14:55:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 Jul 2016 14:55:52 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stephen Berman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 05 16:55:48 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bKRlJ-00039q-Pv for ged-emacs-devel@m.gmane.org; Tue, 05 Jul 2016 16:55:45 +0200 Original-Received: from localhost ([::1]:55594 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKRlJ-00080l-0Y for ged-emacs-devel@m.gmane.org; Tue, 05 Jul 2016 10:55:45 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49993) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKRik-0006o1-Un for emacs-devel@gnu.org; Tue, 05 Jul 2016 10:53:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKRih-0000Yy-RB for emacs-devel@gnu.org; Tue, 05 Jul 2016 10:53:06 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46355) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKRih-0000Yp-O9; Tue, 05 Jul 2016 10:53:03 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3199 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bKRie-0001SQ-QH; Tue, 05 Jul 2016 10:53:03 -0400 In-reply-to: <871t381fca.fsf@gmx.net> (message from Stephen Berman on Tue, 05 Jul 2016 13:42:13 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:205179 Archived-At: > From: Stephen Berman > 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.