8000 feature wish: propose to auto-require packages when doing C-c C-s? · Issue #234 · ocaml/tuareg · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
feature wish: propose to auto-require packages when doing C-c C-s? #234
Open
@erikmd

Description

@erikmd

currently, when working with an OCaml project involving a large number of dependencies, it is difficult to perform tests in a REPL (C-c C-s) with the proper packages loaded.

Granted, one can manually evaluate #load "topfind";; then #require "jwto";; or so for each package, but it quickly becomes cumbersome on realistic projects.

Would it be possible to implement an elisp feature that would pre-compute the list of packages (e.g. from the PKG lines involved in a .merlin file) and propose to run a command like this when doing C-c C-s?

OCaml REPL to run: OCAMLFIND_COMMANDS='ocamlc=ocaml' ocamlfind ocamlc -linkpkg -package jwto 

Note: this can be tested in a terminal by running:

$ opam install jwto
$ packages="jwto"
$ OCAMLFIND_COMMANDS='ocamlc=ocaml' ocamlfind ocamlc -linkpkg $(for arg in $packages; do echo "-package $arg"; done)

        OCaml version 4.05.0

#show Jwto;;

What do you think?
Maybe this idea should be further refined, but AFAICT one such feature would be really great!

Cc @Chris00 @monnier @cpitclaudel @Aleridia FYI

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0