unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: David Reitter <david.reitter@gmail.com>
To: Emacs development discussions <emacs-devel@gnu.org>,
	bruce.connor.am@gmail.com
Subject: Re: Customizable modes and package.el
Date: Sat, 7 Nov 2015 22:26:01 -0500	[thread overview]
Message-ID: <450F4FF4-8ABE-4BC2-B944-67D10971EEC7@gmail.com> (raw)
In-Reply-To: <jwvk2xyqtww.fsf-monnier+emacs@gnu.org>

On Mar 30, 2015, at 1:28 PM, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
> 
>>>> That's not an option, because the user may need/want to run some Elisp
>>>> code of his own choosing *before* package-initialize is called.
>>>> E.g. in my case, I need to set package-load-list and
>>>> package-directory-list before package-initialize runs.
>>> `package-initialize' could look into some file like
>>> ~/.emacs.d/package-init.el and load that before initializing.
>> Please, not Yet Another File That Changes Emacs' Behaviour
> 
> Exactly.  So, for these reasons, "the solution" is to add
> "(package-initialize)" in the ~/.emacs file.

See also Bug#21858.

Adding (package-initialize) to a user-controlled file is ugly if it has the consequence that it breaks startup of any older Emacs on the system.  
Also, note that the action is not undoable from the menus, even though installing a package can be done via the menu.

Simple kludge:

(if (fboundp ‘package-initialize) (package-initialize))

But, reasonably:

Treat .emacs as something only the user changes.  `custom-file’ is what can be changed by Emacs. (But that one is loaded too late,  in this case.)

If packages are present, can’t (package-initialize) be called unconditionally before .emacs is loaded?   In response to Stefan Monnier’s message from 3/30/2015, perhaps package-load-list and package-directory-list can be set elsewhere, or their functionality eliminated.   Or they could be set in .emacs with a new macro such as 

(eval-before-load 
	(setq package-load-list …))

or even

(set-package-load-list XXX)
(set-package-directory-list YYY)

Even the ~/.emacs.d/package-init.el file proposed by Artur seems more reasonable than what is done now, and it wouldn’t require an extra pass over the user’s .emacs.







  reply	other threads:[~2015-11-08  3:26 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-28  8:58 Customizable modes and package.el Sebastian Wiesner
2015-03-28  9:30 ` Philipp Stephani
2015-03-28 12:26 ` Stefan Monnier
2015-03-28 14:59   ` Sebastian Wiesner
2015-03-28 17:55     ` Artur Malabarba
2015-03-28 20:42       ` Stefan Monnier
2015-03-29 14:48         ` Artur Malabarba
2015-03-30  0:41           ` Stefan Monnier
2015-03-30  7:05             ` Artur Malabarba
2015-03-30 13:39               ` Stefan Monnier
2015-03-30 14:31                 ` Artur Malabarba
2015-03-30 14:55                   ` Robert Pluim
2015-03-30 16:07                     ` Artur Malabarba
2015-03-30 17:09                       ` Drew Adams
2015-03-30 17:28                     ` Stefan Monnier
2015-11-08  3:26                       ` David Reitter [this message]
2015-11-08  3:43                         ` Kaushal Modi
2015-11-08  4:33                           ` Drew Adams
2015-11-08 10:48                         ` Artur Malabarba
2015-11-08 10:50                           ` Artur Malabarba
2015-03-30 17:45               ` Achim Gratz
2015-04-18  1:52                 ` Ted Zlatanov
2015-04-18  4:30                   ` Stefan Monnier
2015-04-18  4:46                   ` Artur Malabarba
2015-03-30 19:06             ` Artur Malabarba
2015-03-30 20:36               ` Stefan Monnier
2015-03-31 20:14                 ` João Távora
  -- strict thread matches above, loose matches on Subject: below --
2015-04-18  8:36 Richard Y. Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=450F4FF4-8ABE-4BC2-B944-67D10971EEC7@gmail.com \
    --to=david.reitter@gmail.com \
    --cc=bruce.connor.am@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).