Sfoglia il codice sorgente

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 15 anni fa
parent
commit
8160044f2e
3 ha cambiato i file con 8 aggiunte e 4 eliminazioni
  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>
 
+	* 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-show-subtree): Use org-end-of-subtree.
 
 	* 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))
 		   hfmt))
 	       lines ""))
-    ;; Replace the old one
-    (delete-region beg end)
-    (move-marker end nil)
     (if (equal (char-before) ?\n)
 	;; This hack is for org-indent, to force redisplay of the
 	;; line prefix of the first line. Apparently the redisplay
@@ -734,6 +731,9 @@ When nil, simply write \"#ERROR\" in corrupted fields.")
 	  (insert "\n")))
     (move-marker org-table-aligned-begin-marker (point))
     (insert new)
+    ;; Replace the old one
+    (delete-region (point) end)
+    (move-marker end nil)
     (move-marker org-table-aligned-end-marker (point))
     (when (and orgtbl-mode (not (org-mode-p)))
       (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
    (point)
    (save-excursion
-     (outline-end-of-subtree) (outline-next-heading) (point))
+     (org-end-of-subtree t t))
    nil))
 
 (defun org-show-entry ()