[Top][All Lists]

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

Re: use-package

From: Stefan Monnier
Subject: Re: use-package
Date: Wed, 04 May 2016 08:09:51 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

> For instance, we cannot do (add-to-list 'package-archives '("org" . "
>";) t) before doing (require 'package).  Well, this
> is a valid case where we need to do require first as package-archives does
> not autoload package.

I'm not saying there aren't valid cases.
I'm saying that when it's needed, we should treat it as a bug.
IOW I consider this specific case as a shortcoming of package.el.

Kind of like advice: if you need to use it, it's usually an indication
that the package lacks some customization hooks.

> I am not qualified enough to judge if yasnippet could have been coded
> better so that I didn't need to lazy load it.  But delaying loading this

yasnippet.el could probably easily be split into two files so only
a "smallish" file is loaded when you activate yasnippet, and the second
larger one is loaded only once you do trigger a snippet-expansion.

> package made a significant difference to my emacs startup, especially
> because I save and load desktop with about 50-60 files open.  I do not need
> yasnippet to load the snippets for all the major modes in those 50-60 files
> immediately at startup.

desktop.el is indeed a source of significant slowdown "by nature".
It's be worthwhile to try and improve desktop.el so that it can do the
loading more lazily.

E.g. we could add some kind of "virtual buffer" functionality, such that
list-buffers displays the buffer and C-x b lets you select it, even
though the buffer doesn't really exist yet, and only once you really
select it is the buffer created.

> (Also, it's easy to simply prevent loading of a package you suspect to be
> misbehaving by adding :disabled keyword for that package's use-package
> form. With that you prevent loading that package and also evaluating your
> config for that package like keybindings, advices, overrides, wrapper
> defuns, etc).

Yes, use-package helps you structure your config, indeed, and that's good.

> I don't understand why that is important.

Because as it stands, use-package encourages users to work around
packages's shortcomings rather than to report those.  It encourages the
perception that it's the user's responsability to setup autoloads and to
avoid all kinds of pitfalls.


reply via email to

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