From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.devel Subject: Re: C equivalent for: (face-attribute 'region :background (selected-frame) 'default) Date: Tue, 26 Sep 2017 15:06:52 -0700 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Trace: blaine.gmane.org 1506463705 25977 195.159.176.226 (26 Sep 2017 22:08:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 26 Sep 2017 22:08:25 +0000 (UTC) Cc: emacs-devel@gnu.org To: Philipp Stephani Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 27 00:08:18 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dwy1X-0006BA-Nr for ged-emacs-devel@m.gmane.org; Wed, 27 Sep 2017 00:08:16 +0200 Original-Received: from localhost ([::1]:51286 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwy1e-0007JK-RW for ged-emacs-devel@m.gmane.org; Tue, 26 Sep 2017 18:08:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38968) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwy0K-0006lp-PT for emacs-devel@gnu.org; Tue, 26 Sep 2017 18:07:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dwy0F-0004JA-Pt for emacs-devel@gnu.org; Tue, 26 Sep 2017 18:07:00 -0400 Original-Received: from gateway20.websitewelcome.com ([192.185.70.14]:11280) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dwy0F-0004IT-Hf for emacs-devel@gnu.org; Tue, 26 Sep 2017 18:06:55 -0400 Original-Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 30FA9400EE9B7 for ; Tue, 26 Sep 2017 17:06:54 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id wy2FdXma3VBtnwy2Fd6pik; Tue, 26 Sep 2017 17:08:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=xsFFCcWK0R9IYxSFbHzAznRvRvtLz30xmWiQYhGVte4=; b=TO+lmpYD0YtCCVqSj9SKkd6jwq vrC26uPxIV+lK3IZ0HG5Le3bD7jNXKkuvFrw5Dxm4jxcPA5tJD31tgcdHlMDZG4yfIgkQxR8nZNVA m76I/k5wO10OY1gOXqIflpGgwIollyer0HJBw6vpXfEz2puzxBdz7FMee2Wx15KXsDmh3J4VLHvwY BY5f1hwXnqwws6CWluyJRD/CMAq90GdJWnP4VVZqx1cd93XtdZDDXhkNYUAK6u5GtZ/L/NI/zKDMT iOIHwy03V4En454KGHRwaxRG9qztSRPN58+upoWZKE9aJyM+UgD7xZQPWsqp+3TlpgWO0aT95kzDg fhCV6bnA==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:49787 helo=server.private) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.87) (envelope-from ) id 1dwy0D-002unr-Gb; Tue, 26 Sep 2017 17:06:53 -0500 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Exim-ID: 1dwy0D-002unr-Gb X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.private) [45.48.239.195]:49787 X-Source-Auth: lawlist X-Email-Count: 1 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 192.185.70.14 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:218813 Archived-At: Thank you, Philipp, for reading this thread and for teaching me how to call a Lisp function from C. Converting those functions form Lisp to C has been something that I have wanted to do for quite some time, but have admittedly been intimidated because they both use recursion. I have created a working draft in C that has everything (I think) except for `condition_case`, because I haven't learned how to do that in C yet. I'll carbon copy you with the rough draft. Keith ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DATE: [09-26-2017 11:46:05] <26 Sep 2017 18:46:05 +0000> FROM: Philipp Stephani > > * * * > > You can easily call Lisp functions from C. > > // In syms_of_... > DEFSYM (Qface_attribute, "face-attribyte"); > DEFSYM (Qregion, "region"); > DEFSYM (QCbackground, ":background"); > DEFSYM (Qdefault, "default"); > > // Calling > Lisp_Object o = CALLN (Ffuncall, Qface_attribute, Qregion, QCbackground, Fselected_frame (), Qdefault);