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: Daniel Colascione
Subject: Re: Dynamic loading progress; funcall of goto-char fails
Date: Tue, 05 May 2015 21:21:05 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0

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.

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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