emacs-devel
[Top][All Lists]
Advanced

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

Re: Dynamic loading progress; funcall of goto-char fails


From: Stephen Leake
Subject: Re: Dynamic loading progress; funcall of goto-char fails
Date: Wed, 06 May 2015 03:15:14 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (windows-nt)

Daniel Colascione <address@hidden> writes:

> On 05/05/2015 09:11 PM, Stephen Leake wrote:
>> Stephen Leake <address@hidden> writes:
>> 
>>> Aurélien Aptel <address@hidden> 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.
>> 
>> I've made more progress; I've got a module that should run the full Ada
>> parser on a buffer.
>> 
>> However, when I run it, it crashes on a call like:
>> 
>> emacs_value goto_char_sym = env.intern (env, "goto-char");
>> env.funcall (env, goto_char_sym, env.make_fixnum (env, 1));
>> 
>> When I trace the 'funcall' (in eval.c DEFUN funcall), it hits this code:
>> 
>>   fun = original_fun;
>>   if (SYMBOLP (fun) && !NILP (fun)
>>       && (fun = XSYMBOL (fun)->function, SYMBOLP (fun)))
>>     fun = indirect_function (fun);
>> 
>> and sets fun to 0, which then signals a failure.
>> 
>> 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.

-- 
-- Stephe



reply via email to

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