Browse Source

LaTeX export: Remove bug in table export.

A `save-excursion' around a call to org-table-align make point end up
*before* the table.  The reason is that a table align replaces the
entire table, including the newline before it.  When the table is
removed in order to be replaced, the marker created by
`save-excursion' slips.  `org-table-align' has it's own, built-in
`save-excursion' by remembering the line and column where the cursor
was before the align.
Carsten Dominik 15 years ago
parent
commit
59370b6a83
2 changed files with 6 additions and 2 deletions
  1. 5 0
      lisp/ChangeLog
  2. 1 2
      lisp/org-latex.el

+ 5 - 0
lisp/ChangeLog

@@ -1,3 +1,8 @@
+2009-08-11  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-latex.el (org-export-latex-tables): Remove save-excursion
+	around `org-table-align'.
+
 2009-08-10  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org.el (org-export-html-special-string-regexps): Definition

+ 1 - 2
lisp/org-latex.el

@@ -1309,8 +1309,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
   "Convert tables to LaTeX and INSERT it."
   (goto-char (point-min))
   (while (re-search-forward "^\\([ \t]*\\)|" nil t)
-    ;; FIXME really need to save-excursion?
-    (save-excursion (org-table-align))
+    (org-table-align)
     (let* ((beg (org-table-begin))
 	   (end (org-table-end))
 	   (raw-table (buffer-substring beg end))