0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-08-27 18:02:51 +00:00

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

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)))