Browse Source

Merge branch 'maint'

Nicolas Goaziou 4 years ago
parent
commit
acb00702d5
2 changed files with 7 additions and 2 deletions
  1. 1 1
      lisp/org-element.el
  2. 6 1
      testing/lisp/test-org-element.el

+ 1 - 1
lisp/org-element.el

@@ -3900,7 +3900,7 @@ element it has to parse."
 	    (cond
 	     ;; Jumping over affiliated keywords put point off-limits.
 	     ;; Parse them as regular keywords.
-	     ((>= (point) limit)
+	     ((and (cdr affiliated) (>= (point) limit))
 	      (goto-char (car affiliated))
 	      (org-element-keyword-parser limit nil))
 	     ;; LaTeX Environment.

+ 6 - 1
testing/lisp/test-org-element.el

@@ -2848,7 +2848,12 @@ Paragraph \\alpha."
 	   "- outer\n  #+begin_center\n  - inner\n  #+end_center"
 	 (search-forward "inner")
 	 (beginning-of-line)
-	 (org-element-type (org-element-at-point))))))
+	 (org-element-type (org-element-at-point)))))
+  ;; Do not error at eob on an empty line.
+  (should
+   (org-test-with-temp-text "* H\n"
+     (forward-line)
+     (or (org-element-at-point) t))))
 
 (ert-deftest test-org-element/context ()
   "Test `org-element-context' specifications."