From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Basil L. Contovounesios" via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#67916: 30.0.50; No lexical-binding directive warning in -pkg.el files Date: Wed, 20 Dec 2023 19:08:37 +0100 Message-ID: <8734vwkaqi.fsf@epfl.ch> References: <87msu5q2vx.fsf@epfl.ch> <87y1dpon3v.fsf@epfl.ch> <87jzp8dhz8.fsf@posteo.net> Reply-To: "Basil L. Contovounesios" Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8232"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 67916@debbugs.gnu.org, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , Stefan Monnier To: Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 20 19:09:29 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 1rG10a-0001tC-Td for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 20 Dec 2023 19:09:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rG10K-00019Q-EO; Wed, 20 Dec 2023 13:09:13 -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 1rG10G-00019F-Sh for bug-gnu-emacs@gnu.org; Wed, 20 Dec 2023 13:09:09 -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 1rG106-0002ub-Sp for bug-gnu-emacs@gnu.org; Wed, 20 Dec 2023 13:09:08 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rG109-0005GR-Nf for bug-gnu-emacs@gnu.org; Wed, 20 Dec 2023 13:09:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Dec 2023 18:09:01 +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.170309573420221 (code B ref 67916); Wed, 20 Dec 2023 18:09:01 +0000 Original-Received: (at 67916) by debbugs.gnu.org; 20 Dec 2023 18:08:54 +0000 Original-Received: from localhost ([127.0.0.1]:41745 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rG101-0005G5-BX for submit@debbugs.gnu.org; Wed, 20 Dec 2023 13:08:53 -0500 Original-Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:57453) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rG0zw-0005Fm-L8 for 67916@debbugs.gnu.org; Wed, 20 Dec 2023 13:08:52 -0500 Original-Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-40d38f03712so6003645e9.2 for <67916@debbugs.gnu.org>; Wed, 20 Dec 2023 10:08:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd.ie; s=google21; t=1703095719; x=1703700519; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=FkivYvWxW4ASXWpcLF76eFAJr/cXOhsjNGwVJFutY+A=; b=ChBDJ8JGoALji1uosGZQE2hZFvQZqKw0R7SVxZcuhH0TQ3JFFoQvurrmzcpW/M1cqY S1q2PmNV5Oq9S9P6rhH/HjhwGEHNkwSpPv2NrPg+bWfaxjYwC6dSlm7VKp/aIUYNrqLq lG+IZkjWvZiVM3l2O+rjqNEPx3dCJHF4i1ETBfadDg8XZW5DAoCxkaXyBmRhtfaQRLXd l9Zk4w57FG7JPID1ZJTLYIyh3iuTFvK+Qoab0wMKMLQgsdcJEzx5SGBcZdM7BIkhLrLi Wmq8z/2HQec+Am/RDAL++q1vS8mvViuXsrBajhoMkrzrXjYy35Bc0arfXaMl4iY3AW6A 19hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703095719; x=1703700519; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=FkivYvWxW4ASXWpcLF76eFAJr/cXOhsjNGwVJFutY+A=; b=l9Qxs6CXTLEpAF7UX5OrYRqbKE7N77AHu2Sjv9UpX6lt2t9JcJ6/uPlVSoWQ6H4a4H ZTa2yUA+dnDwKfE6sWJrycIY1v0vHyj0Zu3iIpFKzvy1TAew8n7b0z3CzVgjGb7XwuGL Yg+ENXG5+QNT3+IkOKzpkGqiyRX7MC4zLLAi2oN15/7herXW53v6lSbOUjOCHXwkfJl8 PhrP+pxADcD5dRqfX5lF6GDdtUfjV3HuiHUug6UQ6SJChZRTE0tR64rL6volovRHE2oX Gqdxy925vYw4r4hSM5m5lD2AhAN8HeuXuzUjHEV8fMjLF8KHCyxW1D8sdxin7vKBj/3f 9UeQ== X-Gm-Message-State: AOJu0Yx+wjrSXka5rMswcQoqdMHhGN0vJnArqUZWQMPpLalE9aLXCmyS Iot2zQDO58+2/Qw/DKefxvK45A== X-Google-Smtp-Source: AGHT+IFiqJPMRgBLseSbsFndVTP8o86UsEyU7LmjXvIPLQU7LBHKr4oM4KMTincWJIs0Ir8Iv6Y6gg== X-Received: by 2002:a05:600c:520b:b0:40d:3880:9a82 with SMTP id fb11-20020a05600c520b00b0040d38809a82mr45817wmb.181.1703095719040; Wed, 20 Dec 2023 10:08:39 -0800 (PST) Original-Received: from localhost ([2001:620:618:5c0:2:80b3:0:91e]) by smtp.gmail.com with ESMTPSA id v8-20020a05600c444800b0040c2c5f5844sm408134wmn.21.2023.12.20.10.08.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 10:08:38 -0800 (PST) In-Reply-To: <87jzp8dhz8.fsf@posteo.net> (Philip Kaludercic's message of "Wed, 20 Dec 2023 15:14:03 +0000") 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:276580 Archived-At: 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? ;) >> 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). >> (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. >> (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? [ To be honest, I'm slightly inclined to add this to macroexp.el instead, since it's a somewhat common operation. ] > 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). >> +;; 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? Thanks, -- Basil