lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi list,

I use the luac -p command to check lua code for errors. More precisely
I use Emacs with an add-on called flycheck, wich calls the luac -p
command on the current file in the editor to check for syntax errors
on the fly and to give the user visual feedback where the error in the
file is located.

I recently discovered that when the input file path is quite long, the
file name with the error in the luac -p output is abbreviated, and the
full path is not recognizable.

For example when I run this command:

$ luac -p /Users/peter/src/flycheck/test/resources/checkers/lua-syntax-error.lua

the output is the following:

luac: ...rc/flycheck/test/resources/checkers/lua-syntax-error.lua:5:
unfinished string near '"oh no'


This behaviour breaks the on the fly syntax checker in Emacs because
the parser can not extract the correct file path from the output.

I do not understand why the file name in the output should be
abbreviated? Is there a good reason? Would it be possible to change
the way the luac outputs the file name? Or some option to show the
full and correct file path?

Thanks,
Peter