>> >> And how do I use a USER_PTR? Do I cast it into (struct Lisp_User_Ptr) and >> use it normally, or is there some helper function that I should use? > > Most likely you'll want some of your functions to take objects that > should be "tree sitter parsers", but you'll only receive a Lisp_Object > so you'll need to be able to *test* that the object you received is > indeed a "tree sitter parser". > > For that reason you'll probably want to add a new entry to `pvec_type` > rather than use a USER_PTR. Actually, what is the correct way to provide a pointer from a dynamic module to Emacs core? I tried to use USER_PTR, but the dynamic module can only return an emacs_value, and to convert an emacs_value to a Lisp_Object, I need to use value_to_lisp, which is not exposed by emacs-module.c. I want to provide individual tree-sitter language definitions from dynamic modules so that one don’t need to compile Emacs with language definitions. Yuan