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

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

Re: use-package :after ??


From: David Masterson
Subject: Re: use-package :after ??
Date: Thu, 11 May 2023 23:54:06 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: David Masterson <dsmasterson@gmail.com>
>> Cc: help-gnu-emacs@gnu.org
>> Date: Thu, 11 May 2023 14:24:08 -0700
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> > And why does it make thing more complicated?  If package FOO should be
>> > loaded after BAR, and BAR should be loaded after BAZ, then the order
>> > I'd expect should be: BAZ, then BAR, then FOO.  Right?
>> 
>> Yes. Will that be handled properly by the following (with global
>> deferred loading)?
>> 
>> (use-package foo :after bar
>>  :config (foo-setup)
>>  )
>> (use-package bar :after baz
>>  # :demand t
>> )
>> (use-package baz)
>> 
>> In particular, use-package will ensure foo-setup is called after foo is
>> loaded, right? If I uncommented the :demand, should/would that make a
>> difference?
>
> I don't think it would make a difference, but why on earth are you
> using :demand there?  It makes no sense to me.

It's a made up example to ask what would happen if one (or more) of the
interdependent packages is demand loaded while the others are deferred.
Via the :after, does the demand load of bar force baz and foo to load?
If not, is that a problem?

> In any case, if there's something unclear here, the problem might be
> with the description of :demand, not with :after -- the node "Forcing
> loading" says :demand is overridden by :defer, but says nothing about
> :after.

Possibly, but the above (made up) example was an attempt to determine if
:after might effect when the loads occur due to a side effect. Perhaps
this side effect might be important in certain cases.

Oh, that Info node says :demand is overridden by :defer, but docstring
for use-package-always-defer says assume :defer unless :demand is used.

-- 
David Masterson



reply via email to

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