Ancestors

Toot

Written by mms :runbsd: + :emacs: :vim: on 2025-01-23 at 20:47

Does anyone have any idea how to force #emacs #org to extract all properties (including inherited) of a given header into a string?

Also, how to query to a given header based on id? :-)

I want an external process to call emacs and and get those properties in stdout / file in a given location.

=> More informations about this toot | More toots from mms@bsd.cafe

Descendants

Written by Carlo Zancanaro on 2025-01-23 at 21:29

@mms

Get properties as a string (of JSON, in this case): (json-encode (org-entry-properties))

EDIT: apparently this doesn't honour inheritance. I tested with CATEGORY but it's special cased. Sorry for the noise!

I don't understand what you mean by "query a given header by id", but I assume (org-id-goto ID) could help?

=> More informations about this toot | More toots from carlozancanaro@aus.social

Written by Pavel Korytov :emacs:☮️ on 2025-01-23 at 21:41

@mms Would that do?

(defun my/list-properties-inherit ()

(seq-filter

#'cdr

(mapcar

(lambda (p) (cons p (org-entry-get (point) p t)))

(org-buffer-property-keys))))

Unfortunately, org-entry-properties' doesn't respect org-use-property-inheritance', but `org-entry-get' does if the third parameter is t.

As for querying a header, (org-find-property "ID" ) is an option (value is a string). But you'll probably need Adam Porter's `org-ql' for anything more advanced.

=> More informations about this toot | More toots from sqrtminusone@bsd.cafe

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113879630657761475
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
256.697734 milliseconds
Gemini-to-HTML Time
0.587115 milliseconds

This content has been proxied by September (ba2dc).