Browse Source

org-element: Fix cache error on empty drawers

* lisp/org-element.el (org-element--cache-for-removal): Handle case
  when greater element is totally empty.

Thanks to Malcolm Purvis for reporting it.
http://permalink.gmane.org/gmane.emacs.orgmode/90639
Nicolas Goaziou 10 years ago
parent
commit
6eb9827d53
1 changed files with 4 additions and 2 deletions
  1. 4 2
      lisp/org-element.el

+ 4 - 2
lisp/org-element.el

@@ -5492,8 +5492,10 @@ changes."
 	  (if (and (memq (org-element-type up)
 			 '(center-block drawer dynamic-block
 					quote-block special-block))
-		   (<= (org-element-property :contents-begin up) beg)
-		   (> (org-element-property :contents-end up) end))
+		   (let ((cbeg (org-element-property :contents-begin up)))
+		     (and cbeg
+			  (<= cbeg beg)
+			  (> (org-element-property :contents-end up) end))))
 	      ;; UP is a robust greater element containing changes.
 	      ;; We only need to extend its ending boundaries.
 	      (org-element--cache-shift-positions