janestreet / janestreet/ecaml

error condition returned to emacs?

Open
#11 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

forwarded-to-js-devs
Dominant language
OCaml
Stars
286
Forks
13
PR merge metrics
No merged PRs in 30d

Description

Is there global handling of ocaml exceptions raised from code (inside a defun) invoked
from emacs ?
I ask since my emacs crashes with
```
Fatal Error: executable program file not found
```
when I do invalid_arg "..." .
I haven't found anything in the ecaml source yet to indicate a particular
way of returning an error condition back to emacs.

I haven't wrapped my head around the control model between emacs/ecaml/user-code
yet but happily I tried starting a thread before returning a result back to emacs
and that continues running fine.
is this safe to do or should things be done through Async (or ...) ?

thanks.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the exception boundary for OCaml code invoked from an Emacs defun and reproduce the invalid_arg case that reports “Fatal Error: executable program file not found.” Check how errors are returned to Emacs and whether a thread started before returning a result is supported or must use Async; document the observed safe behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
emacs, ocaml
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.