* notmuch show: Parsing message depth in thread from JSON
@ 2024-12-28 5:20 Yousef Akbar
2024-12-28 23:51 ` David Bremner
0 siblings, 1 reply; 2+ messages in thread
From: Yousef Akbar @ 2024-12-28 5:20 UTC (permalink / raw)
To: notmuch
Hi List Members,
I am writing a `Neovim` plugin [1] that provides an interface for
`notmuch` inside of nvim. Currently, it displays threads with a
`notmuch show` command and displays the default text output with some
formatting cleanups and indentation for depth, which works fine. But
I'm curious to try json outputs since neovim/lua supports converting
the json to lua object nicely.
However, in the default text output, I was heavily relying on the
"depth" field in the message header. In the json output (with
`--format=json`), the output doesn't indicate depth in any of the
fields.
Question: Any idea or hints for how to parse the depth of each message
in a thread with json output of notmuch show?
I searched the manual and various forums/sites but didn't find much. I
tried figuring out if there was a hierarchy to the json objects
embedded. There seems to be some pattern of levels of root message
followed by a list of replies, but I am not sure if it's intentional,
but please correct me if I'm wrong.
Many thanks for `notmuch` and appreciate any help I can get.
[1]: https://github.com/yousefakbar/notmuch.nvim
--
Yousef
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: notmuch show: Parsing message depth in thread from JSON
2024-12-28 5:20 notmuch show: Parsing message depth in thread from JSON Yousef Akbar
@ 2024-12-28 23:51 ` David Bremner
0 siblings, 0 replies; 2+ messages in thread
From: David Bremner @ 2024-12-28 23:51 UTC (permalink / raw)
To: Yousef Akbar, notmuch
Yousef Akbar <yhakbar99@gmail.com> writes:
>
> Question: Any idea or hints for how to parse the depth of each message
> in a thread with json output of notmuch show?
Have a look at the file devel/schemata in source.
It is indeed supposed to be a tree structure.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-12-29 0:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-28 5:20 notmuch show: Parsing message depth in thread from JSON Yousef Akbar
2024-12-28 23:51 ` David Bremner
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).