From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id CJ1hDfRp7WD3cQAAgWs5BA (envelope-from ) for ; Tue, 13 Jul 2021 12:24:52 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id QP0iCfRp7WA2HQAA1q6Kng (envelope-from ) for ; Tue, 13 Jul 2021 10:24:52 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (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 E215A1E379 for ; Tue, 13 Jul 2021 12:24:51 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id D219A27E2B; Tue, 13 Jul 2021 06:24:47 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id 9E2A327D92 for ; Tue, 13 Jul 2021 06:24:44 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id 20CDC5FD21; Tue, 13 Jul 2021 06:24:44 -0400 (EDT) Received: (nullmailer pid 153240 invoked by uid 1000); Tue, 13 Jul 2021 10:24:43 -0000 From: David Bremner To: Hannu Hartikainen , notmuch@notmuchmail.org Subject: Re: [PATCH v3 1/2] cli/show: add --format=pretty In-Reply-To: <87bl7785jr.fsf@tethera.net> References: <20210702203153.47289-1-hannu@hrtk.in> <20210622123410.323216-1-hannu@hrtk.in> <20210712083821.442587-1-hannu@hrtk.in> <20210712083821.442587-2-hannu@hrtk.in> <87bl7785jr.fsf@tethera.net> X-List-To: notmuch Date: Tue, 13 Jul 2021 07:24:43 -0300 Message-ID: <878s2a8qac.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: WIOFZTSJQFH2PTX4J34FW5JS3ZFV5KHH X-Message-ID-Hash: WIOFZTSJQFH2PTX4J34FW5JS3ZFV5KHH X-MailFrom: david@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: David Edmondson X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1626171892; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=JZIXlEM9VU8h/C7jb2BKB7aXnPxfxt/CI6hCZZjpSkY=; b=rDai8Ys5Bs8PNocPBpHPZODa2c5f5Hla8KYH2tP/Y5loH+oHkA3yG5/3G4r3jm9zxPkktC oRR8zxJa43yk7P7mVdZFz4JrbVWJQDoHc8B4sHIsINDOOIYE/FvYIpgrW2GJq+P5cBftje iMG0xgSNUBeRfhl88TAAOv069LlhCPvPNPvy0Boi9nBF01DGwzDMIJeKooU4A5Cg2DjT6f 9o7+o4HN0tbGX1uDU03IDd6Tj8s9qCmflZ/ZpRtqjzUw2pSpIgcYFn4AUf/3ueVj8yPlKE ui+UYMpHZCZCZPXZkobIhlVdizdXQDXncdbHoCkpNHz16uPmXA0JSBllyRFNeg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1626171892; a=rsa-sha256; cv=none; b=D3ELywxywCYDGnB98dquyIeY+382bymqozlp/ZEIOJ97XxDCT2/uVSwtK+yN2yJ7ym8bjb IEmDDy+Wno8UEO489axVSKOchzP4Vd1fRN8yuHDTV19KnD8EaN2FEYJWMotyZxU9i+O6Kh KE+/6a76i+mH+19EH6BzGOjHQ3vzlbFQgooP24ZaslT0+b+Hmv+dhUtyDe/BntS5sxVa3M hIJqp0f63nitySO8gJLNdT0ANeSxeXl29H6OeVVXjsbBjuzLlc5EXduwerABCG/xQCKS/d ztLibQBUkpNH3Jbd67OAvQGWesnKfxeB1goQc6UAjBR+BDir39yVlwGK2IpNOQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -2.09 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: E215A1E379 X-Spam-Score: -2.09 X-Migadu-Scanner: scn0.migadu.com X-TUID: D6+bv2BNWZ9e David Bremner writes: > > I don't know what g_mime_message_get_message_id will return if there is > no message-id, but that case can and does arise. Notmuch constructs a > message-id by sha1 hashing the message. That message-id is in the > database, so I think you should probably print out the message-id from > the database. > I expect that would require somehow making the notmuch_database_t object available inside the sprinter. We want this for at least one other feature request (configurable headers in json / sexpr output), so it's not as much of a "waste" of effort as it might seem at first. The options are adding extra arguments to functions and stashing a copy of the pointer in some struct (perhaps the sprinter struct). I think David E has a prototype of the former. My own instincts is that the latter will be more general. The previous consensus was that we did not want to add static (file scope) variables, even though that would be the quick and dirty solution. d