From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Corwin Brust Newsgroups: gmane.emacs.bugs Subject: bug#53885: 28.0.51 [PATCH] Autoload package-installed-p Date: Thu, 10 Feb 2022 01:21:59 -0600 Message-ID: References: <83y22kupn7.fsf@gnu.org> <87v8xng5ig.fsf@gnus.org> <83bkzfuu8o.fsf@gnu.org> <871r0bfcdy.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15224"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 53885@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 10 08:51:28 2022 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 1nI4Eh-0003nO-Ua for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Feb 2022 08:51:27 +0100 Original-Received: from localhost ([::1]:47778 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nI4Eg-0003ql-Px for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Feb 2022 02:51:26 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:34028) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nI3nE-0001xo-UF for bug-gnu-emacs@gnu.org; Thu, 10 Feb 2022 02:23:06 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59693) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nI3nC-0004uV-Hs for bug-gnu-emacs@gnu.org; Thu, 10 Feb 2022 02:23:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nI3nC-0007gw-ES for bug-gnu-emacs@gnu.org; Thu, 10 Feb 2022 02:23:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Corwin Brust Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 10 Feb 2022 07:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53885 X-GNU-PR-Package: emacs Original-Received: via spool by 53885-submit@debbugs.gnu.org id=B53885.164447773829484 (code B ref 53885); Thu, 10 Feb 2022 07:23:02 +0000 Original-Received: (at 53885) by debbugs.gnu.org; 10 Feb 2022 07:22:18 +0000 Original-Received: from localhost ([127.0.0.1]:53587 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nI3mT-0007fT-UY for submit@debbugs.gnu.org; Thu, 10 Feb 2022 02:22:18 -0500 Original-Received: from mail-ej1-f49.google.com ([209.85.218.49]:35441) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nI3mS-0007f6-Io for 53885@debbugs.gnu.org; Thu, 10 Feb 2022 02:22:16 -0500 Original-Received: by mail-ej1-f49.google.com with SMTP id y3so13153955ejf.2 for <53885@debbugs.gnu.org>; Wed, 09 Feb 2022 23:22:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=sdnZF80h2RC7RMwtpPOhLpZOvdX7ibhuX+6j+OEES6s=; b=yauK0QBdWq+dtGkbNncgbaVnnDqW7bIJeZj61z0sdMgYXN8oVmSRNmn3G0VyhgqgEF cvwNKf+o8A93tgkyFKTg2Dxj5ioTkZ8tACcbOAgUOzdt5lYkaYMWLLyUZWIaAH/Ao4MO uxjL2RdjsKsCCS0l/wF493PQ5FmlkH2BWwySGbC8hAXonx6fc99V/U+xChMD0EeboCcW 6YDmBewjydi/Gxg6sZS9fkAnGJS8jTyZ5FDztpX07b96+TC10EiXJ0iWzAr3kZOHK2Zx XYBzEGfq4JrB/VoChdQ5pJIweaMeaeYB640Jem+0nuF3VjGeeQb1f9GWX8ox4Eyd5jHL xeqw== X-Gm-Message-State: AOAM533xey9oaDVAaSF0GpXDCdvZcIwQamVCjjWqmFrVnaBBHbBvUSXl N/Rh/NypIrr46BWbBR7vqhuWU6pTv4dsA8+Wb6Q= X-Google-Smtp-Source: ABdhPJx4rvUbiEgjH3kJ4GV+GmvNLdAAdI/LZk8IrqsFeLLRPIe6eycyBRZANfQR4kKgwURj3kZnEk8CFeSPrL+75pA= X-Received: by 2002:a17:907:3f97:: with SMTP id hr23mr5177882ejc.578.1644477730700; Wed, 09 Feb 2022 23:22:10 -0800 (PST) In-Reply-To: <871r0bfcdy.fsf@gnus.org> 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" Xref: news.gmane.io gmane.emacs.bugs:226539 Archived-At: On Thu, Feb 10, 2022 at 12:45 AM Lars Ingebrigtsen wrote: > > Eli Zaretskii writes: > > > Thanks, but I don't think I understand the relevance, probably because > > I don't use use-package. Why do you need package-installed-p to be > > autoloaded in this scenario, and why cannot use-package do that by > > itself? > > Yes, that's the puzzling thing. But I've never used use-package > myself -- I assumed that it was a framework built around package.el, but > perhaps it's not related to package.el at all? > I'm sure I follow the logic here. If use-package isn't installed, how does it matter what relationship it may have to package.el? That said, one can replace `use-package' with any feature not present in Emacs as shipped. Perhaps the use-case is more generally expressed as such: I would like to have my init scripts automatically install a package that isn't available "out of the box", but only if that feature hasn't already been installed. As things presently stand, `package-installed-p' is nearly perfect for this, however one must take care to ensure package.el has been manually loaded before calling it, in order to avoid Emacs raising the error shown in the original report.