E431

57 views
Skip to first unread message

Steve

unread,
May 3, 2020, 4:19:41 AM5/3/20
to vim
Hi there,

Trying to lean how to use tags.

So downloaded a project and

cd projet/
ctags -R .
vim file.php
:set tags=absolute path to tags file
position cursor on a function
Ctrl-]

which triggers the error

E431 format error in tags file tags
before byte 62

A search on the Internet shows a lot of pages but none that helped me.

I'm using Debian 10.3
ctags --version
Exuberant Ctags 5.9~svn20110310, Copyright (C) 1996-2009 Darren Hiebert
Addresses: <dhie...@users.sourceforge.net>, http://ctags.sourceforge.net
Optional compiled features: +wildcards, +regex

vim --version
VIM - Vi IMproved 8.2 (2019 Dec 12, compilé Apr 22 2020 13:35:06)
Rustines incluses : 1-616

Thanks for any help.

Have a nice Sunday
Steve

Rajarajan Rajamani

unread,
May 3, 2020, 7:03:52 AM5/3/20
to vim
Open the tags file itself and see if it kinda ok. Maybe there is a malformed line. Tags files are text files with every line showing a search pattern and file location. Just verify if the tagfile if ok.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200503081931.GA27692%40paros.maison.mrs.

Steve

unread,
May 3, 2020, 11:36:07 AM5/3/20
to vim
Hi,

Le 03-05-2020, à 07:03:31 -0400, Rajarajan Rajamani a écrit :

> Open the tags file itself and see if it kinda ok. Maybe there is a
> malformed line. Tags files are text files with every line showing a
> search pattern and file location. Just verify if the tagfile if ok.

Ok, but what is an ok tag file? As I said, I'm a totally newcomer is
this field.

Steve

unread,
May 3, 2020, 11:44:28 AM5/3/20
to vim
Seems that the *.js files were causing the problem. I reran ctags like
this and it now works as expected:

ctags -R --exclude='*.js' .

But don't understand why js files were the culprit.

Thanks
Steve

Gary Johnson

unread,
May 3, 2020, 2:48:34 PM5/3/20
to vim
You wrote that you got this error message:

E431 format error in tags file tags before byte 62

The format of a tags file is pretty simple. You can read about it
at

:help E431

Try opening the tags file with the error using Vim and execute this
normal-mode command:

62go

That will put the cursor on byte 62. The error should be apparent.
Since Vim expects to see tabs between fields of the tags lines, it
might help to execute

:set list

to make the tabs visible.

If the error is still not apparent, post the first few lines of the
tags file here and maybe someone here can see the problem.

It could be something like the coding of the .js file that causes
ctags to create a line that Vim can't understand, but that's just
a guess.

Regards,
Gary

Steve

unread,
May 4, 2020, 12:13:24 PM5/4/20
to vim
Hi Gary,


Le 03-05-2020, à 11:47:21 -0700, Gary Johnson a écrit :

>If the error is still not apparent, post the first few lines of the
>tags file here and maybe someone here can see the problem.


token : .lparen..................blockComment
}, {
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhie...@users.sourceforge.net/
!_TAG_PROGRAM_NAME Exuberant Ctags //
!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
!_TAG_PROGRAM_VERSION 5.9~svn20110310 //
" includes/ace/src/mode-slim.js /^ this.$quotes = {'"': '"', "'": "'", "`": "`"};$/;" p class:$quotes
" includes/restler/framework/Luracast/Restler/explorer/lib/underscore-min.js


I guess the first line doesn't look good.

Thanks for the help.

Steve

Gary Johnson

unread,
May 4, 2020, 3:23:00 PM5/4/20
to vim
Hi Steve,

No, it doesn't. This looks like a bug in Exuberant Ctags that was
reported in August of 2009:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=541316

Since development of Exuberant Ctags stopped sometime in 2009, it
may never have been fixed.

Workarounds proposed in that report include editing the tags file
and deleting any suspicious lines before the !_TAG_FILE_FORMAT line,
or filtering the tags file with an awk script (although I think
using sed or grep would be simpler).

If this happens only occasionally, I would just edit the tags file
with Vim. If it's a continual problem, then running ctags like this
should fix it:

$ ctags -R -f - | grep $'\t' > tags

You could also try using Universal Ctags instead of Exuberant Ctags.
It might not have the bug, if this is indeed a bug in Exuberant
Ctags.

> Thanks for the help.

You're welcome. I hope we can find a good solution.

Regards,
Gary

Steve

unread,
May 5, 2020, 3:26:10 AM5/5/20
to vim
Le 04-05-2020, à 12:21:47 -0700, Gary Johnson a écrit :

>>
>> I guess the first line doesn't look good.
>
>Hi Steve,
>
>No, it doesn't. This looks like a bug in Exuberant Ctags that was
>reported in August of 2009:
>
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=541316
>
>Since development of Exuberant Ctags stopped sometime in 2009, it
>may never have been fixed.

2009, amazing.

>Workarounds proposed in that report include editing the tags file
>and deleting any suspicious lines before the !_TAG_FILE_FORMAT line,

which I did, and it works.

>or filtering the tags file with an awk script (although I think
>using sed or grep would be simpler).
>
>If this happens only occasionally, I would just edit the tags file
>with Vim. If it's a continual problem, then running ctags like this
>should fix it:
>
> $ ctags -R -f - | grep $'\t' > tags

This also helps, even if it spits out lines like:

ctags: Warning: ignoring null tag in includes/jquery/js/jquery.min.js

>You could also try using Universal Ctags instead of Exuberant Ctags.
>It might not have the bug, if this is indeed a bug in Exuberant
>Ctags.

With Universal Ctags,

ctags -R .

throws out lines like

ctags: Warning: ignoring null tag in includes/jquery/plugins/flot/jquery.flot.pie.min.js(line: 7)

(but less than with Exuberant Ctags)

but works (no E431 error).

Don't know what are those "null tags" though.


>> Thanks for the help.
>
>You're welcome. I hope we can find a good solution.

Changing from Exuberant to Universal is a solution, thanks a lot.

I can now continue my learnings.

Have a nice day

Steve
Reply all
Reply to author
Forward
0 new messages