From 59370b6a83672b1f5fc59b7d4224b3f8a80bdbbc Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Tue, 11 Aug 2009 07:51:12 +0200 Subject: [PATCH] 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. --- lisp/ChangeLog | 5 +++++ lisp/org-latex.el | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5189a473d..ad7e187be 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2009-08-11 Carsten Dominik + + * org-latex.el (org-export-latex-tables): Remove save-excursion + around `org-table-align'. + 2009-08-10 Carsten Dominik * org.el (org-export-html-special-string-regexps): Definition diff --git a/lisp/org-latex.el b/lisp/org-latex.el index f922d6f38..92d1084b7 100644 --- a/lisp/org-latex.el +++ b/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))