0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-29 22:07:49 +00:00

org-clean-before-export matches non-special columns spuriously

* org-table.el (org-table-clean-before-export): The regexes match
  spaces in addition to the special characters that might be used in
  the first column as special marking characters.  Remove the space
  from the character class.

  In addition, the `special' variable included a backslash which
  afaict does nothing: delete it.

  The function itself takes an optional parameter which is not used by
  any of the callers: get rid of it.  Getting rid of it allows a small
  simplification of the code.

The bug was found by Thorsten Grothe:

    http://thread.gmane.org/gmane.emacs.orgmode/88634
This commit is contained in:
Nick Dokos 2014-07-18 09:09:38 -04:00
parent a5beff869f
commit 79873390ed

View file

@ -436,15 +436,11 @@ available parameters."
"[ \t]*|[ \t]*"))))))) "[ \t]*|[ \t]*")))))))
(defvar org-table-clean-did-remove-column nil) ; dynamically scoped (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. "Check if the table has a marking column.
If yes remove the column and the special lines." If yes remove the column and the special lines."
(let ((special (if maybe-quoted (let ((special "^[ \t]*| *[#!$*_^/] *|")
"^[ \t]*| *\\\\?[\#!$*_^/ ] *|" (ignore "^[ \t]*| *[!$_^/] *|"))
"^[ \t]*| *[\#!$*_^/ ] *|"))
(ignore (if maybe-quoted
"^[ \t]*| *\\\\?[!$_^/] *|"
"^[ \t]*| *[!$_^/] *|")))
(setq org-table-clean-did-remove-column (setq org-table-clean-did-remove-column
(not (memq nil (not (memq nil
(mapcar (mapcar