From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani
--047d7b86e9923987e2053c5d95fa--On Sun, Sep 11, 2016 at 4:02 PM, Philipp Stephani <p.stephani2@gmail.com>= wrote:hx <silent2600@gmail.com> schrieb am So., 11. Sep. 2016 = um 06:30=C2=A0Uhr:is it possible to keep a copy of the *env in module ?= div>No. emacs_env, emacs_runtime, and emacs_value objects are on= ly valid within the dynamic extent of the function they are created/passed = in. You can't keep them around. The only exception are global reference= s, created by make_global_ref.instead of copy the p= ointer, I copy the struct content:emacs_env genvo;emacs_env *genv =3D &genvo;intemacs_m= odule_init(struct emacs_runtime *ert){=C2=A0 emacs_env *env =3D = ert->get_environment(ert);=C2=A0 genvo =3D *env;= div>...}it is working.= =C2=A0Only by accident in the curr= ent implementation. Please don't do this; it's not guaranteed to wo= rk, and may stop working at any time.=C2=A0