emacs-devel
[Top][All Lists]
Advanced

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

Re: Does not byte-compile return the compiled function in Emacs 24?


From: Lennart Borgman
Subject: Re: Does not byte-compile return the compiled function in Emacs 24?
Date: Fri, 9 Dec 2011 03:12:15 +0100

On Wed, Dec 7, 2011 at 17:34, Lennart Borgman <address@hidden> wrote:
>>> In mumamo.el I am building functions for fontification. I compile them
>>> like this:
>>>         (setq byte-compiled-fun (let ((major-syntax-table))
>>>                                   (byte-compile fetch-func-definition)))
>>
>> This just tells me you call the function with some value and the get
>> the result.  I.e. not much more information.
>> The key is to know what kind of value is passed to byte-compile: is it
>> a symbol, an arbitrary Lisp expression, a lambda expression, ...
>
> It is a lisp expression, but a big one. I am building a function to
> call before fontification. This function let binds relevant variables
> for the fontification.
>
> When testing a bit more I see that (byte-compile (lambda ...)) returns
> the function when everything goes ok, but not when there is an error.
> For the function for php-mode fontification I get an error during byte
> compilation:
>
>  Error: Wrong type argument: number-or-marker-p, nil
>
> So it looks like byte-compile dislikes something in the (lambda ...)
> for php-mode fontification. I just wished I knew what it is... ;-)

I am beginning to think that it is the size of the code for the
(lambda ...) that is the problem. When I delete some lines at least
byte-compile returns the function and I do not get the error above.

The size of the text code is some 230 000 characters (including white
space). The reason that it is so big is probably the syntax tables
copied, like this for example:

    (list 'font-lock-syntax-table (custom-quote font-lock-syntax-table))

Including this in some way was necessary for fontification: ;; See
nXhtml bug 400415

Perhaps I should just make a local copy of the syntax table instead... hm...

That requires a bit of work. There are some more syntax tables too.
Any thoughts or ideas on this?



reply via email to

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