emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] orgtbl export to latex :fmt() fails


From: Nick Dokos
Subject: Re: [O] orgtbl export to latex :fmt() fails
Date: Fri, 18 Jul 2014 00:11:37 -0400
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.3.50 (gnu/linux)

Nick Dokos <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]