emacs-devel
[Top][All Lists]
Advanced

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

Re: Question about documented functions


From: Eli Zaretskii
Subject: Re: Question about documented functions
Date: Sat, 16 Mar 2019 16:05:46 +0200

> Date: Sat, 16 Mar 2019 14:53:34 +0100
> From: Ergus <address@hidden>
> Cc: address@hidden
> 
> The problem is that I was trying to figure out the canonical method to
> check if a variable was: t from C code (or assign t to a "DEFVAR_LISP"
> defined variable). I was looking for something similar to NILP but I
> couldn't get it.

Use Qt in C to refer to the symbol t.  Like this:

  Lisp_Object foo = Qt;      /* assignment */
  ...
  if (EQ (some_object, Qt))  /* test for equality to t */
    ...

> It will be helpful for new people (like me), some explanations about
> each of them. Expected arguments, and or objectives. And comments like
> XFIXNUM can crash so it is needed to protect the code with an if
> FIXNUMP. And then what CHECK_FIXNUM is useful for.
> 
> I know I need to read more, but it was a bit confusing to figure out the
> difference between FIXNUM and FIXNAT.
> 
> And functions that are lisp equivalents (CAR CRD) could say that so
> newbies can refer to the elisp manual to look for it.

OK, I will try to add some more commentary when I have time.



reply via email to

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