Skip to content

Commit fba2620

Browse files
authored
Merge pull request #465 from bencef/emacs_implicit_bindings
Fix: Make emacs mode respect implicit bindings
2 parents 5da1bb6 + d7ae407 commit fba2620

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/lib/uTop_main.ml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,10 +747,10 @@ let rec loop term =
747747
match phrase_opt with
748748
| Some phrase ->
749749
(* Rewrite toplevel expressions. *)
750-
let count = S.value UTop_private.count in
751750
let phrase = rewrite phrase in
752751
let phrase =
753752
if UTop.get_create_implicits () then
753+
let count = S.value UTop_private.count in
754754
let binding_name = Printf.sprintf "_%d" count in
755755
bind_expressions binding_name phrase
756756
else
@@ -971,6 +971,14 @@ module Emacs(M : sig end) = struct
971971
let process_checked_phrase phrase =
972972
(* Rewrite toplevel expressions. *)
973973
let phrase = rewrite phrase in
974+
let phrase =
975+
if UTop.get_create_implicits () then
976+
let count = S.value UTop_private.count in
977+
let binding_name = Printf.sprintf "_%d" count in
978+
bind_expressions binding_name phrase
979+
else
980+
phrase
981+
in
974982
try
975983
Env.reset_cache_toplevel ();
976984
ignore (execute_phrase true Format.std_formatter phrase);

0 commit comments

Comments
 (0)