GNU bug report logs - #76322
Make ctags a thin wrapper around etags

Previous Next

Package: emacs;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Sun, 16 Feb 2025 05:22:02 UTC

Severity: wishlist

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: rms <at> gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Cc: 76322 <at> debbugs.gnu.org
Subject: bug#76322: Make ctags a thin wrapper around etags
Date: Sun, 9 Mar 2025 23:33:03 -0700
On 2025-03-09 21:18, Richard Stallman wrote:
> The idea was that a user could give the program any name,
> and it would still behave the same.

Yes, the idea is that a user can copy /usr/bin/ctags to (for example) 
/usr/bin/ceetags or /home/eggert/bin/sitags and the command will still 
work under its new name.

If ctags invokes etags by replacing $0's basename with "etags", copying 
/usr/bin/ctags to /usr/bin/ceetags just works, whereas copying 
/usr/bin/ctags to /home/eggert/bin/sitags will require that the user 
also copy or link /usr/bin/etags to /home/eggert/bin/etags. I assume 
this requirement is OK (as I understand it, Eli says it's OK).


> Back then, there was a reason to have ctags and etags, making their
> different formats.  etags output had rough source locations which sped
> up finding a definition in the source.
> 
> Nowadays that speedup may be insignificant in practice.
> 
> Is it still beneficial?

Dropping support for ctags output would address the problem by removing 
the need for two programs. And since there is a GPL'ed ctags[1] that is 
better than what's shipped with Emacs, one option is for Emacs to stop 
installing ctags, and to advise users who want a ctags program to use 
the other ctags instead. That's the default on many distros nowadays anyway.

More radically, Emacs could also stop installing etags, and advise 
people to run ctags -e instead, where this is the other ctags.

As a practical matter, ctags and etags both have problems with languages 
like C++ and Python where the same name can mean many different things 
depending on context. My impression is that nowadays many (most?) people 
who want tags-like capabilities use Language Server Protocol[2] clients 
like lsp-mode[3] instead, as LSP can handle these more-complicated 
naming conventions. Ctags and etags are mostly needed for old-fashioned 
users.

[1]: https://github.com/universal-ctags/ctags
[2]: https://en.wikipedia.org/wiki/Language_Server_Protocol
[3]: https://emacs-lsp.github.io/lsp-mode/





This bug report was last modified 58 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.