From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Fixing package-initialize, adding early init file Date: Sat, 10 Feb 2018 13:56:13 +0200 Message-ID: <838tc12h42.fsf@gnu.org> References: <83po9vos4z.fsf@gnu.org> <87shelv2m6.fsf@udel.edu> <83vajgh4xe.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1518263690 11449 195.159.176.226 (10 Feb 2018 11:54:50 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 10 Feb 2018 11:54:50 +0000 (UTC) Cc: cpitclaudel@gmail.com, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Radon Rosborough Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 10 12:54:45 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ekTjs-0002J2-39 for ged-emacs-devel@m.gmane.org; Sat, 10 Feb 2018 12:54:40 +0100 Original-Received: from localhost ([::1]:60017 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ekTlr-0004CX-WA for ged-emacs-devel@m.gmane.org; Sat, 10 Feb 2018 06:56:44 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57595) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ekTlj-0004AY-P5 for emacs-devel@gnu.org; Sat, 10 Feb 2018 06:56:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ekTlg-0000eK-FJ for emacs-devel@gnu.org; Sat, 10 Feb 2018 06:56:35 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39704) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ekTlg-0000e0-10; Sat, 10 Feb 2018 06:56:32 -0500 Original-Received: from [176.228.60.248] (port=3539 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ekTlf-00072o-72; Sat, 10 Feb 2018 06:56:31 -0500 In-reply-to: (message from Radon Rosborough on Sun, 28 Jan 2018 11:42:53 -0800) 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:222644 Archived-At: > From: Radon Rosborough > Date: Sun, 28 Jan 2018 11:42:53 -0800 > Cc: emacs-devel > > I've fixed all the problems noted by Stefan and Clément, and rebased > onto the latest master. The revised patch is attached. Thanks, I have a few minor comments below about the documentation parts. > --- a/doc/emacs/package.texi > +++ b/doc/emacs/package.texi > @@ -250,31 +250,18 @@ Package Installation > wide-ranging effects on the Emacs session. For such information, > consult the package's help buffer. > > - By default, Emacs also automatically loads all installed packages in > -subsequent Emacs sessions. This happens at startup, after processing > -the init file (@pxref{Init File}). As an exception, Emacs does not > -load packages at startup if invoked with the @samp{-q} or > -@samp{--no-init-file} options (@pxref{Initial Options}). > + After a package is installed, it is automatically loaded by Emacs in > +all subsequent sessions. Is "automatically loaded" here accurate? Wouldn't it be better to say "it is available in all subsequent sessions, in that its functions and variables will be automatically loaded when needed"? > +the init file but after processing the early init file (@pxref{Early > +Init File,,, elisp, The Emacs Lisp Reference Manual}). As an We cannot document the early init file, which is a user-level feature, only in the ELisp manual. it should be documented in the Emacs user manual, where the "regular" init file is described. > -@findex package-initialize It looks like we are removing the index entry for package-initialize, although it is a command? > +@code{package-enable-at-startup} to @code{nil}. You must do this in > +the early init file, as the variable is read before loading the > +regular init file. There should be a cross-reference here to where the early init file is described. > +@cindex early init file > + Emacs also attempts to load a second init file, called the > + @dfn{early init file}, if it exists. This is a file named There's indentation here which is contrary to how we write stuff in the manual sources. > + @file{early-init.el} in a subdirectory named @file{.emacs.d} in your > + home directory. It's better and shorter to say @file{early-init.el} in your @file{~/.emacs.d} directory Btw, is it only looked up in .emacs.d, or also in the directory where .emacs is searched (which could be just the home directory)? > The difference is that the early init file is ^^^^^^^^^^^^^^^^^ Difference between what and what? > +after loading the early init file, but before loading the regular init > +file and abbrev file (if any) and before running ^ You need a comma here. > +In most cases, you should not need to call @code{package-initialize}, > +as this is done automatically during startup. Simply make sure to put > +any code that should run before @code{package-initialize} in the early > +init file, and any code that should run after it in the primary init > +file (@xref{Init File,,, emacs, The GNU Emacs Manual}). This is for users, so it should be in the user manual, not in ELisp manual. > --- a/doc/misc/org.texi > +++ b/doc/misc/org.texi > @@ -890,9 +890,7 @@ Installation > been visited, i.e., where no Org built-in function have been loaded. > Otherwise autoload Org functions will mess up the installation. > > -Then, to make sure your Org configuration is taken into account, initialize > -the package system with @code{(package-initialize)} in your Emacs init file > -before setting any Org option. If you want to use Org's package repository, > +If you want to use Org's package repository, > check out the @uref{http://orgmode.org/elpa.html, Org ELPA page}. Why was this hunk necessary? > +** Emacs can now be configured using an early init file. > +The file is called 'early-init.el', in 'user-emacs-directory'. It is > +loaded very early in the startup process: before graphical elements > +such as the tool bar are initialized, and before the package manager > +is initialized. Please add here a sentence regarding the purpose of this file (to configure package.el initialization). > +** Emacs now calls 'package-initialize' before loading the init file. > +This is part of a change intended to eliminate the behavior of > +package.el inserting a call to 'package-initialize' into the init > +file, which was previously done when Emacs was started. You only need > +to make changes to your configuration if some of it needs to be run > +before 'package-initialize' is called (for example, if you set > +'package-load-list' or 'package-user-dir'). In that case, place the > +configuration that needs to be run before 'package-initialize' into > +the early init file. Note that variables like 'package-archives' can > +be set after 'package-initialize', so they can still be customized in > +the regular init file. The part starting with "You only need to make changes" sounds unrelated to what precedes it. You should probably insert there something which explains that calling package-initialize before loading the init file eliminates the need for such changes in most cases?