From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id cATCN/0VcGdITAAAe85BDQ:P1 (envelope-from ) for ; Sat, 28 Dec 2024 15:15:10 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id cATCN/0VcGdITAAAe85BDQ (envelope-from ) for ; Sat, 28 Dec 2024 16:15:10 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20230601 header.b=HiA6Rxx0; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1735398909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=kLlslFvLUrAl1ES5FsjM11uF5yeqeWASUyVSOEtjxb4=; b=iEoyREVrQT/PN8BlU94h8K0tHmpffRHxVFhGN7uDM+QnDbHjYDpIQ8pS1Drucmsp/Be7B8 u1l66Kk60UrA4dV6h8nj1nNPGIwRiaKtAJNsJ+eByEGVX/lud/UP7zNncieqVFAIyLHXP0 OxMWIgcU7YM+8X10j5HObFXhJkeEl6YckBrzjOkF1qVuACYV/Shea7jCxe4BlwLyGPiV41 U/j+SSIEzBoIxNkYaKK/RGS7UhvUYM2LlMcNGoQVykd4dxCphoPehp1UVg/IfOe+5pv+nU 08M5XGYUCXcKg9lmXXueJMc4P0thuQ5BgGZHLJH3Td+r0TnrMPWLGV3B56LktA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20230601 header.b=HiA6Rxx0; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1735398909; a=rsa-sha256; cv=none; b=KEvh3iZAnxz8YXIJamIh8d3kBrvj/tORHSEyR8xa1fbbuwrikXqen1w5C3oC4iOLr3mQax NJSB7flNPAoq7hGBtEZDjbJv7gzwkyTHV8WsiXNkwKy7LxTweTfsXjOjs0tHim/UjFfoLl nLHeIrFbc2bsxu6ac8a8wpWXoPYeuoUkKTzj4f62aiuiy/gxUPzwJx4QXFjhDRoyu9GrJH JC2zDIxYWlqGyHS2Y0q8i37J1d9vffrBod4yzTT6kRzTVPjQkMcyvsJ9pshW0ri9MV8yBZ DySYac15gMOc5qN5xkUWHjMe6uyqeJ/byxglFdkFLvtGIkjIccgQVRCQnWzwmg== Received: from mail.notmuchmail.org (yantan.tethera.net [IPv6:2a01:4f9:c011:7a79::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id BAF0E9C5A6 for ; Sat, 28 Dec 2024 16:15:08 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 7C82B5F5E3; Sat, 28 Dec 2024 15:04:45 +0000 (UTC) Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by mail.notmuchmail.org (Postfix) with ESMTPS id 5AC9F5F5CB for ; Sat, 28 Dec 2024 05:21:04 +0000 (UTC) Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-aa69107179cso1283477266b.0 for ; Fri, 27 Dec 2024 21:21:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735363263; x=1735968063; darn=notmuchmail.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=AOOKAp1OfvrXmbIpfnWrrhIUrf5dA/7BlcrkCiy2QIc=; b=HiA6Rxx0vOEvGabXeiub0vhELXPoMLMs5z1/w53GVIDu1YR5UZZmFYfiR5tWT7EtlN YFI3L+mAtMdAFSlSljpavtZsFBeQunbVQ4PBxHgL3Kw/8ETAxBnxT6+JTaXjRXMC4oXS 4iqPfJwDkskpr5JEUYBtBVpqoYva28FNkYEqHbD96XC2UNy+VBcdbOlwHp0hgsWf1lmB fOS5cg2mDAsLUgOxnM+2rOMc6937ZEp6mtba3LL6cWM8vAkcAmw997TDgcI8smFV6aPW Ww5+PAWjnIsWqXU3OM73PErxO+ZFz0CaEAwn8jZ+Eergz4ssEgYNbJxaa29jHBM6ew0g lTkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735363263; x=1735968063; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=AOOKAp1OfvrXmbIpfnWrrhIUrf5dA/7BlcrkCiy2QIc=; b=eBW1GPMPx969m2MAVztroPxqapZU7RtR52YrJ+VC7samcOGR0CM2U8j2TUGFPH8Ju9 NDgF0N7ECCjNT4aI8Ks/Hlur2nJEtQvfq3veehVbZuyEApXNJZT57KwfkywRN/HX9f2X 7CKl7Ea+yrVixoFPt7IWReUThlRCLoOGvrn6SKaKTDm2QrY5QonrIRf4MTDI52xnmIQd GNu209w1NNJg+9tnIanSQCdcTBuzTpUDRc6UAABEVu1bxZAVkiU2M6hhPZIeLa/cEXrH Mabx6IZcHhw34Z0ykJSD6RxRCHmgGQnoL97CFCqj3urx+uIKYd3bt68AnARIux11ouQa 3nBQ== X-Gm-Message-State: AOJu0YxOyChVf6BNPSpVevrkcWb8omyns8q1NEU/vCN8fOvZRPWqwRQS lF4j4UXL/tDx0URYtAVwhxREO/UhnZu/uuRD0e89vATnO75JU8NDwdOOsJlGhTc3wWfOPRyiJTa FLM7IN5Uoi3VqR9ppOOkxfCfmwFh5eAfnZls= X-Gm-Gg: ASbGnctY7wp+/SK6ti3TBTRVOCEtRqMDqIK8B+z0CtVcUwq3+q8n/kyqLTjjBdN9nvL 4/IBJ97PifS88s741rwqacBY9sDR1v/8sXvfiBJY= X-Google-Smtp-Source: AGHT+IGes7SMxG+1hxRNRRrIZKtBY2eo0MLJgLFVBPVcnZhOGX8f1k6+FiHs87h2aLqe212qmXfF6b+G5HR9meBx5WU= X-Received: by 2002:a17:907:7284:b0:aa6:8430:cb02 with SMTP id a640c23a62f3a-aac3397d1ccmr2638316766b.61.1735363262414; Fri, 27 Dec 2024 21:21:02 -0800 (PST) MIME-Version: 1.0 From: Yousef Akbar Date: Sat, 28 Dec 2024 08:20:49 +0300 Message-ID: Subject: notmuch show: Parsing message depth in thread from JSON To: notmuch@notmuchmail.org X-MailFrom: yhakbar99@gmail.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0 Message-ID-Hash: EZYV5JFSMT3PL7SG6EONXLZR5EQLTMGR X-Message-ID-Hash: EZYV5JFSMT3PL7SG6EONXLZR5EQLTMGR X-Mailman-Approved-At: Sat, 28 Dec 2024 15:04:43 +0000 X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Country: DE X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: 6.74 X-Spam-Score: 6.74 X-Migadu-Queue-Id: BAF0E9C5A6 X-Migadu-Scanner: mx10.migadu.com X-TUID: bygoCkgEfXPw 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