eunit icon indicating copy to clipboard operation
eunit copied to clipboard

tty output for next-error support on emacs

Open richcarl opened this issue 13 years ago • 1 comments

Reported by M.W.Park.

When i got some errors in emacs erlang buffer, next-error (C-x `) always prompts for the exact file name because of the missing '.erl' in the tty message.

a patch for adding ".erl" at the end of module name (in eunit_tty.erl). i don't know this is the right way for doing things like this. but, it worked for me. i can use 'next-error' command (C-x `) in my emacs erlang buffer without prompt

Index: eunit_tty.erl

--- eunit_tty.erl (revision 274) +++ eunit_tty.erl (working copy) @@ -223,7 +223,7 @@ D = if Desc =:= "" -> ""; true -> io_lib:fwrite(" (~s)", [Desc]) end,

  • io_lib:fwrite("~s:~s~s~s...", [Module, L, Name, D]).
  • io_lib:fwrite("~s.erl:~s~s~s...", [Module, L, Name, D]).

print_test_begin(I, Text) -> indent(I),

richcarl avatar Jul 28 '11 19:07 richcarl

Thanks. It's not quite the right thing to do, however. There are cases where the module name does not match the file name (package namespaces), in which case tacking on ".erl" is simply a lie. I'm thinking about changing the event protocol anyway, so perhaps it should include the file name as a separate item. Also, complete file names could make the output very verbose (but clickable messages are quite useful). I'll have to experiment a bit.

richcarl avatar Jul 28 '11 19:07 richcarl