org-element: Fix "wrong-type-argument" error in cache

* lisp/org-element.el (org-element--cache-sync): Do not copy phase
  number into next request.  This is a special case that deserves to
  be handled locally.  See below.
(org-element--cache-process-request): Properly transfer phase in
a special case, which is now commented.  Also fix phase numbers in
comments.  Small refactoring.

Thanks to Alan Schmitt for reporting it.
http://permalink.gmane.org/gmane.emacs.orgmode/88406
org-element: Fix corner case in cache synchronization

* lisp/org-element.el (org-element--cache-submit-request): When
  changes happen before first know element, start from phase 1 instead
  of phase 2 in order to properly re-parent subsequent elements, if
  needed.
(org-element--cache-process-request): Do not propagate beginning
position since it is already available to the request.
org-element: Fix re-parenting during cache synchronization

* lisp/org-element.el (org-element--cache-process-request): Correctly
  re-parent elements in cache in some corner cases.
* testing/lisp/test-org-element.el (test-org-element/cache): Add tests.
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
Merge branch 'maint'

Merge bug fix for org-table.el:org-table-clean-before-export.
org-element: Better collision handling in cache sync requests

* lisp/org-element.el (org-element--cache-process-request): Handle
  cases where procesing the first request brings us past the start of
  the next one.
org-element: Fix infloop in cache

* lisp/org-element.el (org-element--cache-process-request): Take into
  consideration changes to come so as to avoid parsing elements with
  false beginning positions.
(org-element--cache-sync): Change signature.

Thanks to Thorsten Jolitz for reporting it.
http://permalink.gmane.org/gmane.emacs.orgmode/88673
org-element: Small optimization

* lisp/org-element.el (org-element--cache-for-removal): Do not remove
a robust element whenever only its contents are modified.  Remove
inlinetasks as robust elements since modifying a node property inside
implies to parse the task again.
org-element: Fix regexp matching LaTeX environments

* lisp/org-element.el (org-element--current-element): Fix regexp
  matching latex environments.  Discrepancy with regexp used in
  `org-element-latex-environment-parser' introduced matching errors.
Merge branch 'maint'
org-element: Fix test failure

* lisp/org-element.el (org-element--current-element): Fix regexp.
Merge branch 'maint'
org-element.el: Allow one-line LaTeX environments

* org-element.el (org-element--latex-begin-environment,
org-element--latex-end-environment): New format strings to identify
beginning and ending of LaTeX environments.
(org-element-latex-environment-parser, org-element-paragraph-parser,
org-element--current-element): Use `org-element--latex-begin-environment'
and `org-element--latex-end-environment'.

* test-org-element.el (test-org-element/latex-environment-parser):
Add tests.
When editing a table formula, point is not necessarily on its referent.

* org-table.el (org-table-show-reference): Call `set-window-start'
  with the calculated values `min' and `max', not with
  (point-min) and (point-max).

Reported by Luke Crook (http://article.gmane.org/gmane.emacs.orgmode/88610)
	    Thorsten Grothe (http://thread.gmane.org/gmane.emacs.orgmode/88698)
	    and Robert Klein in the latter thread.

Robert Klein bisected it down to 30220ffcdcef45c0237f80a2347d4da19877f64a.
Merge branch 'maint'
ox-odt: Fix handling of quoted and centered paragraphs

* lisp/ox-odt.el (org-odt--paragraph-style): New function.
(org-odt--format-paragraph): Use new function to get proper style to
apply.

Thanks to Baptiste for reporting it.
http://permalink.gmane.org/gmane.emacs.orgmode/88798
Merge branch 'maint'
org-clock: Update syntax for indentation in clock tables

* lisp/org-clock.el (org-clocktable-indent-string): Use "\emsp"
  instead of "\__", which is not supported anymore since Org 8.0.

Thanks to Buddy Butterfly for reporting it.
http://permalink.gmane.org/gmane.emacs.orgmode/88842
Merge branch 'maint'
ox-odt: Silence byte-compiler

* lisp/ox-odt.el (org-odt--format-paragraph): Change signature to
  include info.
(org-odt-footnote-reference, org-odt-paragraph): Apply signature
change.