From ace481388a54fdf89244a76497fbdedb4ff15207 Mon Sep 17 00:00:00 2001 From: Etienne Millon Date: Tue, 31 Jan 2023 15:58:29 +0100 Subject: [PATCH] Mark deprecated values with attribute They have been deprecated in 2012 and most of them are ignored. --- CHANGES.md | 7 +++++++ src/lib/uTop.mli | 9 +++++++++ src/lib/uTop_main.ml | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 1f45817..557066c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,10 @@ +2.12.0 (unreleased) +------------------- + +* Mark `prompt_continue`, `prompt_comment`, `smart_accept`, `new_prompt_hooks`, + `at_new_prompt` as deprecated (they have been documented as such since 2012 + and most of them are ignored) (#xxx @emillon) + 2.11.0 (2023-01-05) ------------------- diff --git a/src/lib/uTop.mli b/src/lib/uTop.mli index ca68c13..3a86cbe 100644 --- a/src/lib/uTop.mli +++ b/src/lib/uTop.mli @@ -352,7 +352,16 @@ val set_load_path : string list -> unit (* These variables are not used and deprecated: *) val prompt_continue : LTerm_text.t React.signal ref +[@@deprecated] + val prompt_comment : LTerm_text.t React.signal ref +[@@deprecated] + val smart_accept : bool ref +[@@deprecated] + val new_prompt_hooks : (unit -> unit) LTerm_dlist.t +[@@deprecated] + val at_new_prompt : (unit -> unit) -> unit +[@@deprecated] diff --git a/src/lib/uTop_main.ml b/src/lib/uTop_main.ml index be96f94..4352d3e 100644 --- a/src/lib/uTop_main.ml +++ b/src/lib/uTop_main.ml @@ -230,7 +230,7 @@ class read_phrase ~term = object(self) let input_utf8= Zed_string.to_utf8 input in (* Toploop does that: *) Location.reset (); - let eos_is_error = not !UTop.smart_accept in + let eos_is_error = not !(UTop.smart_accept[@alert "-deprecated"]) in try let result = parse_and_check input_utf8 eos_is_error in return_value <- Some result;