From: Thorsten W. <tho...@fl...> - 2017-07-14 13:52:52
|
Hi Joachim, I have tried your suggestion to set the flush property for the error stream. After I changed the code of the ECLiPSe inferior mode so that this is done automatically when an ECLiPSe process is started in Emacs, I got some double console prompts. This when the ECLiPSe process is started: [eclipse 1]: Yes (0.00s cpu) [eclipse 2]: And this when an error occurred during compilation of the content of another Emacs buffer: Yes (0.05s cpu) [eclipse 3]: calling an undefined procedure top :- test2(X, Y) in module eclipse Abort [eclipse 4]: It looks as if flushing confuses the comint mode that handles the process communication, maybe due to an extra \n at the end of the line. The first double line I can avoid with using a pre-output filter, but for the error messages, I have to see whether that would work, too. Here’s the output of streams/0 in the ECLiPSe process after setting the error stream to flush: [eclipse 4]: util:streams. WARNING: module 'util' does not exist, loading library... util.eco loaded in 0.00 seconds $&(stream(0)) pipe read user ( input user_input stdin ) $&(stream(1)) pipe write user ( output warning_output log_output user_output stdout toplevel_output debug_output answer_output ) $&(stream(2)) pipe write error ( error user_error stderr ) $&(stream(3)) null update null ( null ) $&(stream(4)) pipe read fd ( toplevel_input ) $&(stream(5)) queue read "" ( ec_rpc_in ) $&(stream(6)) queue update "" ( ec_rpc_out ) $&(stream(8)) pipe read fd ( debug_input ) Yes (0.00s cpu) Cheers, Thorsten Von: Kish Shen [mailto:kis...@gm...] Gesendet: Freitag, 14. Juli 2017 14:54 An: Thorsten Winterer <tho...@fl...> Betreff: Fwd: [Eclipse-clp-bugs] error string on runtime error not displayed on emacs Hi Thorsten, Joachim just posted this reply to the emacs mode bug report, so it seems that it is eclipse's toplevel that is not flushing the error stream.. Cheers, Kish ---------- Forwarded message ---------- From: Joachim Schimpf <jsc...@co...<mailto:jsc...@co...>> Date: Fri, Jul 14, 2017 at 1:28 PM Subject: Re: [Eclipse-clp-bugs] error string on runtime error not displayed on emacs To: ecl...@li...<mailto:ecl...@li...>, "ahr...@ya...<mailto:ahr...@ya...> >> Alexis H. Rivera-Rios" <ahr...@ya...<mailto:ahr...@ya...>> Hi Alexis, The top-level does not flush the error stream because I/O is not from/to a tty (because re-routed through emacs). If you manually set :- set_stream_property(error, flush, end_of_line). then it should work as expected (you can also put this command in a .eclipserc file in your working directory or home directory). To enable me to implement a better fix, could you send me the output that util:streams. produces when you call it from your emacs-embedded eclipse? Thanks, Joachim On 14/07/17 10:45, Alexis H. Rivera-Rios via Eclipse-clp-bugs wrote: Hi, I'm using eclipse 7.21 i386nt on windows 10 and emacs 25.2.1 I'm using eclipse.el but it also happens with prolog.el I believe the problem happens with eclipse 6.1 too. From emacs, when I load/compile a file (C-c-C-b) that has a runtime error for example top :- member2(X,[1,2,3]). Then evaluate top. I get [eclipse 2]: top. Abort [eclipse 3]: However, doing the same evaluation with the eclipse.exe from a dos shell gives me [eclipse 2]: top. calling an undefined procedure member2(_233,[1, 2, 3]) in module eclipse Abort [eclipse 3]: In TkEclipse the abort goes to the result pane and the error message goes to the error pane. My first hypothesis was that emacs was doing something different with output from stdout and stderr. As a test, I created a C++ program that mimics the eclipse.exe read/eval loop. The program prints the eclipse prompt string then outputs an Abort message on stdout and the error string on stderr using std::cout and std::cerr respectively. I expected to see only the Abort string, therefore duplicating the eclipse.exe behavior but that didn't happen. Instead, I got both the error message and the abort string. This tells me that emacs maybe redirecting both stdout and stderr to the same output buffer. One thing I noticed is that if I run the following sequence from emacs using the actual eclipse.exe [eclipse 1]: top. Abort [eclipse 2]: halt. calling an undefined procedure member2(_233,[1, 2, 3]) in module eclipse Process prolog exited abnormally with code 3 As the program is shutdown, I do get the error messages. Almost as if eclipse.exe buffers the error message. If I enter multiple commands with runtime errors and then halt, I will see all of them. I will appreciate your help on the subject. Thanks Alexis **//___^ El amor a la patria tiene que transformarse en acción y ésta tiene que ser acción para el bien común. (Adalexis Rios- mi madre) ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Eclipse-clp-bugs mailing list Ecl...@li...<mailto:Ecl...@li...> https://lists.sourceforge.net/lists/listinfo/eclipse-clp-bugs ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Eclipse-clp-bugs mailing list Ecl...@li...<mailto:Ecl...@li...> https://lists.sourceforge.net/lists/listinfo/eclipse-clp-bugs |