Parcourir la 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 il y a 15 ans
Parent
commit
8160044f2e
3 fichiers modifiés avec 8 ajouts et 4 suppressions
  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 ()