I'm trying to parse the output of ledger-context-at-point
for the account name. The output looks something like:
(acct-transaction
account
((indent " " 238117)
(status nil nil)
(account "asset:checking" 238121)))
I want "asset:checking"
.
I can get it by
(cadr (assq 'account (nth 2
;; (ledger-context-at-point)
(quote
(acct-transaction
account
((indent " " 238117)
(status nil nil)
(account "asset:checking" 238121)))
))))
or by
(cadadr (cdaddr
;; (ledger-context-at-point)
(quote
(acct-transaction
account
((indent " " 238117)
(status nil nil)
(account "asset:checking" 238121)))
)))
I would have expected a simple structure, like an alist or plist. Does this data structure follow a different idiom? Is there a conventional way to get at the list elements like these?