From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Psionic K Newsgroups: gmane.emacs.help Subject: Re: Reacting to package load Date: Tue, 28 Nov 2023 11:12:53 +0900 Message-ID: References: <87y1ejpmbz.fsf@thaodan.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40732"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Psionic K , help-gnu-emacs@gnu.org To: =?UTF-8?B?QmrDtnJuIEJpZGFy?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 28 03:13:50 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 1r7nbi-000AOH-08 for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 28 Nov 2023 03:13:50 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r7nb7-0007Jj-E5; Mon, 27 Nov 2023 21:13:13 -0500 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 1r7nb5-0007JM-Fl for help-gnu-emacs@gnu.org; Mon, 27 Nov 2023 21:13:11 -0500 Original-Received: from mail-yb1-xb2e.google.com ([2607:f8b0:4864:20::b2e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r7nb2-0001qw-Ay for help-gnu-emacs@gnu.org; Mon, 27 Nov 2023 21:13:11 -0500 Original-Received: by mail-yb1-xb2e.google.com with SMTP id 3f1490d57ef6-daf26d84100so4521752276.3 for ; Mon, 27 Nov 2023 18:13:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=positron.solutions; s=google; t=1701137586; x=1701742386; darn=gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=JZ/4d+ACW7RpVEI2YL1THMRHyQfHPwraA9Gpb7b45iA=; b=UyepzJvFF1s8lTCYtv/qMUvY9sZITjnk6qfoXBYTmvmmYl6iWF7EBI/kgdEOc2y7/L VbqjQibjg231nZ2X1WUUW+2fkyiSpbEkBvqh7pQCHme+iJ/YIgnvwIQRzmPovoM/0AKn bq3dGvRwnvXaERjy5LAcTC5kgNVS2zs//iHWIyzsm0XdrjiVLuQ25s8l9GLzXJvEE6V8 W6YEWac/e42LB0EWo+hMWYcsLia54phpB+HsrdnG8paZNAY0+yzD5FNgnke/MvLLq5gw ZlF25IrMeLteNmflVIIE18shzEgejOLM04ie3/tNJTldt6sD2OY5ge1I2+Km4iCjRSUc 5u5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701137586; x=1701742386; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JZ/4d+ACW7RpVEI2YL1THMRHyQfHPwraA9Gpb7b45iA=; b=X79sO6acQGC78+9U0zI0M4B1N8ukdlKOscSImUvYwEKTCUMtqFd7Axs6i/qD023QMB ED4YpTkvE3FIvND5QQ5t5r0UG7Zle3ykczPIX3Qk3EAx+qUnw6WoRLcji898TbOllo9E MsCrLpF72VTzvQD96zWKAr0I0OmLAiZQfW/1qnHmUm6I1mnGyPqUxXmh5ZsqY50wR/VR /Sg1l33nl0FkdJjy9tKbJgPN46VLOwAZ4zwgTvpXblrMfClCIdK55nxthhIHVauUly7T J5oHdNJYrkh/GELmC56N/VaSaYIRBSC8ZAnN8Z5wB5cWgfWtCl4TTds6lqt8QblNAmNi ztDw== X-Gm-Message-State: AOJu0YzSMfC1mI/8vlvaLwNGOLE0JG5sEY2QsNjacZOxmXjjqS2/xyyh MgibLYZWeazCcIhxYrrGxWq3olqJT//g3RQj53jQ7Q== X-Google-Smtp-Source: AGHT+IHEDqWRLrlwYH2pLWxmjQwZ62FMqYDMYBTKdMBXiwlIjIcQDpYWG9iLwowcCdGBI5Ohq5bd7gDNrWo3p08Jd+w= X-Received: by 2002:a25:fb10:0:b0:da1:b041:70ac with SMTP id j16-20020a25fb10000000b00da1b04170acmr12671576ybe.10.1701137584834; Mon, 27 Nov 2023 18:13:04 -0800 (PST) In-Reply-To: <87y1ejpmbz.fsf@thaodan.de> Received-SPF: pass client-ip=2607:f8b0:4864:20::b2e; envelope-from=exec@positron.solutions; helo=mail-yb1-xb2e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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:145577 Archived-At: > Not in all cases it's good to check for dependencies only after the depending package was loaded. Yes, and this will continue to be true for packages that resolve and configure external dependencies at load time rather than dynamically after giving us a chance to react. I'm going with after-load-functions for now. In the future, packages will cooperate with dependency management through a new package header to communicate which non-elisp packages are required. Long term, Emacs needs to mediate the implementation of providing external deps in reaction to loaded Elisp deps. A non-standard hook such as before-load-functions will enable external dependency managers to pre-empt missing software before any chance for problems downstream. To be clear, these dependency managers will be agnostic to Elpaca, Straight, package.el etc. They don't care what they are doing, just which package got loaded so they can see if the dependency is already available. If there's a more obvious extra header name than X-Package-External to describe a non-elisp dependency, please say so. I am using an X prefix because I have seen this used for other additional headers that don't have a standard meaning yet. The contents of the header needs to accommodate both generic and specific styles so that more specific declarations can override generic ones For an example: X-Package-External: (((nix . "cowsay") (guix . "cowsay") "cowsay")) Each entry is a list for one dependency. The dependency is specified via generic paths in a string and then in specific paths with a cons if necessary. I'll take a closer look at Guix. I didn't identify anything concerning, but I've lost familiarity. IIRC both Nix and Guix support more explicit string paths where necessary. The external dependency managers and use-package will of course override packages to alleviate pressure on upstreams, via new keywords and supplying values for missing headers. In the beginning, this will be the only available mechanism. On Mon, Nov 27, 2023 at 6:38=E2=80=AFPM Bj=C3=B6rn Bidar wrote: > > As Eli already said there's eval after load but there's also > featurep to check if a feature is present. > Not in all cases it's good to check for dependencies only after the > depending package was loaded. > --=20 =EB=82=A8=EB=B0=B1=ED=98=B8 =EB=8C=80=ED=91=9C =EA=B2=B8 =EA=B3=B5=EB=8F=99 =EC=B0=BD=EC=97=85=EC=9E=90 =ED=8F=AC=EC=A7=80=ED=8A=B8=EB=A1=A0