浏览代码

Fix table mapping

Carsten Dominik 16 年之前
父节点
当前提交
f22be634d2
共有 2 个文件被更改,包括 7 次插入2 次删除
  1. 3 0
      lisp/ChangeLog
  2. 4 2
      lisp/org.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2009-08-04  Carsten Dominik  <carsten.dominik@gmail.com>
 2009-08-04  Carsten Dominik  <carsten.dominik@gmail.com>
 
 
+	* org.el (org-table-map-tables): Make sure cursor is back at table
+	beginning after funcall.
+
 	* org-agenda.el (org-agenda-bulk-action): Make sure parents are
 	* org-agenda.el (org-agenda-bulk-action): Make sure parents are
 	handled before children, and do not error if an entry is not
 	handled before children, and do not error if an entry is not
 	found, probably because it hase been remove when the parent was
 	found, probably because it hase been remove when the parent was

+ 4 - 2
lisp/org.el

@@ -3028,8 +3028,10 @@ If TABLE-TYPE is non-nil, also check for table.el-type tables."
       (while (re-search-forward org-table-any-line-regexp nil t)
       (while (re-search-forward org-table-any-line-regexp nil t)
 	(message "Mapping tables: %d%%" (/ (* 100.0 (point)) (buffer-size)))
 	(message "Mapping tables: %d%%" (/ (* 100.0 (point)) (buffer-size)))
 	(beginning-of-line 1)
 	(beginning-of-line 1)
-	(if (looking-at org-table-line-regexp)
-	    (save-excursion (funcall function)))
+	(when (looking-at org-table-line-regexp)
+	  (save-excursion (funcall function))
+	  (or (looking-at org-table-line-regexp)
+	      (forward-char 1)))
 	(re-search-forward org-table-any-border-regexp nil 1))))
 	(re-search-forward org-table-any-border-regexp nil 1))))
   (message "Mapping tables: done"))
   (message "Mapping tables: done"))