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.devel Subject: Re: Setup process for etags-regen-mode (Emacs 30.0.91 feedback) Date: Mon, 23 Sep 2024 20:17:53 +0300 Message-ID: References: <878qvm42ha.fsf@ice9.digital> 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="29422"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: Morgan Willcock , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Sep 23 19:18:47 2024 Return-path: Envelope-to: ged-emacs-devel@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 1ssmhy-0007LB-2C for ged-emacs-devel@m.gmane-mx.org; Mon, 23 Sep 2024 19:18:46 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssmhF-0006zD-Sh; Mon, 23 Sep 2024 13:18:02 -0400 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 1ssmhF-0006z4-9K for emacs-devel@gnu.org; Mon, 23 Sep 2024 13:18:01 -0400 Original-Received: from fhigh-a6-smtp.messagingengine.com ([103.168.172.157]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ssmhD-0006VX-Cr for emacs-devel@gnu.org; Mon, 23 Sep 2024 13:18:01 -0400 Original-Received: from phl-compute-02.internal (phl-compute-02.phl.internal [10.202.2.42]) by mailfhigh.phl.internal (Postfix) with ESMTP id 585FC1140189; Mon, 23 Sep 2024 13:17:57 -0400 (EDT) Original-Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Mon, 23 Sep 2024 13:17:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=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=fm3; t=1727111877; x=1727198277; bh=KaNfB1oueroIdioPYlfRr+LXKO/UP8XHawulbWxf33A=; b= P+Z03JYNAufB3GwfKsWz2p8yv7W/lPPuOUiphNgOHxwWsQhbzoPj5DlXcYYcd/y+ mZPxMBiawqNIFmcVgd0wQ+3UgjAt9ETanvnfGUIIuWpC5SEBkBX4CWywXf1iazxC RIZIZnE1MtVk6u3/PHX9c1JgpchrtHNNzo+JqbTnTSeHJSBD5JptAFWFFifI8R2m uwIZEVkgCieqkoZsjwh8J84nnmhsnUWh1Fp+jBudSQ9X2eJG4nq+LuuyCL8eok8v SmLFTv3+J/xvjdEtJAEq+JQQqZ+aCu18xVfN5xTQeQtwfwZVCdUQFqa0mSVKnt8z o2u4mmA68PmOGIRjWgSbkQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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=1727111877; x= 1727198277; bh=KaNfB1oueroIdioPYlfRr+LXKO/UP8XHawulbWxf33A=; b=K KSEBmM5yGF0vHQX8sc4fDPg2vj5cy0Jx3pNVAOKuFVbGHA7WSfSijRRPJUZW//H8 is5NzJzI40dFM4WQ1/bo6UWU4fFBFBlU0j7kNJ4wFWeSDzqdgQLgPxXNkmODfUyb PcYaNPup7cOJ9Ol9sPAtjh0R9+gsjRYIuyfZPSemR3VR2n+r5lv9x4dgNokD9pNc JIeRsvidOQRG0W7awWRm5aXlQlFN3dgfqkoLQloamXs113zTJ0jSwY7qtR660E5D IjNFdqjSHOzUqTfzkn91hnMEah2e8e9L58wQyd1V0MNSU9NwD0hbDESRWrZbslmC SZ1usf9Es5CHAXVejYR3Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudelledgudduvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtjeertddtvdej necuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdrug gvvheqnecuggftrfgrthhtvghrnheptdfhuedvtdevleegueelvedvjeevheffveevhedv uefftdefhfdvueeggfetgfdtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghvpdhnsggprhgtphhtthho pedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehmohhrghgrnhesihgtvgelrd guihhgihhtrghlpdhrtghpthhtohepvghmrggtshdquggvvhgvlhesghhnuhdrohhrgh X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 23 Sep 2024 13:17:55 -0400 (EDT) Content-Language: en-US In-Reply-To: <878qvm42ha.fsf@ice9.digital> Received-SPF: pass client-ip=103.168.172.157; envelope-from=dmitry@gutov.dev; helo=fhigh-a6-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:323982 Archived-At: Hi! On 20/09/2024 21:14, Morgan Willcock wrote: > When testing etags-regen-mode in the Emacs 30 pre-release I've found it > to be working well for my use-case, but one thing which appears to be > missing is an easy way for additional completion functions to opt-in to > the etags-regen-mode setup process. > > Currently the completion functions which get advice added to them (to > call etags-regen--maybe-generate) are hard coded in the mode definition: > > (if etags-regen-mode > (progn > (advice-add 'etags--xref-backend :before > #'etags-regen--maybe-generate ) > (advice-add 'tags-completion-at-point-function :before > #'etags-regen--maybe-generate)) > (advice-remove 'etags--xref-backend #'etags-regen--maybe-generate) > (advice-remove 'tags-completion-at-point-function #'etags-regen--maybe-generate) > (etags-regen--tags-cleanup)) > > I was looking for a stable entry point to opt-in to using it, rather > than having to do something like this: > > (advice-add 'my-completion-function-which-does-things-with-tags :before > #'etags-regen--maybe-generate) > > (Where the "--" in the function name is a sign that I probably shouldn't > be doing that.) > > I wasn't sure whether it was intentional to hard-code the functions to > advise while etags-regen-mode was still so new, or whether opting in > other functions hadn't been considered. Hadn't been considered yet, but I'm open to the idea. Two basic approaches is either through a new custom variable, or by making the function "public". The latter is a bit tricky because then we'd need to document what it does - and it basically launches all the work ((re)scanning the table, adding the hooks), and that setup might change over time. > Would it be possible to store the completion functions which will be > advised as a separate list, so that other packages can add completion > functions to that list and get the TAGS generation to trigger? Or is > this an intentional boundary? The custom variable approach seems better, but we'll need to test how it interacts with being able to switch etags-regen-mode on by default.