Browse Source

Avoid problems with table alignment an overlays.

We now first insert a new aligned table, and then remove to old one,
this helps to keep overlays after the table from covering table text
as well.
Carsten Dominik 16 years ago
parent
commit
8160044f2e
3 changed files with 8 additions and 4 deletions
  1. 4 0
      lisp/ChangeLog
  2. 3 3
      lisp/org-table.el
  3. 1 1
      lisp/org.el

+ 4 - 0
lisp/ChangeLog

@@ -1,6 +1,10 @@
 2009-08-27  Carsten Dominik  <carsten.dominik@gmail.com>
 2009-08-27  Carsten Dominik  <carsten.dominik@gmail.com>
 
 
+	* org-table.el (org-table-align): Change the order of reinsertion
+	and deletion, to avoid problems with overlays following the table.
+
 	* org.el (org-parse-time-string): Better error message.
 	* org.el (org-parse-time-string): Better error message.
+	(org-show-subtree): Use org-end-of-subtree.
 
 
 	* org-macs.el (org-goto-line): New defsubst.
 	* org-macs.el (org-goto-line): New defsubst.
 
 

+ 3 - 3
lisp/org-table.el

@@ -719,9 +719,6 @@ When nil, simply write \"#ERROR\" in corrupted fields.")
 			      (append (pop fields) emptystrings))
 			      (append (pop fields) emptystrings))
 		   hfmt))
 		   hfmt))
 	       lines ""))
 	       lines ""))
-    ;; Replace the old one
-    (delete-region beg end)
-    (move-marker end nil)
     (if (equal (char-before) ?\n)
     (if (equal (char-before) ?\n)
 	;; This hack is for org-indent, to force redisplay of the
 	;; This hack is for org-indent, to force redisplay of the
 	;; line prefix of the first line. Apparently the redisplay
 	;; line prefix of the first line. Apparently the redisplay
@@ -734,6 +731,9 @@ When nil, simply write \"#ERROR\" in corrupted fields.")
 	  (insert "\n")))
 	  (insert "\n")))
     (move-marker org-table-aligned-begin-marker (point))
     (move-marker org-table-aligned-begin-marker (point))
     (insert new)
     (insert new)
+    ;; Replace the old one
+    (delete-region (point) end)
+    (move-marker end nil)
     (move-marker org-table-aligned-end-marker (point))
     (move-marker org-table-aligned-end-marker (point))
     (when (and orgtbl-mode (not (org-mode-p)))
     (when (and orgtbl-mode (not (org-mode-p)))
       (goto-char org-table-aligned-begin-marker)
       (goto-char org-table-aligned-begin-marker)

+ 1 - 1
lisp/org.el

@@ -16796,7 +16796,7 @@ Stop at the first and last subheadings of a superior heading."
   (outline-flag-region
   (outline-flag-region
    (point)
    (point)
    (save-excursion
    (save-excursion
-     (outline-end-of-subtree) (outline-next-heading) (point))
+     (org-end-of-subtree t t))
    nil))
    nil))
 
 
 (defun org-show-entry ()
 (defun org-show-entry ()