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

feature wish: propose to auto-require packages when doing C-c C-s? #234

Open
erikmd opened this issue Jun 3, 2020 · 3 comments
Open

feature wish: propose to auto-require packages when doing C-c C-s? #234

erikmd opened this issue Jun 3, 2020 · 3 comments

Comments

@erikmd
Copy link
Contributor

erikmd commented Jun 3, 2020

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

@monnier
Copy link
Contributor

monnier commented Aug 24, 2021 via email

@Chris00
Copy link
Member

Chris00 commented Aug 24, 2021

Yes, dune top should make it not too difficult.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants