From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: David Masterson Newsgroups: gmane.emacs.help Subject: Re: use-package :after ?? Date: Sun, 07 May 2023 21:05:23 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5371"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Cc: Ruijie Yu To: Ruijie Yu via Users list for the GNU Emacs text editor Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 08 06:11:20 2023 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvsDY-0001FN-Ei for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 08 May 2023 06:11:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pvsCt-0001kA-77; Mon, 08 May 2023 00:10:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvsCr-0001jx-Kt for help-gnu-emacs@gnu.org; Mon, 08 May 2023 00:10:37 -0400 Original-Received: from mail-dm3nam02olkn2080c.outbound.protection.outlook.com ([2a01:111:f400:7e83::80c] helo=NAM02-DM3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvsCp-0008EG-Gb for help-gnu-emacs@gnu.org; Mon, 08 May 2023 00:10:37 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gb45NcKy5L+Slihz2kDLktpWeYCcgqorEnrFI2zpIRWCzAx/D49FX2QVKzm6IuBIwPhWXPVUFpg7pWoyeiXw5dXHZYKZphfVi1t9tpKK+L/9i93qYQSBvks+5rZcwEvOLI1I+KIcbP2jVJVAoWQh/xjBZ0904p17Q25vFp8djCGPobVySFThPkuGcgqHwwaegDgHyzdiQEDc7tx1FkLSNk3slqIkpnaml951B7UGKqCBu+NLHtUGFq6Ya1CLuxJMDGoF8L6t9zwH3CScdn9d/QiSC/ENzTP5fuWQX4QdNGasLkygDCGt7RIhyYXOwOBzPvYGo+IR3qTbtPAZAolpYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=lJ6jD5WdauRiclkYqJZxuMp3OFR/gd5P6uJKecaI76w=; b=MCZr8tk9g7l6e03hv+iHF93EMyEfInCfHSBiln+XqOQ4dTC3dROto2uLy4GJHg/3xqHfbYINhqYomF3MmGgEYaOtb7dcMsPplrXh6cqOIJi2iKie0AwM3PzwOnv6jn/O97TYb1zWRNK55Zm+6LN419bsEMFkhab7g0TgCrEpvYlA/IFihKZvPk12mrr4dSTgZWyInb4a2Lya2TERM5QJwH9V7Y1uUwFn+3XBpXFFy0TFmodOuWseE8B5IwOcSG95yKuW5Kfaanfk2NDg2H9DrzOsXq4g/zLPHcArUpYbrDSuOme4/C1F5U+4x8R/n9aovyQYazaEMNByKXCPnjRTWw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lJ6jD5WdauRiclkYqJZxuMp3OFR/gd5P6uJKecaI76w=; b=QBTxTYxvQTWQTpOfVXdSHbb+Buwmth67dbia87idXqSeRCTU49/lKWIeB+REfNZ9pFHXEJRpF1pRL+YcOBKKEJXi+xg1XB+ZGYhFyjkfDJpgsEVil/usOcpKtFKTDOV4hlIvpEI+gIGigkbzrHXwekfOS3bnnp8iBFnFKhi9Zx+09c3iSHXHPmA2fHxsSISnV++U/mLrQ4FYlTwpZIyuFakOa93vZ/CmmykynjRnupDy+KdtTRX+XXZkllkLcF2sOO9r3TB/TN0PW3r0Rs7bc3kFeqChg/WfPdSTy9H1F7cDUKFsmQ7Eaz8A+Dh3Ca+5WfCa1jKwlwL6a1YJuF4H6A== Original-Received: from SJ0PR03MB5455.namprd03.prod.outlook.com (2603:10b6:a03:27b::11) by SJ0PR03MB5662.namprd03.prod.outlook.com (2603:10b6:a03:285::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.32; Mon, 8 May 2023 04:05:31 +0000 Original-Received: from SJ0PR03MB5455.namprd03.prod.outlook.com ([fe80::659c:97b8:e5d2:9f7a]) by SJ0PR03MB5455.namprd03.prod.outlook.com ([fe80::659c:97b8:e5d2:9f7a%2]) with mapi id 15.20.6363.032; Mon, 8 May 2023 04:05:31 +0000 In-Reply-To: (Ruijie Yu via Users list for the's message of "Mon, 08 May 2023 10:44:10 +0800") X-TMN: [1dxn+ZIjyPQJxfWVrzKwrbygXD6Jp3YtBp8/7rKEDSg0X5zG7Y01RuLMD7a+FttX] X-ClientProxiedBy: PH8PR15CA0006.namprd15.prod.outlook.com (2603:10b6:510:2d2::14) To SJ0PR03MB5455.namprd03.prod.outlook.com (2603:10b6:a03:27b::11) X-Microsoft-Original-Message-ID: <87a5yfa2nw.fsf@penguin> X-MS-Exchange-MessageSentRepresentingType: 2 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR03MB5455:EE_|SJ0PR03MB5662:EE_ X-MS-Office365-Filtering-Correlation-Id: db822acc-f0dc-469c-e282-08db4f797753 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OAzMerTujJq0hvsaYrkjtvBNFeljOdqV3aSfhgnCJvSXsTfXg4Vh3rDvBBpHoRXjf1ammcwXe1YRHupQTs6WLIAnaPn/FFzwqyy4vWR27kGABB6XxS/36/mXrPPjZfyACU5gBdmTVTaUmi0+NzVuxSaYDlhm8On3/wgNXlMHPxWmZs6L+f7eB+3+eiynBb06cD3FKEzxQSaX6Z4Ys9lYJ40Kx2oaYDkhWxncG8ePAzcKh/hWdTTkQAVkZrmMPD/2mHb4m9zzzbo8QPUu8uaIss7bASxDBr/k9lLhO5GoWa0iWynZ0RDacmYQy5nMk0C10jHuOkV1L4c12IzBgcaV4FQeZ+/59L1XTP0NWym0nruZwsiu3kYJVgc82P9zFrZj/xk5KS7DwHHUFCkcRVN/d+4CxAODvNG2sm2jX3cwyHHSLctbdtyBj0zcSgC/EgmNT8PM3fHbVsHOtDI3YtGyfmRmxSSY9kgd3Zp/Re05gkipsabaR18B/3cVSxuL7HXYmSn41qGbJ8GUMz6EcopwxTegjokMRz72aIhuTpWC9+P43dl3REFvzRxqT/3eqptdbOqxZZdTFk+qID/lr1+IivvPGzIQp8V49X5zrZdjcTPrYy+faEu71YVz6pGghzlf X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?8jEveraQEYlyRaIlaqBSfhUjSaFHm5GCILw/Bz00/nX8EWmBEd9tfMJQQcJc?= =?us-ascii?Q?YvEeyn3tsSXa/sqlXmPzM63jxlbEmwu5cFlbVp/pJo46yXw1xV0uTIPYJofB?= =?us-ascii?Q?QmQDu+PCRZXex4kqfjhguj/9U6GooEcqIzCpLs9ZCOI5wCEkd+aeRVDSTU+z?= =?us-ascii?Q?H3S1mQFvlZ1ZGTvsl/6FFDEjUBVl65xbE/RWxy4YKV3ScOo2PLp5EGGdKrVY?= =?us-ascii?Q?McCqs3zG6HgMvPet4MIrb6cMuQXbEsPcUASf4mE2EvKB0avi3te1rkqZrrok?= =?us-ascii?Q?Os2GC3kpqDZ/K4LHWXMExs33u1UD/Rm52ucYd3GC8LSRXE1n2sVMR8p3ak6d?= =?us-ascii?Q?xMSikpGyAE5L2APOmjLgMqQdXzra300l1LFJgD2NNKGzuBby9PhEKHEqo/fb?= =?us-ascii?Q?30UBfMrITpuy4p8POc9sff7prCu4UfRbakWLE80I6p3I0WpZAsFUlz9bmgPA?= =?us-ascii?Q?vtSy9e1Oe1+DPfWoHlcgfzlc2YDWeI335MxaEiCIkGVMe3c6+ZBg78F7lxyo?= =?us-ascii?Q?fNCtUHfgHoyHVI6sNnTAjNcGzYy0p7r619a431CeHKjcW7oE0rV1A6Rdmyc/?= =?us-ascii?Q?5GPjXDWZe5T63EZgaXlhni+WENSghJ+QpIFuSc4nUOGR7EGoWAnowlKS+287?= =?us-ascii?Q?U0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: db822acc-f0dc-469c-e282-08db4f797753 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB5455.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2023 04:05:31.7647 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB5662 Received-SPF: pass client-ip=2a01:111:f400:7e83::80c; envelope-from=outlook_98C99531806B1C22@outlook.com; helo=NAM02-DM3-obe.outbound.protection.outlook.com X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FORGED_GMAIL_RCVD=1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:143533 Archived-At: Thanks for the followup. Ruijie Yu via Users list for the GNU Emacs text editor writes: > David Masterson writes: > >> 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. >> >> If #1 is correct, I do not know how the current package will ever be >> loaded if ":after" fails. If #2 is correct, I do not know what the >> "magic" could be to safely do this. > > TL;DR: #2, see below. I tried to write it to be skimmable. ;) >> For instance: >> >> (use-package org-ac :after org) >> (use-package org) > > This is what I get when I `macroexpand' the first `use-package' call > with `use-package-always-defer' set to nil. Which I assumed is the default and goal (defer all packages until you need them). > [ If `u-p-a-defer' is set to t when I `macroexpand', the > `eval-after-load' call reduces to nil on expand-time because this > package is not installed, nor does `package.el' know how to install it > because I only have gnu and nongnu elpa configured. ] Understood > (progn > (defvar use-package--warning3 > #'(lambda > (keyword err) > (let > ((msg > (format "%s/%s: %s" 'org-ac keyword > (error-message-string err)))) > (display-warning 'use-package msg :error)))) > (condition-case-unless-debug err > (eval-after-load 'org > '(if > (not > (require 'org-ac nil t)) > (display-warning 'use-package > (format "Cannot load %s" 'org-ac) > :error))) > (error > (funcall use-package--warning3 :catch err)))) Hmm. > So, this might help you understand what is happening under the hood. > Essentially, it will try to load org-ac, only after *all packages* > listed in the :after section, showing a warning if loading org-ac fails. I presume the 'if' gets more complicated and more 'eval-after-load' calls are done if :after lists more than one item, correct? > Keep in mind, according to the macroexpand result, that this also means > that if you load the subpackage `org-ac' manually (via a hook, autoload, > etc), it is not going to try to load `org' at all. I feel that this is > kind of strange, but maybe it has its reasons. Hmm. > It seems that you opted to go with setting `u-p-a-defer' to t. And > since you didn't mention :ensure at all, I assume you set `u-p-a-ensure' > to t as well. I'm looking at 'ensure'. I currently use 'auto-update' package. > In this case, order doesn't _really_ matter, you just need to > `(use-package sub-pkg :after main-pkg :config your-other-configs)' on > all your subpackages. I thought I had. I even had 'org' before 'org-ac' (but after 'auto-complete') in .emacs, but things weren't working right until I hand loaded 'org-ac'. I'll have to test this some more. How did you do the macroexpand to debug this? I haven't seen that technique. Looks interesting. > Note, since you use `org' as an example, that you should probably > `(use-package org)' first thing in your init.el, because otherwise > something else is probably going to load builtin `org', and the Elpa > `org' will complain afterwards about mismatched versions. Yes, I ran into that. I wound up removing the builtin manually. I believe org has been trying to fix this. Thanks -- David Masterson