Skip to content
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

Fix: Make emacs mode respect implicit bindings #465

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/lib/uTop_main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -751,10 +751,10 @@ let rec loop term =
match phrase_opt with
| Some phrase ->
(* Rewrite toplevel expressions. *)
let count = S.value UTop_private.count in
let phrase = rewrite phrase in
let phrase =
if UTop.get_create_implicits () then
let count = S.value UTop_private.count in
let binding_name = Printf.sprintf "_%d" count in
bind_expressions binding_name phrase
else
Expand Down Expand Up @@ -975,6 +975,14 @@ module Emacs(M : sig end) = struct
let process_checked_phrase phrase =
(* Rewrite toplevel expressions. *)
let phrase = rewrite phrase in
let phrase =
if UTop.get_create_implicits () then
let count = S.value UTop_private.count in
let binding_name = Printf.sprintf "_%d" count in
bind_expressions binding_name phrase
else
phrase
in
try
Env.reset_cache_toplevel ();
ignore (execute_phrase true Format.std_formatter phrase);
Expand Down