help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: use-package :after ??


From: Eli Zaretskii
Subject: Re: use-package :after ??
Date: Mon, 08 May 2023 15:19:59 +0300

> From: David Masterson <dsmasterson@gmail.com>
> Date: Sun, 07 May 2023 17:05:57 -0700
> 
> This might be a documentation problem...
> 
> I'm not sure I understand ":after" (and a few other related things) in
> use-package.  The info docs talk about it ensuring that the current
> package is loaded after the other listed packages, but it's not quite
> explicit (to me) about what that means.  I interpret it in two possible
> ways:
> 
> 1. If any of the listed packages are not loaded currently, then the
> current package will not be loaded. Period.
> 2. #1 + "magic" will be done to ensure that, once the listed packages
> are loaded, the current package will be (auto?) loaded.

Which parts of the documentation make the answer to this question less
than obvious?  There should be no need to expand the use-package
macros to understand what it is doing; just reading the documentation
should be enough (and it is for me, FWIW).

> My goal is to organwize my .emacs loading of 25+ packages to only load if
> needed.  That means (almost) all packages are deferred at startup and
> will load itself and subpackages (minor modes, etc.) when I try to call
> the package.  This is what I hoped :after was for.

AFAIU, :after is not about deferral, it's about the conditions to
load.  use-package has other features for deferral, like :defer and
use-package-always-defer.

And for loading when needed you have autoloads, of course.

> Can someone advise on the proper use of ":after" and how to get
> appropriate subpackages to also load when the main package is loaded.
> For instance:
> 
> (use-package org-ac :after org)
> (use-package org)

What is unclear or not self-evident about the above?



reply via email to

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