From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Leake Newsgroups: gmane.emacs.devel Subject: Re: Dynamic loading progress; funcall of goto-char fails Date: Wed, 06 May 2015 03:15:14 -0500 Message-ID: <85y4l2ktpp.fsf@stephe-leake.org> References: <83sie7un20.fsf@gnu.org> <54E0D181.2080802@dancol.org> <83r3trulse.fsf@gnu.org> <54E0D7E0.305@87.69.4.28> <83h9unukbg.fsf@gnu.org> <54E0DEF8.7020901@dancol> <83egpruiyp.fsf@gnu.org> <54E0FF93.2000104@dancol.org> <833865vp4d.fsf@gnu.org> <54E2355A.90@87.69.4.28> <83vbj1u020.fsf@gnu.org> <54E24CA4.9020601@dancol.org> <83h9uk7ddb.fsf@gnu.org> <54E382A5.5030408@dancol.org> <85a8zcu8gn.fsf@stephe-leake.org> <85383amjkx.fsf_-_@stephe-leake.org> <554996B1.4030400@dancol.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1430900166 29692 80.91.229.3 (6 May 2015 08:16:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 6 May 2015 08:16:06 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 06 10:15:52 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YpuUh-0007b5-R3 for ged-emacs-devel@m.gmane.org; Wed, 06 May 2015 10:15:51 +0200 Original-Received: from localhost ([::1]:43515 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YpuUg-0007Ix-Qr for ged-emacs-devel@m.gmane.org; Wed, 06 May 2015 04:15:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55027) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YpuUc-0007Ir-PC for emacs-devel@gnu.org; Wed, 06 May 2015 04:15:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YpuUX-0004IF-Eo for emacs-devel@gnu.org; Wed, 06 May 2015 04:15:46 -0400 Original-Received: from gproxy1-pub.mail.unifiedlayer.com ([69.89.25.95]:49642) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1YpuUX-0004I1-48 for emacs-devel@gnu.org; Wed, 06 May 2015 04:15:41 -0400 Original-Received: (qmail 654 invoked by uid 0); 6 May 2015 08:15:35 -0000 Original-Received: from unknown (HELO cmgw4) (10.0.90.85) by gproxy1.mail.unifiedlayer.com with SMTP; 6 May 2015 08:15:35 -0000 Original-Received: from host114.hostmonster.com ([74.220.207.114]) by cmgw4 with id QeFR1q00i2UdiVW01eFUmw; Wed, 06 May 2015 08:15:34 -0600 X-Authority-Analysis: v=2.1 cv=D8zUdJhj c=1 sm=1 tr=0 a=CQdxDb2CKd3SRg4I0/XZPQ==:117 a=CQdxDb2CKd3SRg4I0/XZPQ==:17 a=DsvgjBjRAAAA:8 a=f5113yIGAAAA:8 a=2wGvvwaKUHMA:10 a=IkcTkHD0fZMA:10 a=9i_RQKNPAAAA:8 a=hEr_IkYJT6EA:10 a=x_XPkuGwIRMA:10 a=h1PgugrvaO0A:10 a=KxCsr730AAAA:8 a=pGLkceISAAAA:8 a=iMu2XlVJ6w3yXT_7VZUA:9 a=QEXdDO2ut3YA:10 Original-Received: from [76.218.37.33] (port=57260 helo=TAKVER) by host114.hostmonster.com with esmtpa (Exim 4.84) (envelope-from ) id 1YpuUI-0000s0-0O for emacs-devel@gnu.org; Wed, 06 May 2015 02:15:26 -0600 In-Reply-To: <554996B1.4030400@dancol.org> (Daniel Colascione's message of "Tue, 05 May 2015 21:21:05 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (windows-nt) X-Identified-User: {2442:host114.hostmonster.com:stephele:stephe-leake.org} {sentby:smtp auth 76.218.37.33 authed with stephen_leake@stephe-leake.org} X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 69.89.25.95 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:186274 Archived-At: Daniel Colascione writes: > On 05/05/2015 09:11 PM, Stephen Leake wrote: >> Stephen Leake writes: >>=20 >>> Aur=C3=A9lien Aptel writes: >>> >>>> I've tried to implement modules using Daniel's plan. It turned out to >>>> be pretty easy, mostly because I'm more familiar with the Emacs >>>> codebase now and because it's a lot less intrusive than my previous >>>> attempt. >>>> >>>> It's not finished but I have a basic module working on linux. It's a >>>> proof of concept, basically. >>> >>> I've implemented a test module that calls two Ada mode parser actions >>> (see below). >>> >>> The real module will call the actual parser and build the action args >>> from the parse results. >>> >>> I did not have to modify anything in the Emacs C code to make this work, >>> so it shows this module design is adquate for my use case so far. >>=20 >> I've made more progress; I've got a module that should run the full Ada >> parser on a buffer. >>=20 >> However, when I run it, it crashes on a call like: >>=20 >> emacs_value goto_char_sym =3D env.intern (env, "goto-char"); >> env.funcall (env, goto_char_sym, env.make_fixnum (env, 1)); >>=20 >> When I trace the 'funcall' (in eval.c DEFUN funcall), it hits this code: >>=20 >> fun =3D original_fun; >> if (SYMBOLP (fun) && !NILP (fun) >> && (fun =3D XSYMBOL (fun)->function, SYMBOLP (fun))) >> fun =3D indirect_function (fun); >>=20 >> and sets fun to 0, which then signals a failure. >>=20 >> Is this because 'goto-char' is implemented in C? > > That's odd. Why would it matter? For me, (symbol-function 'goto-char) is > a subr, so the second SYMBOLP above should fail and `fun' should be a > subr object, not nil. Never mind; I found the problem. Due to a cut-and-paste error, I spelled "goto-char" as "goto_char". And since intern-soft is not currently in emacs_module.h, I used intern, which of course returned a non-function symbol instead of an error. All better now. Sorry for the noise. I will have a list of suggestions to add to emacs_module.h once I get this working. --=20 -- Stephe