瀏覽代碼

Merge branch 'maint'

Nicolas Goaziou 11 年之前
父節點
當前提交
ce72d251f7
共有 1 個文件被更改,包括 4 次插入5 次删除
  1. 4 5
      lisp/org-element.el

+ 4 - 5
lisp/org-element.el

@@ -789,6 +789,8 @@ The plist also contains any property set in the property drawer,
 with its name in upper cases and colons added at the
 with its name in upper cases and colons added at the
 beginning (e.g., `:CUSTOM_ID').
 beginning (e.g., `:CUSTOM_ID').
 
 
+LIMIT is a buffer position bounding the search.
+
 When RAW-SECONDARY-P is non-nil, headline's title will not be
 When RAW-SECONDARY-P is non-nil, headline's title will not be
 parsed as a secondary string, but as a plain string instead.
 parsed as a secondary string, but as a plain string instead.
 
 
@@ -841,7 +843,7 @@ Assume point is at beginning of the headline."
 			    (t (setq plist (plist-put plist :closed time))))))
 			    (t (setq plist (plist-put plist :closed time))))))
 		  plist))))
 		  plist))))
 	   (begin (point))
 	   (begin (point))
-	   (end (save-excursion (goto-char (org-end-of-subtree t t))))
+	   (end (min (save-excursion (org-end-of-subtree t t)) limit))
 	   (pos-after-head (progn (forward-line) (point)))
 	   (pos-after-head (progn (forward-line) (point)))
 	   (contents-begin (save-excursion
 	   (contents-begin (save-excursion
 			     (skip-chars-forward " \r\t\n" end)
 			     (skip-chars-forward " \r\t\n" end)
@@ -878,10 +880,7 @@ Assume point is at beginning of the headline."
 			  :todo-keyword todo
 			  :todo-keyword todo
 			  :todo-type todo-type
 			  :todo-type todo-type
 			  :post-blank (count-lines
 			  :post-blank (count-lines
-				       (if (not contents-end) pos-after-head
-					 (goto-char contents-end)
-					 (forward-line)
-					 (point))
+				       (or contents-end pos-after-head)
 				       end)
 				       end)
 			  :footnote-section-p footnote-section-p
 			  :footnote-section-p footnote-section-p
 			  :archivedp archivedp
 			  :archivedp archivedp