aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/pp.ml4
-rw-r--r--lib/pp.mli10
-rw-r--r--printing/printer.ml18
3 files changed, 20 insertions, 12 deletions
diff --git a/lib/pp.ml b/lib/pp.ml
index d7ae31dd3b..44036ca996 100644
--- a/lib/pp.ml
+++ b/lib/pp.ml
@@ -447,6 +447,10 @@ let logger = ref std_logger
let feedback_id = ref (Feedback.Edit 0)
let feedback_route = ref Feedback.default_route
+(* If mixing some output and a goal display, please use msg_warning,
+ so that interfaces (proofgeneral for example) can easily dispatch
+ them to different windows. *)
+
let msg_info x = !logger ~id:!feedback_id Info x
let msg_notice x = !logger ~id:!feedback_id Notice x
let msg_warning x = !logger ~id:!feedback_id Warning x
diff --git a/lib/pp.mli b/lib/pp.mli
index fd529e1d79..d4314a3366 100644
--- a/lib/pp.mli
+++ b/lib/pp.mli
@@ -122,6 +122,16 @@ type message = Feedback.message = {
type logger = message_level -> std_ppcmds -> unit
+(** {6 output functions}
+
+[msg_info] and [msg_notice] do not put any decoration on output by
+default. If possible don't mix them with goal output (prefer
+msg_warning) so that dispatching of outputs is easier. Once all
+interfaces use the xml-like protocol this constraint can be
+relaxed. *)
+(* Should we advertise these functions more? Should they be the ONLY
+ allowed way to output something? *)
+
val msg_info : std_ppcmds -> unit
(** Message that displays information, usually in verbose mode, such as [Foobar
is defined] *)
diff --git a/printing/printer.ml b/printing/printer.ml
index cda0403d97..5d9fa13137 100644
--- a/printing/printer.ml
+++ b/printing/printer.ml
@@ -618,22 +618,16 @@ let pr_open_subgoals ?(proof=Proof_global.give_me_the_proof ()) () =
begin match bgoals,shelf,given_up with
| [] , [] , [] -> pr_subgoals None sigma seeds shelf stack goals
| [] , [] , _ ->
- (* emacs mode: xml-like flag for detecting information message *)
- str (emacs_str "<infomsg>") ++
- str "No more goals, however there are goals you gave up. You need to go back and solve them."
- ++ str (emacs_str "</infomsg>")
- ++ fnl () ++ fnl ()
+ msg_warning (str "No more goals, however there are goals you gave up. You need to go back and solve them.");
+ fnl () ++ fnl ()
++ pr_subgoals ~pr_first:false None bsigma seeds [] [] given_up
| [] , _ , _ ->
- (* emacs mode: xml-like flag for detecting information message *)
- str (emacs_str "<infomsg>") ++
- str "All the remaining goals are on the shelf."
- ++ str (emacs_str "</infomsg>")
- ++ fnl () ++ fnl ()
+ msg_warning (str "All the remaining goals are on the shelf.");
+ fnl () ++ fnl ()
++ pr_subgoals ~pr_first:false None bsigma seeds [] [] shelf
| _ , _, _ ->
- str "This subproof is complete, but there are still unfocused goals."
- ++ fnl () ++ fnl ()
+ msg_warning (str "This subproof is complete, but there are still unfocused goals.");
+ fnl () ++ fnl ()
++ pr_subgoals ~pr_first:false None bsigma seeds shelf [] bgoals
end
| _ -> pr_subgoals None sigma seeds shelf stack goals