Explorar o código

org-element: Fix infloop in `org-element-at-point'

* lisp/org-element.el (org-element-at-point): Fix infloop when called
  on a blank line at the end of the buffer after a headline.
Nicolas Goaziou %!s(int64=11) %!d(string=hai) anos
pai
achega
072f2abe4c
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      lisp/org-element.el

+ 1 - 1
lisp/org-element.el

@@ -4735,7 +4735,7 @@ first element of current section."
 	    (org-back-to-heading)
 	    (forward-line)
 	    (org-skip-whitespace)
-	    (when (> (line-beginning-position) origin)
+	    (when (or (eobp) (> (line-beginning-position) origin))
 	      ;; In blank lines just after the headline, point still
 	      ;; belongs to the headline.
 	      (throw 'exit