From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#67687: Feature request: automatic tags management Date: Sat, 30 Dec 2023 12:56:38 -0800 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" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12680"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 67687@debbugs.gnu.org, eskinjp@gmail.com, Michael Albinus To: Dmitry Gutov , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 30 21:57:22 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 1rJgOX-00032Y-Ah for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 Dec 2023 21:57:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rJgOE-0004f6-GC; Sat, 30 Dec 2023 15:57:02 -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 1rJgOD-0004ey-KT for bug-gnu-emacs@gnu.org; Sat, 30 Dec 2023 15:57: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 1rJgOD-0000TL-Bl for bug-gnu-emacs@gnu.org; Sat, 30 Dec 2023 15:57:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rJgOE-00036G-2G for bug-gnu-emacs@gnu.org; Sat, 30 Dec 2023 15:57:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Dec 2023 20:57: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.170396981111896 (code B ref 67687); Sat, 30 Dec 2023 20:57:02 +0000 Original-Received: (at 67687) by debbugs.gnu.org; 30 Dec 2023 20:56:51 +0000 Original-Received: from localhost ([127.0.0.1]:45142 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rJgO2-00035n-Kp for submit@debbugs.gnu.org; Sat, 30 Dec 2023 15:56:51 -0500 Original-Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]:55668) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rJgNx-00035V-Bn for 67687@debbugs.gnu.org; Sat, 30 Dec 2023 15:56:49 -0500 Original-Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-555f581aed9so671498a12.3 for <67687@debbugs.gnu.org>; Sat, 30 Dec 2023 12:56:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703969799; x=1704574599; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=JryjSP3Hr94GnkzwWUpjn44NKN05Ykrz9pi7F0RYD1Q=; b=fZxDDXDtvQpuHBVLs557eoLwXJwmqhFs0i1HuRiLlLsJwWIjoChm63jLjV2d7tbkR/ sVJ/iPjAa9nvi3njqRaL2TymHXwkV9GiOjEnGe3J7DO15BFBucVEeJ+jbnnnFuY99BN6 IajUOVSl4dXb3t+CfHVyriCFXOO7WNyg4FojymbW59bjy4SlmfxvNOHVrZ42updp4oyV 1wEznGbE3Ms9gabp8Ym9s0A6giJZgMnUN+KELJ6nFuGG7JqlOJN7ZAUJx52DnlhGfHl1 SxLgTItGmOBk1h9Ka6hhnivOYK9kPVQ5hVAnmr5ENcQBfrh87/wayWNgenzmKbxnG6dJ Lm0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703969799; x=1704574599; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JryjSP3Hr94GnkzwWUpjn44NKN05Ykrz9pi7F0RYD1Q=; b=MiLBfskQ2cq/itCU9IzPGbUdGKkGd+eQWDXChO9Dx2m1JDVQU888S98yK2D6IiKs3E s55n0Zqe2Wk82VEAXV2oQsfdwcm1z59C+L2gb/WlXCEiKbRmts/kLAeuthlTCk9/NwA4 vllyt6jaDpz/CrpmUhGeWHbaMY+0QOzP9e+Caz8lAtVTgMSsa0l37ISNuxWFO69phKyz f4fzK6wd9AU9JyYiqWxdzGANp0ZeR0l88LYtPlW/Y/vlr8a1aNqkhkdj8MHAtAKPm42G TIkz+Vf2x+RvdVGvYQPdOjQGOT8r9UcwHhbVkN820/eGoC0t5zJjH9SYa0nkHUcYyqsC WoNQ== X-Gm-Message-State: AOJu0Yyr5WjiVgZgvJrc+QcJpUBPhAaX1XkvzyxxH8w2YM7NHuLDxNUK 8U/RQsi31SBvM/hyn1gG4rxL4MQAvCSDDAte8lw= X-Google-Smtp-Source: AGHT+IEg7PvFhBE88akhVpMpachpbutORDb+buP6tAPpSbjyYc6VJxGzBSr/1YY+WI3sBZbuneYiJLvfuAPYN4ccAQ0= X-Received: by 2002:a50:8714:0:b0:553:4a57:a5a8 with SMTP id i20-20020a508714000000b005534a57a5a8mr9320577edb.16.1703969798776; Sat, 30 Dec 2023 12:56:38 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sat, 30 Dec 2023 12:56:38 -0800 In-Reply-To: <979cf9e0-4d08-4c39-b5c8-11b0bb8801b4@gutov.dev> 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:277102 Archived-At: 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 >>> Which brings a problem: the mode is now likely unusable over Tramp in >>> any project of significant size. Something to improve later. >> >> Should this be documented somewhere? > > Maybe, maybe not. The previous solution using xargs and stat (as still > implemented on the branch -- now outdated) should work for most remote > hosts (unixy ones). So it's likely a matter of having a user interested > in this and giving them a short enough patch to try. Right. I basically never use Tramp, so I'm leaving this to others. Copying in Michael in case he has any comments.