unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Lennart Borgman <lennart.borgman@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Emacs-Devel devel <emacs-devel@gnu.org>
Subject: Re: Does not byte-compile return the compiled function in Emacs 24?
Date: Fri, 9 Dec 2011 03:12:15 +0100	[thread overview]
Message-ID: <CANbX367HbSszSFr0CHSFbJT12EGGroSzUa1UTJtWp+q-bMi6Xg@mail.gmail.com> (raw)
In-Reply-To: <CANbX3675LnNFCy=peOKiU1BfjFHAQTiD-WV0J-e192wCHmN5+A@mail.gmail.com>

On Wed, Dec 7, 2011 at 17:34, Lennart Borgman <lennart.borgman@gmail.com> 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	other threads:[~2011-12-09  2:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-07  0:38 Does not byte-compile return the compiled function in Emacs 24? Lennart Borgman
2011-12-07  0:51 ` Juanma Barranquero
2011-12-07  4:24   ` Kevin Rodgers
2011-12-07  4:38     ` Lennart Borgman
2011-12-07  4:53       ` Kevin Rodgers
2011-12-07  1:36 ` Stefan Monnier
2011-12-07  1:54   ` Lennart Borgman
2011-12-07  9:12     ` Andreas Schwab
2011-12-07 15:12     ` Stefan Monnier
2011-12-07 16:34       ` Lennart Borgman
2011-12-09  2:12         ` Lennart Borgman [this message]
2011-12-09  2:57           ` Stefan Monnier
2011-12-07 22:34   ` Johan Bockgård
2011-12-08 14:56     ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANbX367HbSszSFr0CHSFbJT12EGGroSzUa1UTJtWp+q-bMi6Xg@mail.gmail.com \
    --to=lennart.borgman@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).