org-element: Fix infloop when an heading is the first line of a buffer

* contrib/lisp/org-element.el (org-element-section-parser): Fix
  infloop when an heading is the first line of a buffer.
This commit is contained in:
Nicolas Goaziou 2012-01-08 20:38:28 +01:00
parent bb39f7ea20
commit 27f3a7cb05
1 changed files with 1 additions and 1 deletions

View File

@ -736,7 +736,7 @@ and `:post-blank' keywords."
;; line after previous headline.
(let ((begin (save-excursion
(org-with-limited-levels (outline-previous-heading))
(if (bobp) (point)
(if (not (org-at-heading-p)) (point)
(forward-line) (org-skip-whitespace) (point-at-bol))))
(end (progn (org-with-limited-levels (outline-next-heading))
(point)))