From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#67687: Feature request: automatic tags management Date: Sun, 31 Dec 2023 17:21:39 +0200 Message-ID: <8372abc4-c9d4-4eb4-8c74-460d11443aff@gutov.dev> References: <2f86b882-9ec1-f63f-d90b-5f8f7ae114f2@gutov.dev> <58D84A29-9A63-45BA-AD8B-B476CDC931A1@gmail.com> <812729c8-726f-d60e-2603-2d8e588929fd@gutov.dev> <835y0sgg12.fsf@gnu.org> <661f4951-cb0a-5257-63b0-efe71a0d217e@gutov.dev> <83y1de7jyr.fsf@gnu.org> <1a8c51fb-a114-42a4-ae40-8314d3f21104@gutov.dev> <83tto0400p.fsf@gnu.org> <6a684420-2098-4c9f-a17c-61150e9f3321@gutov.dev> <83plym3l60.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22466"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: 67687@debbugs.gnu.org, eskinjp@gmail.com, stefankangas@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 31 16:22:25 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 1rJxdv-0005dR-Jv for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 31 Dec 2023 16:22:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rJxdb-0007Kr-NX; Sun, 31 Dec 2023 10:22:03 -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 1rJxdZ-0007Jx-Gn for bug-gnu-emacs@gnu.org; Sun, 31 Dec 2023 10:22:01 -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 1rJxdZ-0006tm-7R for bug-gnu-emacs@gnu.org; Sun, 31 Dec 2023 10:22:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rJxda-0007Hd-5M for bug-gnu-emacs@gnu.org; Sun, 31 Dec 2023 10:22:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 31 Dec 2023 15:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67687 X-GNU-PR-Package: emacs Original-Received: via spool by 67687-submit@debbugs.gnu.org id=B67687.170403611127980 (code B ref 67687); Sun, 31 Dec 2023 15:22:02 +0000 Original-Received: (at 67687) by debbugs.gnu.org; 31 Dec 2023 15:21:51 +0000 Original-Received: from localhost ([127.0.0.1]:46777 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rJxdP-0007HD-5e for submit@debbugs.gnu.org; Sun, 31 Dec 2023 10:21:51 -0500 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]:51499) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rJxdN-0007H0-5J for 67687@debbugs.gnu.org; Sun, 31 Dec 2023 10:21:49 -0500 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id C61D05C0075; Sun, 31 Dec 2023 10:21:42 -0500 (EST) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 31 Dec 2023 10:21:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1704036102; x=1704122502; bh=Kq2k3m771+WR8AodAcDIj/prfevbtr14eu1AbYYC8z0=; b= EuK16hzHc85FDRgrCWOYf5HmZfnTeTlOc3V1ZYk8YNA7gSHIq7fCgd8ASILH8rrZ 8L9Me5lCvdkKB6vSEzQEj76Z2d99gmGlu8ierdKCFBQY8vXezRN7IsX7KSWw6+Ea cYqa3VPtyvIgPjE1NytrTNqUYI54jfzexI81YEMxwuE6/kGq8xFsKyj4E6VrPVax 617409ZaJeIzW8zo+FO/zz+ZBf2/46dXTATiKdS2ZYqmYDVoK52iUPbcpLXp7akh OSMvJpKfmcME95OgVvHycwEsV+qRNLZjQnbU6wuhKVMg+JJ3xZt4ZNutlr4pIoCf CVo7krlgeJQ+4DgCo3Jlow== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1704036102; x= 1704122502; bh=Kq2k3m771+WR8AodAcDIj/prfevbtr14eu1AbYYC8z0=; b=8 doq1D15Q/GydIcI+O8zak5iOx/RD7CIcxvubD7HAzlVFOTUylY9ZUzH5CYbFUrJb RiIRuIbMkEDE2a2w7EyCdx/mx+Kv6arnh30wtJ8cFd5pA2V2mBFIhj1Lz4aSqHGV V/X4kSaHTWjo1AerhhaBbj9feqm8uCsihhKnAN1/aDZQPzGzLFUnEsQd22LP8QwE IqTtA+QAaGCrC1UsN1Wv4u2DKE069oZ1GLqt7DyAj+drGWseoPU8bbDyRC2xgC+2 5bZzrmJjOS3QegKPsaoFXbajjinxEyI/Oa77PmnQPUbeqAwr9cpJiDve7chHaQQU +1xm3j+BeIpzm1UAwAarQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdefkedghedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepteduleejgeehtefgheegjeekueehvdevieekueeftddvtdevfefhvdevgedu jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 31 Dec 2023 10:21:41 -0500 (EST) Content-Language: en-US In-Reply-To: <83plym3l60.fsf@gnu.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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:277146 Archived-At: On 31/12/2023 09:07, Eli Zaretskii wrote: >> Date: Sun, 31 Dec 2023 01:43:25 +0200 >> Cc: 67687@debbugs.gnu.org, eskinjp@gmail.com, stefankangas@gmail.com >> From: Dmitry Gutov >> >>>>>> +;;;###autoload >>>>>> +(put 'etags-regen-file-extensions 'safe-local-variable >>>>>> + (lambda (value) (and (listp value) (seq-every-p #'stringp value)))) >>>>> >>>>> Why not use list-of-strings-p here? >>>> >>>> Again, that "core ELPA" consideration. We could deploy this feature to a >>>> number of released Emacs versions, if we don't introduce such dependencies. >>> >>> Isn't this covered by the compat package on ELPA? If not, I think it >>> should be. >> >> These forms go into generated autoloads file for each installed package >> (*-autoloads.el). I think compat doesn't make list-of-string-p >> autoloaded, and autoloads files don't usually have (require ...) forms. >> >> So while I haven't really tested this and could be missing something, it >> seems brittle to rely on 'compat' for this function (if at all possible). > > It is also extremely ugly to have those large functions in a bundled > package, when we already have list-of-strings-p in Emacs 29. So how > about defining list-of-strings-p in etags-regen for older versions, > and then using it in the safe-local-variable property? Even that wouldn't work, I think, for the same reason: the autoloads file doesn't load the related package eagerly. Though I suppose we could force one specific function definition into autoloads. > Or some other > solution to make this more elegant. Wanting to let users use this > with older Emacsen has its limits, and IMNSHO this one crosses that > limit. We already do this in project.el for one variable, too. If you like, we could simplify the forms further, though, dropping the string-match-p checks. Forms for etags-regen-file-extensions and etags-regen-ignores would look like the one for project-vc-extra-root-markers. The form for etags-regen-lang-regexp-alist is not a lists-of-string-p to begin with, so it will be more complex (it's "alist of lists of strings").