emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Lisp object that refers to a C struct


From: Stefan Monnier
Subject: Re: Lisp object that refers to a C struct
Date: Mon, 15 Oct 2012 21:07:21 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)

> It seems like a pseudo-vector is used for this, but in my case it
> looks like an overkill: my struct has no Lisp members.

You can use either a pseudo-vector, or s Lisp_Misc.

> There's Lisp_Save_Value, which looks very promising,

Lisp_Save_Value is a Lisp_Misc.

> but why does its documentation say it's for record_unwind_protect?
> Is there anything in it which would preclude its use
> outside unwinding?

It doesn't look very pretty when printed, so it's generally better not
to expose it to users too much.  If your value will usually not be
visible to Elisp code, then Lisp_Save_Value is perfectly fine.
Otherwise, better define your own type so that its printed
representation can be more helpful, indicating what it's used for (I
presume it's for a file-watch-descriptor).


        Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]