-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[coq 8.7] [serious] errors don't block proof-assert-next
and we can continue asserting after error.
#175
Comments
proof-assert-next
proof-assert-next
and we can continue asserting after error.
proof-assert-next
and we can continue asserting after error.proof-assert-next
and we can continue asserting after error.
Indeed removing the "emacs specific quoting" around the error fixed this problem: diff --git a/vernac/topfmt.ml b/vernac/topfmt.ml
index ee55366..0b8d3a5 100644
--- a/vernac/topfmt.ml
+++ b/vernac/topfmt.ml
@@ -259,7 +259,7 @@ let init_color_output () =
- Warning/Error: emacs_quote_err
- Notice: unquoted
*)
-let emacs_logger = gen_logger emacs_quote_info emacs_quote_err
+let emacs_logger = gen_logger emacs_quote_info (fun x -> x)
(* Output to file, used only in extraction so a candidate for removal *)
let ft_logger old_logger ft ?loc level mesg = still waiting to see what you folks want before committing any further change to Coq. |
I'm not sure I understand the problem, unfortunately. @Matafou, do you know what the issue is? |
@cpitclaudel I think the issue is simple: what is the error format PG expects from Coq? Once you let us know, we will implement that in Coq. In the past, Coq emitted errors in 2 different ways when @JasonGross has suggested that maybe the markers maybe should not be present, but I am not sure anymore. Thanks for having a look to this. |
BTW I'll be happy to chat on Coq's gitter if you folks think we can make progress that way. |
Ah, got it. Pierre introduced these markers, IIRC, so he'll know better than me. My understanding was that some things were to be displayed in real time, and other were to be displayed once processing was complete, and that was why there were two kinds? |
I can't tell. Al Coq error messages in
where
and
Note that in the past, such messages where also produced without the markers (*), hence the bug as PG seems to handle only those correctly. (*) Whether an error message contained the marker used to depend on the Coq component originating it. |
Ok. I don't know enough about this then. Let's wait for @Matafou |
Sorry guys I am in holidays currently. Will have a look next week.
P
Le mer. 12 avr. 2017 à 16:50, Clément Pit-Claudel <notifications@github.com>
a écrit :
… Ok. I don't know enough about this then. Let's wait for @Matafou
<https://github.com/Matafou>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#175 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEsl6gpjWAuqkjt5S7PCJEoI6N1GFNaaks5rvWNNgaJpZM4M2UTU>
.
|
A good example of the discrepancy in 8.6 is |
OK I am currently looking at this. They are two different issues IIUW:
point 2) should rework once 1) is solved but it uses space counting whereas now toplevel gives a position which is easier to parse. So I may switch to this and let the space counting code for compatibility. No hurry though. point 1) is broken because indeed error where not tagged at all before (It was only for warnings). The regexp detecting errors are not triggered anymore because they assume that for instance "Error:" appears at the beginning of a line, but now the special character is make this fail. So yes removing the special characters is OK. By the way @ejgallego why is "really painful" in topfmt.ml?
|
@Matafou ok, let me know the desired specification in terms of the components I described in my previous messages and I'll update the printing system immediately.
This comment was added back in 8.5 -> 8.6 , but IIRC it was not particularly aimed at the emacs stuff but indeed at the general feedback/pp situation at the time.
|
Thanks Emilio. You mean this?:
Please just remove MARKER[254] and MERGKER[255] for now. I will ask for removal of program_caret once I have implement the parsing of location_info. I may ask for a special tag ahead of Error: but I need to modify pg generic code to hide it from response buffer first.
Indeed it is poorly documented. You can find a bit in coqloop@193 about prompts.
Indeed, currently pg regexp for coq errors is:
If you simplify this i am all for it.
True.
The generic mechanism of pg needs tags around warnings if one wants to see them when scritping several commands at once. On the contrary errors are considered to stop at the next prompt so we only need to recognize the beginning of an error message. Again this comes from he minimlity principle.
Indeed, only the content of goals and response buffers try to be parseable, not the content of coq session.
Not sure to understand what you mean here. If you mean that error message are not recognizable enough I agree.
Isn't the whole point of loggers to have several ones? |
Sorry now that I tested things by myself I think we need to do something a bit more complex because the current behaviour of pg is not satisfying concerning the display of all kinds of messages. In loggers there are 5 kinds of messages. Debug, Info, Notice, Warning and Error. In pg we have 3 levels of messages:
Let us make this clean on pg side and adapt the emacs logger to that, I propose that the 5 coq levels are displayed like this 3 pg levels:
@ejgallego I can do it if you want. @ejgallego what is the meaning of these negative locations? I have seen acomment about that elsewhere but can't remember |
Should info be hidden when "Set Silent" is set? Currently I see these messages. |
Eeeeh and why are goals diplayed as "Debug" messages??? Sorry but I am a bit puzzled by the current state of loggers... |
@ejgallego I think we need to meet IRL for this. I will be at Sophie Germain friday 28 maybe we can have 30 minutes discussion at that moment? |
Indeed now all the errors are of that form, and always include the header
Note again that some errors (such as
I meant this. This is in fact the reason I resolved the ambiguity opting to add the markers. I didn't realize PG was already buggy for errors with markers (such as
Well that has to be handled with care, in the past in particular we had several loggers and different paths were taken for errors even under the same flags. There are some examples in the bugzilla.
Sorry I don't understand what you mean here as all the levels are similar, note that PG in the past used at least 4 modes not 3. [ Feel free to submit a PR of course.
This is due to ltac semantics reporting the error in the definition of tactics. Previously these messages were reported as unlocated or with the wrong location. Now the offset to the current sentence is computed accurately wrt the input buffer.
That is a good question, do you have an example illustrating a change of behavior wrt 8.6?
Are you sure you are in trunk?
I think 28 may work for me. |
This one was my fault. |
Well, it was my fault but I fixed it quickly :D anyways we've merged quite a few commits trying to consolidate the printing structure and indeed some new bugs have been exposed, please bear with us, it is basically very hard to test this kind of interactive use. |
In 8.6 + emacs, errors were quoted sometimes with special markers (e.g. `Print Module foo.` for a non-existing `foo`) In 8.7 we uniformized error handling and now all errors are quoted, however, this behavior confuses emacs as it seems that the quotes are meant to be applied only to warnings. We thus reflect the de-facto situation, removing quoting for errors and updating the code so it is clear that the quoter is a warnings quoter. This fixes ProofGeneral for trunk users. c.f. ProofGeneral/PG#175
Ok I've submitted coq/coq#581 so Coq trunk becomes usable to PG users. IMHO the current rules are pretty clear from the code itself: let gen_logger dbg warn ?pre_hdr level msg = match level with
| Debug -> msgnl_with !std_ft (make_body dbg dbg_hdr ?pre_hdr msg)
| Info -> msgnl_with !std_ft (make_body dbg info_hdr ?pre_hdr msg)
| Notice -> msgnl_with !std_ft (make_body noq info_hdr ?pre_hdr msg)
| Warning -> Flags.if_warn (fun () ->
msgnl_with !err_ft (make_body warn warn_hdr ?pre_hdr msg)) ()
| Error -> msgnl_with !err_ft (make_body noq err_hdr ?pre_hdr msg) that is to say, |
Looks good to me. Thanks @ejgallego ! Now that we are back to previous behavour (fixed and more uniform), I must say that don't like those special chars because they may confuse emacs in presence of unicode. I would like to replace them by |
Your call folks, I thought that the quoting behavior of the past would make more sense.
by? |
Sorry, edited my last message. |
|
Yes please.
P.
Le dim. 23 avr. 2017 à 02:37, Emilio Jesús Gallego Arias <
notifications@github.com> a écrit :
… <warning></warning> sounds fine, do you want that change pushed now?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#175 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEsl6p7hvcfsXUgyh19UemG2rVKDgEquks5ryp1NgaJpZM4M2UTU>
.
|
In 8.6 + emacs, errors were quoted sometimes with special markers (e.g. `Print Module foo.` for a non-existing `foo`) In 8.7 we uniformized error handling and now all errors are quoted, however, this behavior confuses emacs as it seems that the quotes are meant to be applied only to warnings. We thus reflect the de-facto situation, removing quoting for errors and updating the code so it is clear that the quoter is a warnings quoter. This fixes ProofGeneral for trunk users. c.f. ProofGeneral/PG#175
In 8.6 + emacs, errors were quoted sometimes with special markers (e.g. `Print Module foo.` for a non-existing `foo`) In 8.7 we uniformized error handling and now all errors are quoted, however, this behavior confuses emacs as it seems that the quotes are meant to be applied only to warnings. We thus reflect the de-facto situation, removing quoting for errors and updating the code so it is clear that the quoter is a warnings quoter. We also update the warnings quoter to use a warning tag instead of a non-printable char. This fixes ProofGeneral for trunk users. c.f. ProofGeneral/PG#175
PR updated. |
In 8.6 + emacs, errors were quoted sometimes with special markers (e.g. `Print Module foo.` for a non-existing `foo`) In 8.7 we uniformized error handling and now all errors are quoted, however, this behavior confuses emacs as it seems that the quotes are meant to be applied only to warnings. We thus reflect the de-facto situation, removing quoting for errors and updating the code so it is clear that the quoter is a warnings quoter. We also update the warnings quoter to use a warning tag instead of a non-printable char. This fixes ProofGeneral for trunk users. c.f. ProofGeneral/PG#175
Ready for merging imho. |
@Matafou did you mean to comment on coq/coq#581 ? |
Yes sorry. |
Ok so I think we can consider this fixed for now, it works for me! However you may want to update the warning detection code in PG I guess. |
It is already updated in PG/master. People will have to update their pg to
see all warning.
This desreves a word in CHANGE probably.
P.
2017-04-24 17:33 GMT+02:00 Emilio Jesús Gallego Arias <
notifications@github.com>:
… Closed #175 <#175>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#175 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AEsl6kdpYF1uv5HpitaK51wR81VqBEFyks5rzMDcgaJpZM4M2UTU>
.
|
Cool thanks. There is still time to improve |
Hopefully Proofgeneral/xml will replace -emacs soon and we may remove -emacs option in a near future. |
I would reopen #173 but I don't have the rights.
After coq/coq#530, Coq will always wrap errors in the markers, and put position information before. However, PG fails with this setting as now errors don't stop the buffer anymore.
So it seems I tried to guess wrong here; I am OK implementing whatever error output specification you want for
-emacs
, just let me know.The text was updated successfully, but these errors were encountered: