aboutsummaryrefslogtreecommitdiff
path: root/proofs/proofview.ml
diff options
context:
space:
mode:
authorPierre Courtieu2015-01-08 16:59:47 +0100
committerPierre Courtieu2015-01-08 16:59:57 +0100
commitb92fff621cce1576c93fab9276fb41ea85e10982 (patch)
treed6e0c1964b274c9b00339452d77468f48ebe2794 /proofs/proofview.ml
parent448bf4529c5766e98367345076d00e64e25db7bf (diff)
Fixed and extend bullet related info/error messages. + doc.
Had to put some hook in the handler of Proofview.NoSuchgoals. Documentation updated. CHANGE updated.
Diffstat (limited to 'proofs/proofview.ml')
-rw-r--r--proofs/proofview.ml16
1 files changed, 15 insertions, 1 deletions
diff --git a/proofs/proofview.ml b/proofs/proofview.ml
index f1d10bbe55..44bf652125 100644
--- a/proofs/proofview.ml
+++ b/proofs/proofview.ml
@@ -343,8 +343,22 @@ let tclBREAK = Proof.break
(** {7 Focusing tactics} *)
exception NoSuchGoals of int
+
+(* This hook returns a string to be appended to the usual message.
+ Primarily used to add a suggestion about the right bullet to use to
+ focus the next goal, if applicable. *)
+let nosuchgoals_hook:(int -> string option) ref = ref ((fun n -> None))
+let set_nosuchgoals_hook f = nosuchgoals_hook := f
+
+
+
+(* This uses the hook above *)
let _ = Errors.register_handler begin function
- | NoSuchGoals n -> Errors.error ("No such " ^ String.plural n "goal" ^".")
+ | NoSuchGoals n ->
+ let suffix:string option = (!nosuchgoals_hook) n in
+ Errors.errorlabstrm ""
+ (str "No such " ++ str (String.plural n "goal") ++ str "."
+ ++ pr_opt str suffix)
| _ -> raise Errors.Unhandled
end