I'm a bit confused about the title property of headlines. It is a secondary-string:
(setq title (org-ml-get-property :title (org-ml-build-headline! :title-text "This is my headline")))
(#("This is my headline" 0 19
(:parent
(paragraph
(:standard-properties
[1 1 1 21 21 0 nil top-comment nil nil nil nil nil nil #<killed
buffer> nil nil
(section
(:standard-properties
[1 1 1 21 21 0 nil first-section nil nil nil 1 21 nil
#<killed buffer> nil nil
(org-data
(:standard-properties
[1 1 1 21 21 0 nil org-data nil nil nil 3 21 nil
#<killed buffer> nil nil nil]
:path nil :CATEGORY nil)
#9)])
#4)])
#(" This is my headline" 0 20 (:parent #4))))))
But I can't convert that back to a string. (I know about :raw-value but it is nil in the above case, and anyway I like to do things "properly".)
(org-ml-get-type title)
nil
(org-ml-to-string title)
Eval error Argument type error: "Can only stringify node or nil, got (This is my headline)"
Is there even a way to tell if something is a secondary-string? Is there a way to properly stringify it, especially when it's actually a list or tree of nodes? The above case is simple, with no formatting, no TODO -- so how to get the proper string value in the general case?
I'm a bit confused about the title property of headlines. It is a secondary-string:
But I can't convert that back to a string. (I know about :raw-value but it is nil in the above case, and anyway I like to do things "properly".)
Is there even a way to tell if something is a secondary-string? Is there a way to properly stringify it, especially when it's actually a list or tree of nodes? The above case is simple, with no formatting, no TODO -- so how to get the proper string value in the general case?