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 15:04:50 -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: Wed, 10 May 2023 16:56:35 -0700
>> 
>> >> For instance:
>> >> 
>> >> (use-package org-ac :after org)
>> >> (use-package org)
>> >
>> > What is unclear or not self-evident about the above?
>> 
>> >From the macroexpand, I now understand some of the "magic" of autoload.
>> I'm still missing how the :config (etc.) happens after the autoload to
>> ensure that the package is configured.  That's important in helping me
>> look for side-effects in the :config that didn't work with autoload
>> (ie. I need :demand somewhere).
>
> Would it help to say in the manual that :after's effect is the same or
> similar to with-eval-after-load?

I don't think so.  In 40 years of playing with Emacs, I don't think I've
ever used with-eval-after-load (copied w/o understanding maybe) -- I'm
an old hacker, not an elisp programmer.  Better to talk about the
semantics that :after implements with respect to other things
use-package does that might be affected (defer vs demand, init/config,
...).

> In general, when I'm told that :after causes the package FOO to be
> loaded after another package, my interpretation is that at the end of
> loading that other package Emacs will load package FOO.  If that is
> not what you understand, could you take another look at the
> description of :after in the use-package manual and tell what is
> missing there to convey this meaning?

Basically, I think the sections on :if, :after, and :requires should
make clear what will (should?) happen if package loading is deferred
(individually or globally). Do these happen when use-package is called
or when autoload occurs?  Demand loading should mean they're immediately
evaluated.  Deferred and mixed is more complicated.

For instance, what happens if A should be after B, but you never define
B with use-package? Or B is demand loaded later?

Or make the rule explicit in infodoc that :after does what it does
regardless of demand/defer.

> Or are you saying that my interpretation is inaccurate or incorrect?

I'm thinking I might be over thinking this because nothing else obvious
popped up in my issue with org-ac.  I'll keep looking, though.

Thanks for letting me bend your ear.

-- 
David Masterson



reply via email to

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