unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#23400: Emacs 25.0.92.1: etags fails to handle file format generated by Exuberant Ctags 5.8 in etags emulation mode
@ 2016-04-29 14:42 Robert Weiner
  2016-04-29 16:28 ` Andreas Schwab
  2020-08-19 13:30 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 6+ messages in thread
From: Robert Weiner @ 2016-04-29 14:42 UTC (permalink / raw)
  To: 23400


[-- Attachment #1.1: Type: text/plain, Size: 1167 bytes --]

Exuberant Ctags allows one to generate what is said to be an etags
compatible TAGS file.
However, a call to list-tags fails on such a file because it includes 2
lines of file names per file rather than one.

Attached is a sample TAGS file that triggers the error with this call:
(list-tags "hmouse-key.el")
and an associated patch that fixes it.

diff -u --label
/Applications/Emacs25.app/Contents/Resources/lisp/progmodes/etags.el.gz\~
--label
/Applications/Emacs25.app/Contents/Resources/lisp/progmodes/etags.el.gz
/var/folders/8s/b7pm6fms2nsc1x2651dpvrd00000gn/T/jka-com77357KwE
/var/folders/8s/b7pm6fms2nsc1x2651dpvrd00000gn/T/jka-com77357kER
--- /Applications/Emacs25.app/Contents/Resources/lisp/progmodes/etags.el.gz~
+++ /Applications/Emacs25.app/Contents/Resources/lisp/progmodes/etags.el.gz
@@ -1398,6 +1398,8 @@
   (goto-func goto-tag-location-function)
   tag tag-info pt)
     (forward-line 1)
+    (if (looking-at "\177")
+ (forward-line 1))
     (while (not (or (eobp) (looking-at "\f")))
       ;; We used to use explicit tags when available, but the current
goto-func
       ;; can only handle implicit tags.

Diff finished.  Fri Apr 29 10:23:18 2016

[-- Attachment #1.2: Type: text/html, Size: 1623 bytes --]

[-- Attachment #2: TAGS --]
[-- Type: application/octet-stream, Size: 187 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#23400: Emacs 25.0.92.1: etags fails to handle file format generated by Exuberant Ctags 5.8 in etags emulation mode
  2016-04-29 14:42 bug#23400: Emacs 25.0.92.1: etags fails to handle file format generated by Exuberant Ctags 5.8 in etags emulation mode Robert Weiner
@ 2016-04-29 16:28 ` Andreas Schwab
  2016-04-29 20:26   ` Dmitry Gutov
  2020-08-19 13:30 ` Lars Ingebrigtsen
  1 sibling, 1 reply; 6+ messages in thread
From: Andreas Schwab @ 2016-04-29 16:28 UTC (permalink / raw)
  To: Robert Weiner; +Cc: 23400

Robert Weiner <rswgnu@gmail.com> writes:

> Exuberant Ctags allows one to generate what is said to be an etags
> compatible TAGS file.
> However, a call to list-tags fails on such a file because it includes 2
> lines of file names per file rather than one.

Why is this not a bug in Exuberant Ctags?

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#23400: Emacs 25.0.92.1: etags fails to handle file format generated by Exuberant Ctags 5.8 in etags emulation mode
  2016-04-29 16:28 ` Andreas Schwab
@ 2016-04-29 20:26   ` Dmitry Gutov
  2016-05-01 15:47     ` Robert Weiner
  0 siblings, 1 reply; 6+ messages in thread
From: Dmitry Gutov @ 2016-04-29 20:26 UTC (permalink / raw)
  To: Andreas Schwab, Robert Weiner; +Cc: 23400

On 04/29/2016 07:28 PM, Andreas Schwab wrote:

>> However, a call to list-tags fails on such a file because it includes 2
>> lines of file names per file rather than one.
>
> Why is this not a bug in Exuberant Ctags?

Indeed. And Ctags 5.8 is very old.

'ctags --version' reports 'Exuberant Ctags 5.9~svn20110310' on my 
machine, and I've never seen the described problem with it.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#23400: Emacs 25.0.92.1: etags fails to handle file format generated by Exuberant Ctags 5.8 in etags emulation mode
  2016-04-29 20:26   ` Dmitry Gutov
@ 2016-05-01 15:47     ` Robert Weiner
  2016-05-01 20:23       ` Dmitry Gutov
  0 siblings, 1 reply; 6+ messages in thread
From: Robert Weiner @ 2016-05-01 15:47 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: Andreas Schwab, 23400

