From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: orgtbl export to latex :fmt() fails Date: Sat, 19 Jul 2014 00:09:25 -0400 Message-ID: <877g3aq9ai.fsf@gmail.com> References: <20140717214645.78f5b484@rudi> <87oawn4rmm.fsf@alphaville.bos.redhat.com> <87pph3qpae.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34753) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X8Ly1-00020a-20 for emacs-orgmode@gnu.org; Sat, 19 Jul 2014 00:09:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X8Lxt-0003R8-Gj for emacs-orgmode@gnu.org; Sat, 19 Jul 2014 00:09:48 -0400 Received: from plane.gmane.org ([80.91.229.3]:57232) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X8Lxt-0003R3-A9 for emacs-orgmode@gnu.org; Sat, 19 Jul 2014 00:09:41 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1X8Lxs-0004ES-A1 for emacs-orgmode@gnu.org; Sat, 19 Jul 2014 06:09:40 +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 ; Sat, 19 Jul 2014 06:09:40 +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 ; Sat, 19 Jul 2014 06:09:40 +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: > 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: > > 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 > > 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, I pushed this to maint and merged it into master. -- Nick