unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefankangas@gmail.com>
To: Dmitry Gutov <dmitry@gutov.dev>, Eli Zaretskii <eliz@gnu.org>
Cc: 67687@debbugs.gnu.org, eskinjp@gmail.com,
	Michael Albinus <michael.albinus@gmx.de>
Subject: bug#67687: Feature request: automatic tags management
Date: Sat, 30 Dec 2023 12:56:38 -0800	[thread overview]
Message-ID: <CADwFkmke2VZZNOCREYiZ8x7Vp6pHDhMYh+yAucOOhWiTBFAOzw@mail.gmail.com> (raw)
In-Reply-To: <979cf9e0-4d08-4c39-b5c8-11b0bb8801b4@gutov.dev>

Dmitry Gutov <dmitry@gutov.dev> writes:

> On 30/12/2023 00:17, Stefan Kangas wrote:
>> Dmitry Gutov <dmitry@gutov.dev> 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.





  reply	other threads:[~2023-12-30 20:56 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-07 11:43 bug#67687: Feature request: automatic tags management Jon Eskin
2023-12-07 15:57 ` Dmitry Gutov
2023-12-07 19:57   ` Jon Eskin
2023-12-10  2:41     ` Dmitry Gutov
2023-12-10 11:38       ` Jon Eskin
2023-12-20 21:11         ` Jon Eskin
2023-12-21  0:24           ` Dmitry Gutov
2023-12-21  7:40             ` Eli Zaretskii
2023-12-21 16:46               ` Dmitry Gutov
2023-12-21 23:37                 ` Dmitry Gutov
2023-12-24  1:43                   ` Dmitry Gutov
2023-12-28  9:30                     ` Eli Zaretskii
2023-12-30  3:05                       ` Dmitry Gutov
2023-12-30  7:33                         ` Eli Zaretskii
2023-12-30 23:43                           ` Dmitry Gutov
2023-12-31  1:02                             ` Stefan Kangas
2023-12-31 23:29                               ` Dmitry Gutov
2024-01-02  0:40                                 ` Stefan Kangas
2024-01-02  1:31                                   ` Dmitry Gutov
2023-12-31  7:07                             ` Eli Zaretskii
2023-12-31 15:21                               ` Dmitry Gutov
2023-12-29 22:29                     ` Stefan Kangas
2023-12-30  1:50                       ` Dmitry Gutov
2023-12-30 20:31                         ` Stefan Kangas
2023-12-30 22:50                           ` Dmitry Gutov
2023-12-30 23:25                             ` Stefan Kangas
2023-12-30 23:58                               ` Dmitry Gutov
2023-12-31  7:23                                 ` Eli Zaretskii
2023-12-31 15:31                                   ` Dmitry Gutov
2023-12-29 22:17                 ` Stefan Kangas
2023-12-30  1:31                   ` Dmitry Gutov
2023-12-30 20:56                     ` Stefan Kangas [this message]
2023-12-30 23:23                       ` Dmitry Gutov
2023-12-31  0:03                         ` Stefan Kangas
2023-12-31  6:34                       ` Eli Zaretskii
2023-12-31  7:22                         ` Stefan Kangas
2023-12-31 15:22                           ` Dmitry Gutov
2023-12-31 15:25                         ` Dmitry Gutov
2023-12-31 16:42                           ` Eli Zaretskii
2023-12-31 17:53                             ` Dmitry Gutov
2023-12-31 19:27                               ` Eli Zaretskii
2024-01-01  1:23                                 ` Dmitry Gutov
2024-01-01 12:07                                   ` Eli Zaretskii
2024-01-01 15:47                                     ` Dmitry Gutov
2024-01-01 16:50                                       ` Eli Zaretskii
2024-01-01 17:23                                         ` Dmitry Gutov
2024-01-01 17:39                                           ` Eli Zaretskii
2024-01-01 18:48                                             ` Dmitry Gutov
2024-01-01 19:25                                               ` Eli Zaretskii
2024-01-02  1:40                                                 ` Dmitry Gutov
2024-01-04  1:56                                                   ` Dmitry Gutov
2024-01-02 10:41                               ` Francesco Potortì
2024-01-02 13:09                                 ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADwFkmke2VZZNOCREYiZ8x7Vp6pHDhMYh+yAucOOhWiTBFAOzw@mail.gmail.com \
    --to=stefankangas@gmail.com \
    --cc=67687@debbugs.gnu.org \
    --cc=dmitry@gutov.dev \
    --cc=eliz@gnu.org \
    --cc=eskinjp@gmail.com \
    --cc=michael.albinus@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).