From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.bugs Subject: bug#67916: 30.0.50; No lexical-binding directive warning in -pkg.el files Date: Wed, 20 Dec 2023 18:54:49 +0000 Message-ID: <87sf3wbt6u.fsf@posteo.net> References: <87msu5q2vx.fsf@epfl.ch> <87y1dpon3v.fsf@epfl.ch> <87jzp8dhz8.fsf@posteo.net> <8734vwkaqi.fsf@epfl.ch> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9339"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 67916@debbugs.gnu.org, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , Stefan Monnier To: "Basil L. Contovounesios" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 20 19:56:45 2023 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 1rG1kL-0002EO-GS for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 20 Dec 2023 19:56:45 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rG1k1-0008EB-NA; Wed, 20 Dec 2023 13:56:25 -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 1rG1jq-0008Dj-0S for bug-gnu-emacs@gnu.org; Wed, 20 Dec 2023 13:56:15 -0500 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 1rG1jb-0000LO-3h for bug-gnu-emacs@gnu.org; Wed, 20 Dec 2023 13:56:13 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rG1je-0005rv-Bg for bug-gnu-emacs@gnu.org; Wed, 20 Dec 2023 13:56:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Dec 2023 18:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67916 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 67916-submit@debbugs.gnu.org id=B67916.170309850922494 (code B ref 67916); Wed, 20 Dec 2023 18:56:02 +0000 Original-Received: (at 67916) by debbugs.gnu.org; 20 Dec 2023 18:55:09 +0000 Original-Received: from localhost ([127.0.0.1]:41800 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rG1ij-0005qh-Ea for submit@debbugs.gnu.org; Wed, 20 Dec 2023 13:55:08 -0500 Original-Received: from mout01.posteo.de ([185.67.36.65]:35815) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rG1if-0005pp-3N for 67916@debbugs.gnu.org; Wed, 20 Dec 2023 13:55:05 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 4E39A240027 for <67916@debbugs.gnu.org>; Wed, 20 Dec 2023 19:54:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1703098491; bh=1RVk2ULYEryvNCIFv9jqfpFs2B5MPzXlKdr2ozZ00Rs=; h=From:To:Cc:Subject:Autocrypt:Date:Message-ID:MIME-Version:From; b=L/pEU6ZJsbYolDDFMhbptQNKQ6gvJCW59l2+uuOwEp82xLNgwNQPHPycTLdPHNLQY orKyZcFGXSXf4aLs1XVIe0dS3qd9TOm79pM3cOnK99lsW0/det2quftdoUhfLk/ah8 PjtzbEWfAruo0cyZDg5XW9kRcqjtSoFw1okheNzrOTjBmFKYiIaX8TmV5+2G0C3YEX 2bvX710yn69GdUlszfmH3to/DfKN72QVkJKq5315VqRUDQmu3TFumbH/ThQ5YRbja0 TMnt4MaVkN79SOBFJTkOCd/lwTeeVVLd2MRseByGfxbFrDbGLjMDHNIad+jVy0siOe bYLeP0n+i/FvQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4SwN615Qxrz6twG; Wed, 20 Dec 2023 19:54:49 +0100 (CET) In-Reply-To: <8734vwkaqi.fsf@epfl.ch> (Basil L. Contovounesios's message of "Wed, 20 Dec 2023 19:08:37 +0100") Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM 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:276586 Archived-At: "Basil L. Contovounesios" writes: > Philip Kaludercic [2023-12-20 15:14 +0000] wrote: > >> "Basil L. Contovounesios" writes: >> >>> package-vc--generate-description-file currently passes: >>> :kind 'vc >>> unquoted to define-package, which results in the -pkg.el contents: >>> (define-package ... :kind vc ... :keywords '(...) ...) >>> Note the difference in quoting between :kind and :keywords. Is this >>> intentional? Or can/should :kind pass through macroexp-quote as well? >> >> This is not intentional, if anything a lucky oversight. > > Lucky in the sense that it's preferable this way, or just an accident? ;) The latter. >>> Questions for Stefan: >>> >>> - Which version of Emacs can/does elpa-admin.el assume? >> >> All I can say is that the ELPA build server, the main user of >> elpa-admin.el, has Emacs 28.2 installed. > > I'm wondering because elpa-admin.el seems to contain some compatibility > code for Emacs 26 (elpaa--select-revision, elpaa--write-pkg-file) and > Emacs versions <28 (elpaa--get-section, elpaa--html-build-doc). My guess is that it was just not removed, but I'll just let Stefan explain that. >>> (defgroup package nil >>> "Manager for Emacs Lisp packages." >>> :group 'applications >>> - :version "24.1") >>> + :group 'tools >>> + :version "30.1") >> >> I am not sure if bumping :version is necessary (here and above). > > I think it's unnecessary in the sense that I don't know of any place > where this information is displayed, but otherwise I thought it was good > form to do this since any change in :groups is user-visible. My understanding was that this information is supposed to indicate when the group was added, while each member of a group that has since been changed would have a newer :version tag. >>> (define-inline package-vc-p (pkg-desc) >>> "Return non-nil if PKG-DESC is a VC package." >>> - (inline-letevals (pkg-desc) >>> - (inline-quote (eq (package-desc-kind ,pkg-desc) 'vc)))) >>> + (inline-quote (eq (package-desc-kind ,pkg-desc) 'vc))) >>> + >>> +(define-inline package--unquote (arg) >>> + "Return ARG without its surrounding `quote', if any." >>> + (inline-letevals (arg) >>> + (inline-quote (if (eq (car-safe ,arg) 'quote) (cadr ,arg) ,arg)))) >> >> Honestly, the usage of define-inline was probably a premature >> optimisation on my part, I don't think we really need it here either. > > You mean, you prefer package--unquote being a plain function? Yes. > [ To be honest, I'm slightly inclined to add this to macroexp.el > instead, since it's a somewhat common operation. ] My only concern is that this would slightly complicate the initiative of adding package.el to GNU ELPA, if that is to proceed at all. >> You removed (require 'inline) anyway, or is it now preloaded? > > define-inline is autoloaded, and there are no other in-tree occurrences > of (require 'inline). Nevermind then. >>> +;; Potentially also used in elpa.git. >>> +(defun package--write-description-file ( file name version doc reqs extras >>> + &optional extra-props verbose) >>> + "Write a `define-package' declaration to FILE. >>> +Absolute FILE names the -pkg.el description file. >>> +NAME, VERSION, and DOC are the leading, and EXTRA-PROPS the >>> +trailing, arguments of `define-package'. >>> +REQS and EXTRAS are the eponymous `package-desc' slots. >>> +Non-nil VERBOSE means display \"Wrote file\" message." >>> + (let* ((src (replace-regexp-in-string (rx "-pkg.el" eos) ".el" >>> + (file-name-nondirectory file) t t)) >>> + (def `(define-package ,name ,version ,doc >>> + ,(macroexp-quote >>> + ;; Turn requirement version lists into string form. >>> + (mapcar (lambda (elt) >>> + (list (car elt) >>> + (package-version-join (cadr elt)))) >>> + reqs)) >>> + ,@extra-props >>> + ,@(package--alist-to-plist-args extras))) >>> + (print-cfg '((length . nil) >>> + (level . nil) >>> + (quoted . t))) >>> + (str (concat ";;; Generated package description from " src >>> + " -*- no-byte-compile: t; lexical-binding: t -*-\n" >>> + (prin1-to-string def nil print-cfg) >>> + "\n"))) >>> + (write-region str nil file nil (unless verbose 'silent)))) >> >> I like this, but we should really make sure that there are no hidden >> edge-cases that might cause problems. > > How do we find them if they're hidden? ;) > Did you have something specific in mind? IIRC there were some bugs related to the generation of -pkg.el files, but I can't find them right now. I'll ping you if I find anything. > Thanks,