org-ml icon indicating copy to clipboard operation
org-ml copied to clipboard

How to expand deferred properties?

Open ndw opened this issue 4 months ago • 2 comments

Hello,

I apologize that this is perhaps not an actual org-ml question, but I'm hoping that the answer is obvious to you. Consider a case where point is on this headline:

* First level heading
  :PROPERTIES:
  :CUSTOM_ID: first
  :END:

I run:

(org-ml-parse-element-at (point))

What's returned includes a variety of [org-element-deferred ...] properties. Subsequent attempts to walk over the AST and extract things from it fail because some parts are unresolved.

The documentation in org-element-ast.el suggests that org-element-copy unconditionally resolves deferred properties. I imagined therefore that:

(org-element-copy (org-ml-parse-element-at (point))

Would returnn the nodes with deferred properties resolved. But no. And setting keep-contents to t in org-element-copy doesn't help either.

Is it obvious what I should be doing to expand all the deferred properties?

ndw avatar Sep 01 '25 08:09 ndw

Actually, it appears that (org-element-parse-buffer) doesn't include deferred sections, so perhaps this is an org-ml issue.

ndw avatar Sep 01 '25 11:09 ndw

How are you trying to access the properties? This works:

(org-ml-get-property :raw-value (org-ml-parse-element-at (point)))
;; "First level heading"

org-element-property does the same thing.

ndwarshuis avatar Sep 07 '25 18:09 ndwarshuis