From: David Masterson <dsmasterson@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: use-package :after ??
Date: Thu, 18 May 2023 20:03:43 -0700 [thread overview]
Message-ID: <SJ0PR03MB545592B480F7178E73898863A27C9@SJ0PR03MB5455.namprd03.prod.outlook.com> (raw)
In-Reply-To: <83fs7uvsd7.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 18 May 2023 13:36:20 +0300")
Eli Zaretskii <eliz@gnu.org> writes:
>> From: David Masterson <dsmasterson@gmail.com>
>> Cc: help-gnu-emacs@gnu.org
>> Date: Wed, 17 May 2023 13:30:24 -0700
>>
>> Eli Zaretskii <eliz@gnu.org> writes:
>>
>> > No, :after says that a will be loaded immediately after b, and _only_
>> > if b is loaded. If b is never loaded, neither will a.
>>
>> So, you're saying, if (via :bind) I call a-mode before a and b have been
>> loaded (but their autoloads are setup), b will not be loaded and,
>> therefore, neither will a (because of :after) causing the call to a-mode
>> via the :bind to fail?
>
> No, I'm saying that :bind will cause Emacs to attempt loading a if you
> invoke the command to which the key was bound by :bind. But if a
> cannot be loaded before b, then when Emacs attempts to auto-load a, it
> will likely signal an error because b was not loaded yet. Or maybe a
> will load successfully, but doing so will not produce the effect the
> user wanted, because b is not loaded.
Ahh, a test is needed to determine how to adjust the docs to better
explain this without getting into the ELisp weeds.
>> :bind is one of the triggers to autoload the
>> package (a in this case), so this would be unexpected.
>
> Which part is unexpected?
Maybe it's my reading. I read :after as a requirement that use-package
could enforce by loading b (if necessary) for a at the appropriate time.
You seem to be reading it as a requirement that, if not met already,
will cause an error of some sort. I suppose my view would be
eval-before-load (which doesn't exist) whereas yours fits
eval-after-load.
>> In your mind, what is the use-case for :after?
>
> Like I said before: :after is just a short for eval-after-load. So
> any use case where a package has another package as its prerequisite
> can use :after. But that doesn't mean you can now forget about
> loading those prerequisites.
Yeah, I had assumed use-package was a little more elegant than that as
it had (via :after) all the info needed to know what should be loaded to
go with the current package load.
As I get more time, I'll play with ERT around this.
Thanks
--
David Masterson
next prev parent reply other threads:[~2023-05-19 3:03 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-08 0:05 use-package :after ?? David Masterson
2023-05-08 2:44 ` Ruijie Yu via Users list for the GNU Emacs text editor
2023-05-08 4:05 ` David Masterson
2023-05-08 4:25 ` Ruijie Yu via Users list for the GNU Emacs text editor
2023-05-08 5:20 ` David Masterson
2023-05-08 12:19 ` Eli Zaretskii
2023-05-10 23:56 ` David Masterson
2023-05-11 3:24 ` David Masterson
2023-05-11 6:14 ` Eli Zaretskii
2023-05-11 21:24 ` David Masterson
2023-05-12 1:18 ` Ruijie Yu via Users list for the GNU Emacs text editor
2023-05-12 6:33 ` Eli Zaretskii
2023-05-12 6:38 ` Emanuel Berg
2023-05-12 5:59 ` Eli Zaretskii
2023-05-12 6:54 ` David Masterson
2023-05-12 7:22 ` Eli Zaretskii
2023-05-15 6:03 ` David Masterson
2023-05-15 11:36 ` Eli Zaretskii
2023-05-15 22:19 ` David Masterson
2023-05-16 16:16 ` Eli Zaretskii
[not found] ` <87pm72m8rc.fsf@penguin>
2023-05-15 6:16 ` David Masterson
2023-05-15 11:42 ` Eli Zaretskii
2023-05-15 22:27 ` David Masterson
2023-05-16 16:19 ` Eli Zaretskii
2023-05-16 20:44 ` David Masterson
2023-05-17 1:40 ` David Masterson
2023-05-17 11:42 ` Eli Zaretskii
2023-05-17 20:30 ` David Masterson
2023-05-18 10:36 ` Eli Zaretskii
2023-05-18 12:41 ` Lynn Winebarger
2023-05-19 2:40 ` David Masterson
2023-05-19 3:03 ` David Masterson [this message]
2023-05-11 5:54 ` Eli Zaretskii
2023-05-11 22:04 ` David Masterson
2023-05-12 6:14 ` Eli Zaretskii
2023-05-12 6:31 ` Emanuel Berg
2023-05-12 6:56 ` David Masterson
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=SJ0PR03MB545592B480F7178E73898863A27C9@SJ0PR03MB5455.namprd03.prod.outlook.com \
--to=dsmasterson@gmail.com \
--cc=eliz@gnu.org \
--cc=help-gnu-emacs@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.