From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: orgtbl export to latex :fmt() fails Date: Fri, 18 Jul 2014 00:11:37 -0400 Message-ID: <87pph3qpae.fsf@gmail.com> References: <20140717214645.78f5b484@rudi> <87oawn4rmm.fsf@alphaville.bos.redhat.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35274) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7zWc-000097-A1 for emacs-orgmode@gnu.org; Fri, 18 Jul 2014 00:12:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X7zWU-0001jN-Ps for emacs-orgmode@gnu.org; Fri, 18 Jul 2014 00:12:02 -0400 Received: from plane.gmane.org ([80.91.229.3]:57317) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7zWU-0001jF-J8 for emacs-orgmode@gnu.org; Fri, 18 Jul 2014 00:11:54 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1X7zWT-0005Mm-0n for emacs-orgmode@gnu.org; Fri, 18 Jul 2014 06:11:53 +0200 Received: from pool-98-110-160-12.bstnma.fios.verizon.net ([98.110.160.12]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 18 Jul 2014 06:11:53 +0200 Received: from ndokos by pool-98-110-160-12.bstnma.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 18 Jul 2014 06:11:53 +0200 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 Nick Dokos writes: > Nothing - there is a bug in org-table.el:org-table-clean-before-export > where the regexp that matches special chars in the first column (see > > (info "(org)Advanced features") > > for the details) inadvertently matches "| | | | 3900|" and deletes the > first column. The regexp is set like this: > > (let ((special (if maybe-quoted > "^[ \t]*| *\\\\?[\#!$*_^/ ] *|" > "^[ \t]*| *[\#!$*_^/ ] *|")) > > Checking the list of special chars in the Advanced Features section above, I see #!$*_^/ only - I'm not sure what the \ is doing in the [...] character class. I propose getting rid of it as well as the space. Also, org-table-clean-before-export is called from two places in org-table.el, neither of which uses the maybe-quoted argument[fn:1], so I propose getting rid of it and the if clauses as well. Like this: --8<---------------cut here---------------start------------->8--- diff --git a/lisp/org-table.el b/lisp/org-table.el index 6d649ab..bfe396e 100644 --- a/lisp/org-table.el +++ b/lisp/org-table.el @@ -436,15 +436,11 @@ available parameters." "[ \t]*|[ \t]*"))))))) (defvar org-table-clean-did-remove-column nil) ; dynamically scoped -(defun org-table-clean-before-export (lines &optional maybe-quoted) +(defun org-table-clean-before-export (lines) "Check if the table has a marking column. If yes remove the column and the special lines." - (let ((special (if maybe-quoted - "^[ \t]*| *\\\\?[\#!$*_^/ ] *|" - "^[ \t]*| *[\#!$*_^/ ] *|")) - (ignore (if maybe-quoted - "^[ \t]*| *\\\\?[!$_^/] *|" - "^[ \t]*| *[!$_^/] *|"))) + (let ((special "^[ \t]*| *[#!$*_^/] *|") + (ignore "^[ \t]*| *[!$_^/] *|")) (setq org-table-clean-did-remove-column (not (memq nil (mapcar --8<---------------cut here---------------end--------------->8--- Any objections? Footnotes: [fn:1] I checked contrib as well and nobody uses it there either. Although it's possible that somebody uses it out in the wild, I think it's very unlikely. But if you do use it, let me know. Thanks, -- Nick