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 01:23:52 +0200 Message-ID: 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> <979cf9e0-4d08-4c39-b5c8-11b0bb8801b4@gutov.dev> 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="19813"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: 67687@debbugs.gnu.org, eskinjp@gmail.com, Michael Albinus To: Stefan Kangas , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 31 00:25:26 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 1rJihq-0004sn-2U for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 31 Dec 2023 00:25:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rJihT-0005cg-R1; Sat, 30 Dec 2023 18:25: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 1rJihR-0005cF-PJ for bug-gnu-emacs@gnu.org; Sat, 30 Dec 2023 18:25: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 1rJihR-0000eD-Fw for bug-gnu-emacs@gnu.org; Sat, 30 Dec 2023 18:25:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rJihS-0007cl-0v for bug-gnu-emacs@gnu.org; Sat, 30 Dec 2023 18:25: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: Sat, 30 Dec 2023 23:25:01 +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.170397864529240 (code B ref 67687); Sat, 30 Dec 2023 23:25:01 +0000 Original-Received: (at 67687) by debbugs.gnu.org; 30 Dec 2023 23:24:05 +0000 Original-Received: from localhost ([127.0.0.1]:45238 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rJigX-0007bX-Ax for submit@debbugs.gnu.org; Sat, 30 Dec 2023 18:24:05 -0500 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]:41121) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rJigT-0007b2-Oz for 67687@debbugs.gnu.org; Sat, 30 Dec 2023 18:24:03 -0500 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id B4EEB5C01C5; Sat, 30 Dec 2023 18:23:55 -0500 (EST) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sat, 30 Dec 2023 18:23:55 -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=1703978635; x=1704065035; bh=WPHS+nX2xSPJDhgz7bsuvECaeiu4T9Q/B8xQl4R9J8Y=; b= gsBUpSyUKExHp0TY21cQso3+YywUFniPIaIXgQNGK2XSRbLtt394aMes7JHlBaXj b1GwE2OPLW5THDvWgPkNb9ErEhWkXyl1+lWwc35he95eCKogf1APHXHEwBvDvfX2 +vhFx80DPQ+BR/odwIbwjVMh3XU6bX+KFAeGM0QG0TfNIxe4WtIwdSTRjogVloHS Eo6+FqPAsfLwn4Io9z8v8KR+DX4DkLZxLpGoMF07TRwsfLjNcbvVUO9kM3+ezyLF hjO8Vs1RBVLZ1m4E5++WIVrn7XFdbJXWekL+VbykWzZBmHBSUfGHM85bL7uwi7Qf bziPgVOcALjeihT1QWZSyA== 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=1703978635; x= 1704065035; bh=WPHS+nX2xSPJDhgz7bsuvECaeiu4T9Q/B8xQl4R9J8Y=; b=D Yci+TwJyO71YFnm3DeLJvtwEcfO8B6HNjcdmvJdxtcUJV3/Gq+krUk1U0VM4kumz rfnSYHSTz28MUBBkKfP4ADiD5+cSTawgmZl+51lTiYSlJCRgScD6FhjjQwBySuFQ 6XZbWhFHpwrGGiQfcyw+85tEVX7H85NXSh/WHDoMN8QHIcd60KQidxcyVRD4f4Of HpkswjTy/Zj6r3goup05/SrUclvcUARnaB2tGq+YyhcLCHN0oDXo9PjM5jzwGqpw JTkgMFE8bJSPbvCsnQKnueKrCTCJ2+Oh8Hez0v4r8a/cpF4QEJNS8gqCILR7hark Fus2c1q+pPHd//U62XFKw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdefiedgudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepteduleejgeehtefgheegjeekueehvdevieekueeftddvtdevfefhvdevgedu jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 30 Dec 2023 18:23:53 -0500 (EST) Content-Language: en-US In-Reply-To: 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:277111 Archived-At: On 30/12/2023 22:56, Stefan Kangas wrote: > Dmitry Gutov writes: > >> On 30/12/2023 00:17, Stefan Kangas wrote: >>> Dmitry Gutov writes: >>> >>>>> . there are no updates for NEWS and the Emacs manual >>>> I'll certainly add something to NEWS. Not sure where and what should be >>>> in the manual. >>> How about a new node describing this feature under `(emacs) Tags >>> Tables`? >> Good suggestion, but that still leaves the problem of organizing the text. >> >> Do you want, perchance, to give it a try yourself? >> >> Optimally, it might need a significant rewrite: we wouldn't point the >> user to 'etags' right away, or the "Create Tags Table" section. >> >> The average user taking advantage of etags-regen-mode might not even >> need to know what a "tags table" is (or only know that in very broad >> strokes), so depending on our eventual approach we might drop that node, >> or rearrange the nodes in a particular order, prefacing that one >> ("Create Tags Table") as the approach for advanced users. > Indeed, all good points. In an ideal world, "tags tables" would be an > implementation detail, perhaps only of interest to users with highly > specific and customized workflows. > > I won't have time to work on a proper patch right now, but perhaps > something along these lines (warning: a*very* rough draft): > > diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi > index 0725d889747..f3d09b48f12 100644 > --- a/doc/emacs/maintaining.texi > +++ b/doc/emacs/maintaining.texi > @@ -2666,6 +2666,9 @@ Tags Tables > by using one of the commands from other packages that can produce such > tables in the same format.) > > + Instead of creating a tags table manually, you might want to have it > +created automatically for you. @xref{Update Tags Table}. > + > Emacs uses the tags tables via the @code{etags} package as one of > the supported backends for @code{xref}. Because tags tables are > produced by the @command{etags} command that is part of an Emacs > @@ -2683,7 +2686,8 @@ Tags Tables > > @menu > * Tag Syntax:: Tag syntax for various types of code and text files. > -* Create Tags Table:: Creating a tags table with @command{etags}. > +* Update Tags Table:: Creating a tags table automatically. > +* Create Tags Table:: Creating a tags table manually with @command{etags}. > * Etags Regexps:: Create arbitrary tags using regular expressions. > @end menu > > @@ -2877,8 +2881,21 @@ Tag Syntax > You can also generate tags based on regexp matching (@pxref{Etags > Regexps}) to handle other formats and languages. > > +@node Update Tags Table > +@subsubsection Keeping Tags Tables up to date > + > + The easiest way to manage tags tables is by enabling > +@code{etags-regen-mode} (@kbd{M-x etags-regen-mode RET}). This minor > +mode generates the tags table automatically based on the current > +project configuration, and later updates it as you edit the files and > +save the changes. > + > +Note that this feature disables itself if you have already manually > +visited a tags table (with @kbd{M-x visit-tags-table}, or through an > +explicit prompt triggered by some feature that requires tags). > + > @node Create Tags Table > -@subsubsection Creating Tags Tables > +@subsubsection Creating Tags Tables Manually > @cindex @command{etags} program > > The @command{etags} program is used to create a tags table file. It knows Thanks! This is already an improvement. Regarding node names: if we call the new node "Update Tags Table", the users might want to visit it after "Create Tags Table" (to maybe see how to keep a tags table updated after creating it manually), and then read that this is not supported, as you note in the second paragraph. We might implement something like that later, but it would have to be off by default, I think. What if we call them "Automatic Tags Table" and "Manual Tags Table"? Or "Creating Tags Table Automatically" and "Creating Tags Table Manually"?