[-- Attachment #1: Type: text/plain, Size: 1461 bytes --]

On Fri, Apr 29, 2016 at 4:26 PM, Dmitry Gutov <dgutov@yandex.ru> wrote:

> On 04/29/2016 07:28 PM, Andreas Schwab wrote:
>
> However, a call to list-tags fails on such a file because it includes 2
>>> lines of file names per file rather than one.
>>>
>>
>> Why is this not a bug in Exuberant Ctags?
>>
>
> Indeed. And Ctags 5.8 is very old.
>

The main Exhuberant CTags site is: http://ctags.sourceforge.net/ which
shows a last released version of 5.8.  The popular `brew' package manager
for OS X installs version 5.8 as the latest.
There are various forks of this code since it doesn't seem to be active
anymore, but these are much harder for users to find and so many may choose
V5.8 which has the issue I mentioned and patched.
There is universal-ctags (version 0, based on V5.8) which fixes the problem
I listed and has a separate web page: http://ctags.io.  There is also a
V5.9 fork that is included in some Linux distributions that can be found
here: https://github.com/rgo/exuberant-ctags, but looks far from official.
Dmitry mentioned that this also fixes the issue.

So the issue is/was with a version of Exhuberant Ctags that is still the
latest official release and the most popular Google search result.  Most
users who install this software themselves would most likely only find this
version.
The patch to fix the problem is simple but whether you want to apply it
given all of this is left for you far more knowledgeable maintainers to
decide.

[-- Attachment #2: Type: text/html, Size: 2433 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#23400: Emacs 25.0.92.1: etags fails to handle file format generated by Exuberant Ctags 5.8 in etags emulation mode
  2016-05-01 15:47     ` Robert Weiner
@ 2016-05-01 20:23       ` Dmitry Gutov
  0 siblings, 0 replies; 6+ messages in thread
From: Dmitry Gutov @ 2016-05-01 20:23 UTC (permalink / raw)
  To: Robert Weiner; +Cc: Andreas Schwab, 23400

On 05/01/2016 06:47 PM, Robert Weiner wrote:

> The main Exhuberant CTags site is: http://ctags.sourceforge.net/ which
> shows a last released version of 5.8.

That doesn't mean it's the last version of the code produced by that 
project: https://sourceforge.net/p/ctags/code/816/log/?path=/trunk lists 
newer commits that continue up to the year 2014.

It was my assumption that Ubuntu's version either used one of the later 
snapshots (like "~svn" in the version indicates), or included only 
minimal changes made by Ubuntu's maintainers.

> The popular `brew' package
> manager for OS X installs version 5.8 as the latest.

Have you tried discussing that the Brew maintainers?

> There is universal-ctags (version 0, based on V5.8) which fixes the
> problem I listed and has a separate web page: http://ctags.io.

Indeed, this project seems to be THE way forward for ctags.

Any reason to believe that it isn't based on any of the subsequent 
version of code posted to the original project's SVN?

> The patch to fix the problem is simple but whether you want to apply it
> given all of this is left for you far more knowledgeable maintainers to
> decide.

I'm inclined toward "no", because:

- The problem seems limited to `M-x list-tags', which is not really 
essential functionality.
- ctags 5.8 clearly violates the established format.
- The only generator of TAGS files that we officially support is our 
'etags' program.
- Adding a workaround for an old version of ctags in counterproductive 
in other ways: the sooner the user notices problems with the ctags they 
installed, the sooner they might go looking for a newer version. Which 
contains other improvements and bugfixes as well.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#23400: Emacs 25.0.92.1: etags fails to handle file format generated by Exuberant Ctags 5.8 in etags emulation mode
  2016-04-29 14:42 bug#23400: Emacs 25.0.92.1: etags fails to handle file format generated by Exuberant Ctags 5.8 in etags emulation mode Robert Weiner
  2016-04-29 16:28 ` Andreas Schwab
@ 2020-08-19 13:30 ` Lars Ingebrigtsen
  1 sibling, 0 replies; 6+ messages in thread
From: Lars Ingebrigtsen @ 2020-08-19 13:30 UTC (permalink / raw)
  To: Robert Weiner; +Cc: 23400

Robert Weiner <rswgnu@gmail.com> writes:

> Exuberant Ctags allows one to generate what is said to be an etags
> compatible TAGS file.  However, a call to list-tags fails on such a
> file because it includes 2 lines of file names per file rather than
> one.

Apparently brew still includes the 5.8 version of this ctags program, so
it fixes a real problem.  Dmitry objected to the patch because
supporting this ctags project holds back progress for humanity, which is
true, but since it fixes a problem seen in the wild, I applied it
anyway.

If anybody objects, feel free to revert.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-08-19 13:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-29 14:42 bug#23400: Emacs 25.0.92.1: etags fails to handle file format generated by Exuberant Ctags 5.8 in etags emulation mode Robert Weiner
2016-04-29 16:28 ` Andreas Schwab
2016-04-29 20:26   ` Dmitry Gutov
2016-05-01 15:47     ` Robert Weiner
2016-05-01 20:23       ` Dmitry Gutov
2020-08-19 13:30 ` Lars Ingebrigtsen

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).