diff options
| author | Pierre-Marie Pédrot | 2016-05-03 11:25:19 +0200 |
|---|---|---|
| committer | Pierre-Marie Pédrot | 2016-05-03 13:17:01 +0200 |
| commit | 780f3424fb741385f063864d9b15b2c3e3fc419a (patch) | |
| tree | a6e134f31def13a413875d76c22f2b16d42a878c | |
| parent | f51dca0647b3213eb20a9b004372e5e6182bb29a (diff) | |
Fix bug #4705: coqtop accepts both -emacs and -ideslave.
| -rw-r--r-- | toplevel/coqtop.ml | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/toplevel/coqtop.ml b/toplevel/coqtop.ml index cfedff0809..9e1a76bbd6 100644 --- a/toplevel/coqtop.ml +++ b/toplevel/coqtop.ml @@ -241,11 +241,26 @@ let compile_files () = (** Options for proof general *) let set_emacs () = + if not (Option.is_empty !toploop) then + error "Flag -emacs is incompatible with a custom toplevel loop"; Flags.print_emacs := true; Pp.make_pp_emacs (); Vernacentries.qed_display_script := false; color := `OFF +(** Options for CoqIDE *) + +let set_ideslave () = + if !Flags.print_emacs then error "Flags -ideslave and -emacs are incompatible"; + toploop := Some "coqidetop"; + Flags.ide_slave := true + +(** Options for slaves *) + +let set_toploop name = + if !Flags.print_emacs then error "Flags -toploop and -emacs are incompatible"; + toploop := Some name + (** GC tweaking *) (** Coq is a heavy user of persistent data structures and symbolic ASTs, so the @@ -501,7 +516,7 @@ let parse_args arglist = |"-main-channel" -> Spawned.main_channel := get_host_port opt (next()) |"-control-channel" -> Spawned.control_channel := get_host_port opt (next()) |"-vio2vo" -> add_compile false (next ()); Flags.compilation_mode := Vio2Vo - |"-toploop" -> toploop := Some (next ()) + |"-toploop" -> set_toploop (next ()) |"-w" -> set_warning (next ()) (* Options with zero arg *) @@ -522,7 +537,7 @@ let parse_args arglist = |"-emacs" -> set_emacs () |"-filteropts" -> filter_opts := true |"-h"|"-H"|"-?"|"-help"|"--help" -> usage () - |"-ideslave" -> toploop := Some "coqidetop"; Flags.ide_slave := true + |"-ideslave" -> set_ideslave () |"-impredicative-set" -> set_impredicative_set () |"-indices-matter" -> Indtypes.enforce_indices_matter () |"-just-parsing" -> Vernac.just_parsing := true |
