From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#53885: 28.0.51 [PATCH] Autoload package-installed-p Date: Thu, 10 Feb 2022 09:57:17 +0200 Message-ID: <831r0bupb6.fsf@gnu.org> References: <83y22kupn7.fsf@gnu.org> <87v8xng5ig.fsf@gnus.org> <83bkzfuu8o.fsf@gnu.org> <871r0bfcdy.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33550"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, 53885@debbugs.gnu.org To: Corwin Brust Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 10 09:10:26 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 1nI4X2-0008Xg-Dl for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Feb 2022 09:10:24 +0100 Original-Received: from localhost ([::1]:35276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nI4X1-0007Xc-6a for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Feb 2022 03:10:23 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:41542) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nI4L4-0000PN-Cp for bug-gnu-emacs@gnu.org; Thu, 10 Feb 2022 02:58:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59784) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nI4L3-000685-RL for bug-gnu-emacs@gnu.org; Thu, 10 Feb 2022 02:58:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nI4L3-0004ul-RI for bug-gnu-emacs@gnu.org; Thu, 10 Feb 2022 02:58:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 10 Feb 2022 07:58:01 +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.164447985418837 (code B ref 53885); Thu, 10 Feb 2022 07:58:01 +0000 Original-Received: (at 53885) by debbugs.gnu.org; 10 Feb 2022 07:57:34 +0000 Original-Received: from localhost ([127.0.0.1]:53681 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nI4Kc-0004tl-1D for submit@debbugs.gnu.org; Thu, 10 Feb 2022 02:57:34 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:34782) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nI4Ka-0004tV-Lz for 53885@debbugs.gnu.org; Thu, 10 Feb 2022 02:57:33 -0500 Original-Received: from [2001:470:142:3::e] (port=50854 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nI4KV-000636-BA; Thu, 10 Feb 2022 02:57:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=I66RlFvuV9eH5icPkYGX3fOb5Hi8nkjRbKfctCFSREI=; b=au7mLcWI85R1 NVLKYBomqD4QeEF4EiVxYas+kCSpovsztx9Zq55jXaaDQlnMI+ndcc4Spl/Df1gMlrJJ3vGLtZxYL +jTB/TTwIox1CP3wL0IWBBtRO9tKPSLcg5uo8c84/8GydwzlQZ8RjdwNwRP/vcFmzh60IVS/jQPQO uC6fwjCQPdXVAwRjlLrj7Mdd7AUuOh9VpI0yn7+umjoXgdMrqgeDhAYd8Z2xc9EV5Cb9NwbrYb1xx iNQTiBi/61A6KDJ85us2uuyAqn45BfojN2vXiLmErt5DbmMFhLwrjorQ3hYUkxicQqhgYlnQmSAtr +5CpdOxZlNWxo14/yHFExQ==; Original-Received: from [87.69.77.57] (port=1172 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nI4KR-0001Gs-2d; Thu, 10 Feb 2022 02:57:27 -0500 In-Reply-To: (message from Corwin Brust on Thu, 10 Feb 2022 01:21:59 -0600) 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:226543 Archived-At: > From: Corwin Brust > Date: Thu, 10 Feb 2022 01:21:59 -0600 > Cc: Eli Zaretskii , 53885@debbugs.gnu.org > > 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. Now I'm confused: which code calls package-installed-p in the scenarios you have in mind? I thought it was use-package, but you seem to say that's not the case?