From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Ergus Newsgroups: gmane.emacs.devel Subject: Re: Question about documented functions Date: Sat, 16 Mar 2019 14:53:34 +0100 Message-ID: <20190316135334.aonyjuksw5fw2bm3@Ergus> References: <83bm2e35a1.fsf@gnu.org> <20190314030224.l5zseslncw3xc5ox@Ergus> <835zsm2c2s.fsf@gnu.org> <20190314165147.gmtwgzqaibwbzhbm@Ergus> <83r2b91flg.fsf@gnu.org> <20190314211313.giyz7p6jtmquabea@Ergus> <83bm2c1smi.fsf@gnu.org> <20190316093610.qcjqflorltiyn42a@Ergus> <148A8049-9303-4984-8046-1E55D674D28F@aol.com> <83zhpvxb5a.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="210955"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: NeoMutt/20180716 Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 16 15:01:19 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h59sE-000smz-Jx for ged-emacs-devel@m.gmane.org; Sat, 16 Mar 2019 15:01:18 +0100 Original-Received: from localhost ([127.0.0.1]:42268 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h59sD-0001z7-FB for ged-emacs-devel@m.gmane.org; Sat, 16 Mar 2019 10:01:17 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:45496) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h59s7-0001yU-T8 for emacs-devel@gnu.org; Sat, 16 Mar 2019 10:01:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h59mq-0000PD-EC for emacs-devel@gnu.org; Sat, 16 Mar 2019 09:55:46 -0400 Original-Received: from sonic305-47.consmr.mail.ir2.yahoo.com ([77.238.177.109]:42255) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h59mm-0000LD-V6 for emacs-devel@gnu.org; Sat, 16 Mar 2019 09:55:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1552744538; bh=MX9x3YsqT7tjKEEbTvHrTHFN238oIrGlAxsPFAhNV+U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=ZI+BuqkGW3fI2Otv5NjSuUalUbxp45RAtanAarsiadqs+ppK+99+CMJ8kK3vh4xY6HVoqhDNQI6Y93/025HgsY7gbJ6yf4QAIx+tbRcEEzBxvfcfQKEyY8UEQ7ejqH1AhRKXC3aiJI/UTOn+UACGwU37wdSSs0ddQ63t0539BBpGW26KZnsUNyO/PeMOR/hTsKGSwqv2THLygVgfzUhp7zGdzVFaVzIIN8hFda6Qqfvv8X2RfH976HmApuWCPHOtYn1euQEEQMuvIUX3trN0zhYLkr9BDEVFKExB0c6UjM0ZUiL/RBP+vSCF4cY3SI+pRjzEl5oFDX1l2uFxiYHCMQ== X-YMail-OSG: 9dl1ZDQVM1m.C_tgMHTD_NpkFYBC1PbJ3xSRmAYGFsUWd9uIX04UrakdimUrQxF 7zBgRepieebsG1ejTXw_N3UqcFpZNU0MwzYhjfiVIX7xLeoE9I3o1aULvipQXbBtAMSkdTSZt2lG Mq63KzsKRMqncV9Mdh2CjTiXHuX72VnGwux.hLlTgIb071gvX7ZmVEpEoF5gMn66A2QgYvsNduW6 v8z3d1FemZCYNuK3yoMgasamGGjX4TVbLPtZEP1eeLnWK387ePGlXnfZYK_2V9o_NSA5L5O97zjl BE2HUuvWm9KsQoUOzga5JV0Ckix1AfGRwYkl9VtSPN0Ybxq.uIPfreOZZP1VVjErdrXDmWkYXSd5 BL3TX88voFw.AgIFoTIRvKWX.Y5JWg4IKfy9gO_bbzh2LLI529AMou9geCmBssMtY4WyTlO2s5hW xFj4.7hXD2suZngfYV26_5zGLCJqQHuM94i850FEZFxl2jskXDXAY.YfYFkpRbdut3O1L4Tnqcri eE4IkNjRsIle1GT4StYExe7NAMjrLI.rUjbDWyDNLpfgyITjnVSBWtRkKE71aPtAwaSab7IODK3s RX4zl4vdRsdv4gBz8CmSP6nDtx0jvhKisohcp80CxUIVWV9i7f4F.UVRjJ9vR0oUvdbxs5nPchMK zjeskl7h3_XaBu0AMiBwk8SCjpzoBVJrIPZcgeqLzvCsKru9esB.d0uDS0cePGyubWXDlBPfz3Oj 0lfKKyhufXPLWkUwiqg5oM8NYTiOk8viNJ5KBa.xWLyrNY3lmlYsK36DorSfP57q_wBWMaDtNOqt eFRp201an.xWg7V71rZxv.zMTetV67YYBN3nYMnaiw Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic305.consmr.mail.ir2.yahoo.com with HTTP; Sat, 16 Mar 2019 13:55:38 +0000 Original-Received: from 80.174.187.120.dyn.user.ono.com (EHLO Ergus) ([80.174.187.120]) by smtp412.mail.ir2.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 6ec78af0039f74e1aa3b35bb043eca1e; Sat, 16 Mar 2019 13:53:37 +0000 (UTC) Content-Disposition: inline In-Reply-To: <83zhpvxb5a.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 77.238.177.109 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:234215 Archived-At: On Sat, Mar 16, 2019 at 02:21:37PM +0200, Eli Zaretskii wrote: >> Date: Sat, 16 Mar 2019 11:18:47 +0100 >> From: Ergus >> >> Hi. I have a question. The functions/macros to work with lisp variables from C in lisp.h header file are >> documented somewhere? > >Only in lisp.h itself. If something there is not clear enough, we >could improve the commentary. 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. For example: #if DEFINE_KEY_OPS_AS_MACROS # define XLI(o) lisp_h_XLI (o) # define XIL(i) lisp_h_XIL (i) # define XLP(o) lisp_h_XLP (o) # define XPL(p) lisp_h_XPL (p) # define CHECK_FIXNUM(x) lisp_h_CHECK_FIXNUM (x) # define CHECK_SYMBOL(x) lisp_h_CHECK_SYMBOL (x) # define CHECK_TYPE(ok, predicate, x) lisp_h_CHECK_TYPE (ok, predicate, x) # define CONSP(x) lisp_h_CONSP (x) # define EQ(x, y) lisp_h_EQ (x, y) # define FLOATP(x) lisp_h_FLOATP (x) # define FIXNUMP(x) lisp_h_FIXNUMP (x) # define NILP(x) lisp_h_NILP (x) # define SET_SYMBOL_VAL(sym, v) lisp_h_SET_SYMBOL_VAL (sym, v) # define SYMBOL_CONSTANT_P(sym) lisp_h_SYMBOL_CONSTANT_P (sym) # define SYMBOL_TRAPPED_WRITE_P(sym) lisp_h_SYMBOL_TRAPPED_WRITE_P (sym) # define SYMBOL_VAL(sym) lisp_h_SYMBOL_VAL (sym) # define SYMBOLP(x) lisp_h_SYMBOLP (x) # define TAGGEDP(a, tag) lisp_h_TAGGEDP (a, tag) # define VECTORLIKEP(x) lisp_h_VECTORLIKEP (x) # define XCAR(c) lisp_h_XCAR (c) # define XCDR(c) lisp_h_XCDR (c) # define XCONS(a) lisp_h_XCONS (a) # define XHASH(a) lisp_h_XHASH (a) # ifndef GC_CHECK_CONS_LIST # define check_cons_list() lisp_h_check_cons_list () # endif # if USE_LSB_TAG # define make_fixnum(n) lisp_h_make_fixnum (n) # define XFIXNAT(a) lisp_h_XFIXNAT (a) # define XFIXNUM(a) lisp_h_XFIXNUM (a) # define XSYMBOL(a) lisp_h_XSYMBOL (a) # define XTYPE(a) lisp_h_XTYPE (a) # endif #endif 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.