From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Peters Subject: [PATCH] Alignment problem with org-format-org-table-html Date: Tue, 27 Apr 2010 14:39:59 -0400 Message-ID: <4BD72F7F.70607@portnoy.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050107060905070307020809" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O6phb-0005T2-V5 for emacs-orgmode@gnu.org; Tue, 27 Apr 2010 14:40:12 -0400 Received: from [140.186.70.92] (port=46600 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O6pha-0005S9-An for emacs-orgmode@gnu.org; Tue, 27 Apr 2010 14:40:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O6phX-0008B9-TZ for emacs-orgmode@gnu.org; Tue, 27 Apr 2010 14:40:10 -0400 Received: from qmta04.westchester.pa.mail.comcast.net ([76.96.62.40]:44364) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O6phV-00089k-9S for emacs-orgmode@gnu.org; Tue, 27 Apr 2010 14:40:05 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.portnoy.org (Postfix) with ESMTP id 17261108265 for ; Tue, 27 Apr 2010 14:40:01 -0400 (EDT) Received: from mail.portnoy.org ([127.0.0.1]) by localhost (circe.portnoy.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hTO9r1qB9Onz for ; Tue, 27 Apr 2010 14:40:00 -0400 (EDT) Received: from [10.4.13.200] (ita4fw1.itasoftware.com [63.107.91.99]) by mail.portnoy.org (Postfix) with ESMTPSA id 50866108260 for ; Tue, 27 Apr 2010 14:40:00 -0400 (EDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org This is a multi-part message in MIME format. --------------050107060905070307020809 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit When creating a table, I was noticing that the ... provides useful alignment information based on whether or not the column has numbers in it. I think, however, that there is a mistake in this routine. Take, for example, the following table: | Id | Task | Developer | Estimate | Spent | Remaining | Comp.% | Updated | |-----+--------------+-----------+----------+-------+-----------+--------+-----------------| | 1 | Task One | SLP | 1 | 0 | 1 | 0 | SLP, 2010-04-27 | | 2 | Task Two | SLP | 1 | 0 | 1 | 0 | SLP, 2010-04-27 | | 3 | Task Three | SLP | 2 | 0 | 2 | 0 | SLP, 2010-04-27 | | 4 | Task Four | SLP | 2 | 0 | 2 | 0 | SLP, 2010-04-27 | | 5 | Task Five | SLP | .25 | 0 | 0.25 | 0 | SLP, 2010-04-27 | | 5.1 | Another Task | XML team | 0 | 1 | 0 | 0 | SLP, 2010-04-27 | | 6 | Task Six | SLP | .25 | 0 | 0.25 | 0 | SLP, 2010-04-27 | | 6.1 | More Tasks | DB team | 3 | 0 | 3 | 0 | SLP, 2010-04-27 | | 7 | Task Seven | SLP | 3 | 0 | 3 | 0 | SLP, 2010-04-27 | When the colgroup list is created for this table, it reads: Note that the first columns are correct, but the last few are not. It should read right, left, left, right, right, right, right, left. I believe that this is due to the (< i nline) comparison within org-format-org-table-html, which is nonsensical because it's trying to compare a column number with a number of rows. I've attached a patch for the problem. --------------050107060905070307020809 Content-Type: text/plain; name="diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diff" diff --git a/lisp/org-html.el b/lisp/org-html.el index 3ac2b18..0ffde15 100644 --- a/lisp/org-html.el +++ b/lisp/org-html.el @@ -1659,8 +1659,7 @@ lang=\"%s\" xml:lang=\"%s\"> (mapconcat (lambda (x) (setq i (1+ i)) - (if (and (< i nline) - (string-match org-table-number-regexp x)) + (if (string-match org-table-number-regexp x) (incf (aref fnum i))) (cond (head --------------050107060905070307020809 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --------------050107060905070307020809--