I have a hash-table and would like to export the hash-tables into an org-buffer. What the hash-table should print out to an org-buffer: take the keys, if the key's value is not a hash then it's ":: " otherwise if the key's value is a hash-table then the key is a heading and so on. Q. 1. I couldn't find if there is an 'import' into the org-buffer implemented already. If there is, can someone point me to it? 2. Has someone written anything similar to this? I can do it (it seems simple enough) but would hate to reinvent the wheel. If there is a library already out there that can take a structure (hash-table) and import it into an org-buffer, that would be awesome.
Thanks.
I have provided an example of the output of what that hash-table should be represented into the org-buffer and the raw hash-table.
* key "project-example"
:id: "12345"
** affected-versions
:id: "12332"
:name: "SlimShady"
:archived: nil
:release-date: "2014-10-01T04:00:00.000Z"
:released: nil
:sequence: 81
:assigned-to: "m&m"
:attach-name: nil
** components
:id: "3214"
:name: "Dr.Dre"
:created: "2014-11-13T15:49:15.000Z"
** customer-fld-vals:
:custom-fld-id: "cust-id-112233"
:key: nil
:values: "Fill me"
:description: nil
:duedate: nil
:environment: nil
:fixVersions: nil
:key: "project-example"
:priority: "high"
:project: "EX"
:reporter: "YourName"
:resolution: "xx"
:status: "xx"
:summary: "Write something here"
:type: "xx"
:updated: "2014-11-15T22:52:13.000Z"
:votes: 0
Raw-hash (i have a list which has only one hash in it):
((hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data
(id "12345" affected-versions #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data
(id "12332" name "SlimShady" archived nil release-date "2014-10-01T04:00:00.000Z" released nil sequence 81))
assigned-to "m&m" attach-name nil components #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data
(id "3214" name "Dr.Dre"))
created "2014-11-13T15:49:15.000Z" customer-fld-vals #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data
(customfieldId "cust-id-112233" key nil values
("Fill me")))
description nil duedate nil environment nil fixVersions nil key "project-example" priority "high" project "EX" reporter "YourName" resolution "xx" status "xx" summary "Write something here" type "xx" updated "2014-11-15T22:52:13.000Z" votes 0)))
The comment section would not allow me extra characters so I couldn't post this code there.
Thank you for your solution, it's neat!!
I am new to elisp and do not know all the functions properly. Really like the 'make-string', my alternative is that I keep a list of stars per heeding and then concat them wherever necessary. I came up with solution shortly after i asked the question. I like your approach.
A few notes about my hash is that all the keys are symbols hence this: '(symbol-name k)'