[Top][All Lists]

[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: Stefan Monnier
Subject: Re: Does not byte-compile return the compiled function in Emacs 24?
Date: Wed, 07 Dec 2011 10:12:57 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux)

>>> It used to do that before. Is there any variable holding the newly
>>> byte-compiled function?
>> Don't know.  `byte-compile' does various things in various circumstances
>> (it's pretty DWIMish), so without more details I can't help you.
> 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, ...

> Previously it returned the byte-compiled function, but now it seems to
> return t. (Or, at least it did not when I tested.)

   ELISP> (byte-compile '(lambda (x) (+ x 1)))

> I am using an anonymous function, but I think I can switch to a named
> temporary function instead. I will try that.

If it's a lambda expression, I can't reproduce the problem, as
shown above.
BTW, C-u C-M-x in byte-compile and then single-stepping in this function
should quickly tell you the reason for what you see (unless there's
some defadvice at play, of course).


reply via email to

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