From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fabrice Popineau Subject: Re: ox-html, top-row-p Date: Sun, 13 Dec 2015 10:31:00 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e013c62141a28760526c438ab Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54823) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a82zy-0003tH-79 for emacs-orgmode@gnu.org; Sun, 13 Dec 2015 04:31:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a82zx-0000K1-1I for emacs-orgmode@gnu.org; Sun, 13 Dec 2015 04:31:22 -0500 Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]:36412) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a82zw-0000Ix-PM for emacs-orgmode@gnu.org; Sun, 13 Dec 2015 04:31:20 -0500 Received: by mail-wm0-x22b.google.com with SMTP id n186so82317664wmn.1 for ; Sun, 13 Dec 2015 01:31:20 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "emacs-orgmode@gnu.org" --089e013c62141a28760526c438ab Content-Type: text/plain; charset=UTF-8 Hi, So the problem is due to lexical binding (I am using emacs 25 devel branch). The following variables can't be dynamically bound anymore in ox-html: row-number, rowgroup-number, start-rowgroup-p, end-rowgroup-p, top-row-p, bottom-row-p . There are 2 options : - declare them with defvar - pass them to eval as an environment. Here is a patch for the second option, but I wonder if the first one wouldn't be better. diff --git a/vendor/org-mode/lisp/ox-html.el b/vendor/org-mode/lisp/ox-html.el index 6affac4..4e56ab3 100644 --- a/vendor/org-mode/lisp/ox-html.el +++ b/vendor/org-mode/lisp/ox-html.el @@ -3336,10 +3336,22 @@ communication channel." ;; Begin a rowgroup? (when start-rowgroup-p (car rowgroup-tags)) ;; Actual table row. - (concat "\n" (eval (car (plist-get info :html-table-row-tags)) t) + (concat "\n" (eval (car (plist-get info :html-table-row-tags)) + `((row-number . ,row-number) + (rowgroup-number . ,rowgroup-number) + (start-rowgroup-p . ,start-rowgroup-p) + (end-rowgroup-p . , end-rowgroup-p) + (top-row-p . ,top-row-p) + (bottom-row-p . ,bottom-row-p))) contents "\n" - (eval (cdr (plist-get info :html-table-row-tags)) t)) + (eval (cdr (plist-get info :html-table-row-tags)) + `((row-number . ,row-number) + (rowgroup-number . ,rowgroup-number) + (start-rowgroup-p . ,start-rowgroup-p) + (end-rowgroup-p . , end-rowgroup-p) + (top-row-p . ,top-row-p) + (bottom-row-p . ,bottom-row-p)))) ;; End a rowgroup? (when end-rowgroup-p (cdr rowgroup-tags)))))) Best regards, Fabrice 2015-12-13 0:36 GMT+01:00 Fabrice Popineau : > Hi, > > I get an error in ox-html.el with the latest org-mode when exporting > tables to html : > > Debugger entered--Lisp error: (void-variable top-row-p) > (cond (top-row-p "") (bottom-row-p " class=\"tr-bottom\">") (t (if (= (mod row-number 2) 1) " class=\"tr-odd\">" ""))) > eval((cond (top-row-p "") (bottom-row-p " class=\"tr-bottom\">") (t (if (= (mod row-number 2) 1) " class=\"tr-odd\">" ""))) t) > org-html-table-row((table-row (:type standard :begin 1784 :end 1898 > :contents-begin 1785 :contents-end 1897 :post-blank 0 :post-affiliated 1784 > :parent ...)) > > Can anybody confirm or is something wrong on my side ? > > Greetings, > > Fabrice > --089e013c62141a28760526c438ab Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,

So the problem is due to lexical bi= nding (I am using emacs 25 devel branch).
The following variables= can't be dynamically bound anymore in ox-html:
row-numb= er,=C2=A0rowgroup-number,=C2=A0start-rowgroup-p,=C2=A0end-rowgroup-p,=C2=A0= top-row-p,=C2=A0bottom-row-p .
There are 2 options :
<= div>- declare them with defvar
- pass them to eval as an environm= ent.
Here is a patch for the second option, but I wonder if the f= irst one wouldn't be better.

diff --git a= /vendor/org-mode/lisp/ox-html.el b/vendor/org-mode/lisp/ox-html.el
index 6affac4..4e56ab3 100644
--- a/vendor/org-mode/lisp/ox-htm= l.el
+++ b/vendor/org-mode/lisp/ox-html.el
@@ -3336,10 = +3336,22 @@ communication channel."
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 ;; Begin a rowgroup?
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (when start-= rowgroup-p (car rowgroup-tags))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; Ac= tual table row.
- =C2=A0 =C2=A0 =C2=A0 (concat "\n" (ev= al (car (plist-get info :html-table-row-tags)) t)
+ =C2=A0 =C2=A0= =C2=A0 (concat "\n" (eval (car (plist-get info :html-table-row-t= ags))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 `((row-number . ,row-number)
+ =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 (rowgroup-number . ,rowgroup-number)
+ =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 (start-rowgroup-p . ,start-rowgroup-p)
+ =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 (end= -rowgroup-p . , end-rowgroup-p)
+ =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 (top-row-p . ,t= op-row-p)
+ =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 (bottom-row-p . ,bottom-row-p)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0contents
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"\n"=
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(eval (cdr (pl= ist-get info :html-table-row-tags)) t))
+ =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0(eval (cdr (plist-get info :html-table-row-tags)= )
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0`((row-number . ,row-number)
+ =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(rowgroup-number . ,row= group-number)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0(start-rowgroup-p . ,start-rowgroup-p)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0(end-rowgroup-p . , end-rowgroup-p)
+ =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(top-row-p . ,top-ro= w-p)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0(bottom-row-p . ,bottom-row-p))))
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 ;; End a rowgroup?
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = (when end-rowgroup-p (cdr rowgroup-tags))))))

Best regards,

Fabrice

2015-12-13 0:36 GMT+01:00 Fabric= e Popineau <fabrice.popineau@gmail.com>:
Hi,

I get an er= ror in ox-html.el with the latest org-mode when exporting tables to html :<= /div>

Debugger entered--Lisp error: (void-variable = top-row-p)
=C2=A0 (cond (top-row-p "<tr class=3D\"tr= -top\">") (bottom-row-p "<tr class=3D\"tr-bottom\= ">") (t (if (=3D (mod row-number 2) 1) "<tr class=3D\&= quot;tr-odd\">" "<tr class=3D\"tr-even\">= ")))
=C2=A0 eval((cond (top-row-p "<tr class=3D\&quo= t;tr-top\">") (bottom-row-p "<tr class=3D\"tr-bot= tom\">") (t (if (=3D (mod row-number 2) 1) "<tr class= =3D\"tr-odd\">" "<tr class=3D\"tr-even\"= ;>"))) t)
=C2=A0 org-html-table-row((table-row (:type sta= ndard :begin 1784 :end 1898 :contents-begin 1785 :contents-end 1897 :post-b= lank 0 :post-affiliated 1784 :parent ...))

C= an anybody confirm or is something wrong on my side ?

<= div>Greetings,

Fabrice

--089e013c62141a28760526c438ab--