GNU bug report logs - #69410
30.0.50; [WISHLIST] Use-package: allow :ensure to accept package spec instead of separate :vc keyword

Previous Next

Package: emacs;

Reported by: No Wayman <iarchivedmywholelife <at> gmail.com>

Date: Mon, 26 Feb 2024 16:26:03 UTC

Severity: wishlist

Found in version 30.0.50

Full log


View this message in rfc822 format

From: Tony Zorman <soliditsallgood <at> mailbox.org>
To: No Wayman <iarchivedmywholelife <at> gmail.com>
Cc: Philip Kaludercic <philipk <at> posteo.net>, 69410 <at> debbugs.gnu.org
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
On Mon, Jul 01 2024 10:06, No Wayman wrote:
> Tony Zorman <soliditsallgood <at> mailbox.org> 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 
>   manager 
> - a symbol name: install package matching that symbol name with 
>   default package manager
> - a recipe spec: install via a forge capable package manager using 
>   that package recipe. 
>
> It's not that complicated.
> If anything, it would encourage package-manager authors to support 
> a basic subset of keywords for the package recipe spec, increasing 
> 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 
> package's README would look something like this:
>
>>   (use-package example
>>     :ensure t
>>     ;; uncomment one of the following for your package manager 
>>     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 
> keyword, that's on them.

Just to make sure: in practice, the only package managers that—right
now—support this schema are package.el (by means of :vc) and elpaca,
right?

  Tony

-- 
Tony Zorman | https://tony-zorman.com




This bug report was last modified 96 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.