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

create a custom variable for process-connection-type #314

Open
bufordrat opened this issue May 9, 2024 · 4 comments
Open

create a custom variable for process-connection-type #314

bufordrat opened this issue May 9, 2024 · 4 comments

Comments

@bufordrat
Copy link

Summary

The proposal in this issue is to make process-connection-type customizable.

Background

In commit cd5229e, in order to address #83, process-connection-type was changed from nil to t. This allowed Tuareg-Interactive mode to display the output of ctypes functions when they wrote to stdout. However, a (presumably unintended) consequence of this change was that it became impossible to run utop under Tuareg-Interactive mode, which previously worked smoothly. When process-connection-type is set to t, utop becomes unusable when run by tuareg-run-ocaml.

For more information, please see the OCaml Discuss thread that uncovered this issue:
https://discuss.ocaml.org/t/comint-version-of-utop-in-emacs/14466

Proposal

A forthcoming PR will make the value of process-connnection-type configurable via Emacs' customize facility. The default value will be t, which means that this change will have no discernible effect for most Tuareg users. But the Emacs user will be able to set process-connection-type to nil if they would like to use tuareg-run-ocaml with utop. Having this ability will be incredibly valuable, especially to those of us at the UChicago Library who run utop under Tuareg.

@monnier
Copy link
Contributor

monnier commented May 13, 2024 via email

@bufordrat
Copy link
Author

These are good points, and I would definitely be interested in working on a PR to the utop project that recommends one of these changes. However, I wonder whether you would be willing to consider the code in the PR associated with this issue as a short-term solution, for the following reasons:

  • prior to commit cd5229e, process-connection-type was in fact hardcoded to nil with no problems that I know of, other than the inability to display the output of ctypes functions
  • there are no major downsides (at least none that I can think of) to giving Tuareg users the ability to customize how the Tuareg interactive process creates a REPL
  • doing so immediately fixes a broken dev environment, which seems like a high payoff

In other words, this customization solution seems very low-cost, and will help Tuareg users waiting for an upstream utop fix. If future Tuareg users of future REPLs have a similar problem, they will also avoid having a similar wait-time till solution.

@monnier
Copy link
Contributor

monnier commented May 15, 2024 via email

@bufordrat
Copy link
Author

Wowie zowie, I just tried pasting that exact code into my init file and it worked like a charm outta the box. Ok, this solution works for me; thanks! Will get going on a PR to utop.

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

No branches or pull requests

2 participants