From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Masatake YAMATO Newsgroups: gmane.emacs.devel Subject: Re: writing an elisp interface to a c library Date: Thu, 18 Aug 2005 20:29:14 +0900 (JST) Message-ID: <20050818.202914.73572210.jet@gyve.org> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1124369750 8362 80.91.229.2 (18 Aug 2005 12:55:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 18 Aug 2005 12:55:50 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 18 14:55:40 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1E5juk-0008VY-Rf for ged-emacs-devel@m.gmane.org; Thu, 18 Aug 2005 14:54:35 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E5jyG-0003Se-Vo for ged-emacs-devel@m.gmane.org; Thu, 18 Aug 2005 08:58:13 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1E5jFU-0005WM-EZ for emacs-devel@gnu.org; Thu, 18 Aug 2005 08:11:56 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1E5jFQ-0005VF-Dg for emacs-devel@gnu.org; Thu, 18 Aug 2005 08:11:54 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E5jBl-0004KC-VL for emacs-devel@gnu.org; Thu, 18 Aug 2005 08:08:06 -0400 Original-Received: from [66.187.233.31] (helo=mx1.redhat.com) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1E5iyx-0001cL-4I for emacs-devel@gnu.org; Thu, 18 Aug 2005 07:54:51 -0400 Original-Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j7IBcKYQ013748; Thu, 18 Aug 2005 07:38:20 -0400 Original-Received: from pobox.tokyo.redhat.com (pobox.tokyo.redhat.com [172.16.33.225]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j7IBcIV09746; Thu, 18 Aug 2005 07:38:19 -0400 Original-Received: from localhost (gls07.tokyo.redhat.com [172.16.32.104]) by pobox.tokyo.redhat.com (8.12.8/8.12.8) with ESMTP id j7IBcFNe002718; Thu, 18 Aug 2005 20:38:16 +0900 Original-To: cloos@jhcloos.com In-Reply-To: X-Mailer: Mew version 4.2 on Emacs 22.0.50 / Mule 5.0 (SAKAKI) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:42218 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:42218 > Can anyone point me to a good example in the emacs codebase of a lisp > api that closely matches an existing external c api? So far I've only > hacked the elisp part of emacs, not the C.... > > I presume I'll need to create some read-only lisp integers matching > the names of the various enum values, lisp objects to hold the (opaque) > structs the lib uses and DEFUNs to match the lib's api? I have read > the primitives section of the elisp manual, but which src files are > the best to study? I don't know well about the C side. However, I think M-x describe-function on a built-in function is really helpful. Because its *Help* buffer contains a link to its definition in a C source file. Try "M-x describe-function car" to know about list. Try "M-x describe-function to numberp" to know about number... I feel strong GNU'ism from the link. Masatake YAMATO