unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Yousef Akbar <yhakbar99@gmail.com>
To: notmuch@notmuchmail.org
Subject: notmuch show: Parsing message depth in thread from JSON
Date: Sat, 28 Dec 2024 08:20:49 +0300	[thread overview]
Message-ID: <CANJ+LrYAxEhP1PMEd_WketFBTRZZHHfhGRpF560wP-jfy5sgcw@mail.gmail.com> (raw)

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

             reply	other threads:[~2024-12-28 15:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-28  5:20 Yousef Akbar [this message]
2024-12-28 23:51 ` notmuch show: Parsing message depth in thread from JSON David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANJ+LrYAxEhP1PMEd_WketFBTRZZHHfhGRpF560wP-jfy5sgcw@mail.gmail.com \
    --to=yhakbar99@gmail.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).