-
Notifications
You must be signed in to change notification settings - Fork 12
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
error condition returned to emacs? #11
Comments
to clarify the exception matter:
for which I earn an 'invalid function' exception/message.
and
none of which give me any joy (although looked very unlikely to!) for now I have the work-around of shadowing %map_open, trapping any exception |
Ecaml should automatically convert between elisp signals/throws and ocaml exceptions. If you call from elisp into ocaml and your ocaml code raises, you should get an elisp signal corresponding to the ocaml exception. And in the other direction, if your ocaml code calls into some elisp which signals, you should get an ocaml exception corresponding to the elisp signal. The I'm surprised you're seeing emacs crash with Are you raising an exception from a separate thread? It's possible that doesn't work correctly. Code using Async should work fine, but Ecaml hasn't been tested with manually creating/working with threads. |
I was using native emacs plugin with a hacked dynlink module to get a since JS probably has not run ecaml in bytecode I can only ask |
We don't use bytecode at all internally for ecaml. I didn't even realize that could work. I'd recommend compiling to native code. I've got no idea how much of ecaml might work and how much might be broken when running in bytecode. |
thanks! |
It's a known issue and the solution is coming: and for now a bytecode build can be made to work by I cannot seem to close the issue.... |
Is there global handling of ocaml exceptions raised from code (inside a defun) invoked
from emacs ?
I ask since my emacs crashes with
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.
The text was updated successfully, but these errors were encountered: