From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: Does not byte-compile return the compiled function in Emacs 24? Date: Wed, 7 Dec 2011 17:34:02 +0100 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1323275688 20619 80.91.229.12 (7 Dec 2011 16:34:48 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 7 Dec 2011 16:34:48 +0000 (UTC) Cc: Emacs-Devel devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 07 17:34:44 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RYKSB-00015R-Ox for ged-emacs-devel@m.gmane.org; Wed, 07 Dec 2011 17:34:43 +0100 Original-Received: from localhost ([::1]:44296 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RYKSB-0000SX-9i for ged-emacs-devel@m.gmane.org; Wed, 07 Dec 2011 11:34:43 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:55075) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RYKS4-0000SD-6U for emacs-devel@gnu.org; Wed, 07 Dec 2011 11:34:41 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RYKRu-00013X-7t for emacs-devel@gnu.org; Wed, 07 Dec 2011 11:34:36 -0500 Original-Received: from mail-lpp01m010-f41.google.com ([209.85.215.41]:42086) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RYKRt-00013P-RV for emacs-devel@gnu.org; Wed, 07 Dec 2011 11:34:26 -0500 Original-Received: by lahi5 with SMTP id i5so362139lah.0 for ; Wed, 07 Dec 2011 08:34:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=zjAOqNoFBAkn0eBiyrElxbIygioktIYazC0CvvE2Clo=; b=Ipyp0fYbOG0zRn9pbXFQwWU+w2OgowkygLS7WDm1jkVUIU4qGBUF75dEA41xCzjts/ Si7hNnZLl85uFtDLmCmdqU9ta3BCl7WT2/UpPyN42ZPgvl6zCElQb0EVVUZnd5vEWN/D tjqk+bo/nB/Zd7JSFty9TqmnT/HL3+DjBdhfY= Original-Received: by 10.152.132.39 with SMTP id or7mr12102139lab.14.1323275664603; Wed, 07 Dec 2011 08:34:24 -0800 (PST) Original-Received: by 10.152.38.198 with HTTP; Wed, 7 Dec 2011 08:34:02 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.215.41 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:146559 Archived-At: On Wed, Dec 7, 2011 at 16:12, Stefan Monnier wro= te: >>>> It used to do that before. Is there any variable holding the newly >>>> byte-compiled function? >>> Don't know. =C2=A0`byte-compile' does various things in various circums= tances >>> (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: >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq byte-compiled-fun (let ((major-syntax-= table)) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (byte-compile fetch-func-d= efinition))) > > This just tells me you call the function with some value and the get > the result. =C2=A0I.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... ;-) Perhaps someone has an idea of how to catch it? I build the let-list with entries like (list 'font-lock-syntactic-face-function (custom-quote font-lock-syntactic-face-function)) Could this go wrong for some values?