Subject: bug#23400: Emacs 25.0.92.1: etags fails to handle file format generated by Exuberant Ctags 5.8 in etags emulation mode

From: Robert Weiner <[email-masked]>
Date: Fri, 29 Apr 2016 10:42:32 -0400

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