From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tony Zorman via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#69410: 30.0.50; [WISHLIST] Use-package: allow :ensure to accept package spec instead of separate :vc keyword Date: Wed, 03 Jul 2024 21:51:29 +0200 Message-ID: <8734oqmeym.fsf@hyperspace> References: <87wmqryzv2.fsf@gmail.com> <87jzi6lnjp.fsf@posteo.net> <87wmm55j42.fsf@hyperspace> <87zfr15hqj.fsf@gmail.com> Reply-To: Tony Zorman 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="10934"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Philip Kaludercic , 69410@debbugs.gnu.org To: No Wayman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jul 03 21:53:15 2024 Return-path: Envelope-to: geb-bug-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 1sP62V-0002cN-4K for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Jul 2024 21:53:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sP62I-00088V-Jp; Wed, 03 Jul 2024 15:53:02 -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 1sP62H-000882-Dr for bug-gnu-emacs@gnu.org; Wed, 03 Jul 2024 15:53:01 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sP62F-0000p2-V9 for bug-gnu-emacs@gnu.org; Wed, 03 Jul 2024 15:53:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sP62H-0003Jp-RS for bug-gnu-emacs@gnu.org; Wed, 03 Jul 2024 15:53:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tony Zorman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 Jul 2024 19:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69410 X-GNU-PR-Package: emacs Original-Received: via spool by 69410-submit@debbugs.gnu.org id=B69410.172003633812692 (code B ref 69410); Wed, 03 Jul 2024 19:53:01 +0000 Original-Received: (at 69410) by debbugs.gnu.org; 3 Jul 2024 19:52:18 +0000 Original-Received: from localhost ([127.0.0.1]:40632 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sP61a-0003Ie-9Q for submit@debbugs.gnu.org; Wed, 03 Jul 2024 15:52:18 -0400 Original-Received: from mout-p-102.mailbox.org ([80.241.56.152]:56424) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sP61X-0003IG-Cb for 69410@debbugs.gnu.org; Wed, 03 Jul 2024 15:52:16 -0400 Original-Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4WDr512pQQz9spv; Wed, 3 Jul 2024 21:51:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1720036293; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0KQcnFevHKOkilRM/gm+pTJdoHONELq5fxkBTLEWBwg=; b=rG4NHrlEphIMWVYhOdyWXpkrrlMXLmLmXAU4Pad3YsumM77cG/a4dDYvugUBbZa2pFp/pH ugtjkeoVUM9FC2GQpf4F4raHSdWdsBJk0byCTgS+DCX0G93FtKJUpoDfznNgyo8uerP4A2 dEvTAv9nlhl8Mshf2NTNbPgGOGQiqMMGmWNBzfpmTtF0hoOH7bwMxl9QgvXOvdFmr8MrMF YP9AOMoxlBImN8jvddoUdI7BNrZlKwa6Umo8bQfC0veTdmIyxj7DjFzDPyicY/gJ7SCzrq /W1qzKt7SDeYYRBqIEZm9s9ZMEhJ75/MwkLWpVAixYz+hAU9A56jknr/OSTNew== In-Reply-To: <87zfr15hqj.fsf@gmail.com> X-MBO-RS-META: bjp53znntkdphg3j6ew8ih1jspq7oswp X-MBO-RS-ID: 4c177f79f6da8b3cc5e X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:288333 Archived-At: On Mon, Jul 01 2024 10:06, No Wayman wrote: > Tony Zorman writes: > >> Thanks. To be honest, I'm not a big fan of trying to cram everything >> into :ensure. > > I wouldn't describe it as "cramming everything into :ensure". > :ensure could accept: > > - nil: do not attempt to install anything > - t: attempt to install via the user's chosen default package=20 > manager=20 > - a symbol name: install package matching that symbol name with=20 > default package manager > - a recipe spec: install via a forge capable package manager using=20 > that package recipe.=20 > > It's not that complicated. > If anything, it would encourage package-manager authors to support=20 > a basic subset of keywords for the package recipe spec, increasing=20 > cross-compatibility for package recipes. Ah, I think I have a better idea of what you're trying to do now. Essentially, provide a totally generic interface for :ensure and then let people decide via use-package-ensure-function which package manager they actually want to use? Honestly, that sounds quite reasonable to me. One would have to make sure that certain edge cases are handled (like somehow preserving a version of :vc t and keeping the current functionality of :ensure in tact) but other than that I see no reason why something like this shouldn't be done. > Taking your example, the package installation section of a=20 > package's README would look something like this: > >> (use-package example >> :ensure t >> ;; uncomment one of the following for your package manager=20 >> of choice... >> :vc (:url "https://www.forge.com/maintainer/example") >> :straight (:repo "https://www.forge.com/maintainer/example") >> :elpaca (:url "https://www.forge.com/maintainer/example") >> :some-other-package-manager (:url ...) >> ;; and so on... >> ) > > Using my proposal: > >> (use-package example >> :ensure (:url "https://www.forge.com/maintainer/example")) > > If a package manager decides not to support the :url recipe=20 > keyword, that's on them. Just to make sure: in practice, the only package managers that=E2=80=94right now=E2=80=94support this schema are package.el (by means of :vc) and elpaca, right? Tony --=20 Tony Zorman | https://tony-zorman.com