diff --git a/lisp/org-element.el b/lisp/org-element.el index a8e42af85..b99b68fe7 100644 --- a/lisp/org-element.el +++ b/lisp/org-element.el @@ -7751,7 +7751,7 @@ Providing it allows for quicker computation." (catch 'objects-forbidden (org-with-wide-buffer (let* ((pos (point)) - (element (or element (org-element-at-point-no-context))) + (element (or element (org-element-at-point))) (type (org-element-type element)) (post (org-element-property :post-affiliated element))) ;; If point is inside an element containing objects or diff --git a/testing/lisp/test-org-element.el b/testing/lisp/test-org-element.el index a4c94efe2..d650a4d54 100644 --- a/testing/lisp/test-org-element.el +++ b/testing/lisp/test-org-element.el @@ -3866,7 +3866,7 @@ Text ;; `org-element-at-point' or `org-element-context', the list is ;; limited to the current section. (should - (equal '(paragraph center-block section headline) + (equal '(paragraph center-block section headline headline org-data) (org-test-with-temp-text "* H1\n** H2\n#+BEGIN_CENTER\n*bold*\n#+END_CENTER" (mapcar #'car (org-element-lineage (org-element-context)))))) @@ -3891,7 +3891,7 @@ Text (org-element-lineage (org-element-context) '(example-block)))) ;; Test WITH-SELF optional argument. (should - (equal '(bold paragraph center-block section headline) + (equal '(bold paragraph center-block section headline headline org-data) (org-test-with-temp-text "* H1\n** H2\n#+BEGIN_CENTER\n*bold*\n#+END_CENTER" (mapcar #'car (org-element-lineage (org-element-context) nil t)))))