summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2014-06-30 23:33:20 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2014-06-30 23:47:37 +0200
commit126e2bcebda6d45d0047f89209339c6721b458d8 (patch)
tree3bfefc5ef580964c57008b8aab9d92903b5945dd
parentef8e9cf045f48bc7063d0566befe6188f9a1f4d1 (diff)
downloadorg-mode-126e2bcebda6d45d0047f89209339c6721b458d8.tar.gz
org-element: Fix corner case
* lisp/org-element.el (org-element--cache-for-removal): Fix corner case when changes happen in a robust element (e.g., a center block) within a fragile element (e.g., a plain list). Do not assume that all parents from a robust element are also robust.
-rw-r--r--lisp/org-element.el9
1 files changed, 3 insertions, 6 deletions
diff --git a/lisp/org-element.el b/lisp/org-element.el
index 4c3a5bf..c67035d 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -5456,12 +5456,9 @@ changes."
(<= (org-element-property :contents-begin up) beg)
(> (org-element-property :contents-end up) end))
;; UP is a robust greater element containing changes.
- ;; We only need to extend its ending boundaries and
- ;; those of all its parents.
- (while up
- (org-element--cache-shift-positions
- up offset '(:contents-end :end))
- (setq up (org-element-property :parent up)))
+ ;; We only need to extend its ending boundaries.
+ (org-element--cache-shift-positions
+ up offset '(:contents-end :end))
(setq before up)))
;; We're at top level element containing ELEMENT: if it's
;; altered by buffer modifications, it is first element in