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 ms11 with LMTPS id 6dgJFJA15V+DGQAA0tVLHw (envelope-from ) for ; Fri, 25 Dec 2020 00:42:56 +0000 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 QClLD5A15V8gaAAA1q6Kng (envelope-from ) for ; Fri, 25 Dec 2020 00:42:56 +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) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1E2F09403C9 for ; Fri, 25 Dec 2020 00:42:55 +0000 (UTC) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id A712829CB5; Thu, 24 Dec 2020 19:42:41 -0500 (EST) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id 7D15829CAB for ; Thu, 24 Dec 2020 19:42:39 -0500 (EST) Received: by fethera.tethera.net (Postfix, from userid 1001) id F178A5FC36; Thu, 24 Dec 2020 19:42:37 -0500 (EST) Received: (nullmailer pid 650423 invoked by uid 1000); Fri, 25 Dec 2020 00:42:36 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: v2 Merged Config Date: Thu, 24 Dec 2020 20:42:04 -0400 Message-Id: <20201225004228.647328-1-david@tethera.net> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Message-ID-Hash: G2XJICGPENCB7TO22FL7NGWDAIUIJTMV X-Message-ID-Hash: G2XJICGPENCB7TO22FL7NGWDAIUIJTMV X-MailFrom: bremner@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 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 X-Migadu-Spam-Score: 0.60 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: 1E2F09403C9 X-Spam-Score: 0.60 X-Migadu-Scanner: scn1.migadu.com X-TUID: glBI9NZnUKM3 This is a revised version of the series at id:20200808141653.1124111-1-david@tethera.net It now converts everything but notmuch-setup and notmuch-config to the new framework, which means that the distinction between configuration stored in the database and that in an auxilary config file is mostly gone from a user point of view. Compared to the previous version, this one modifies notmuch_database_{get,set}_config to use the merged configuration cache. There is a tradeoff here between expressive power and proliferation of APIs: now _have_ to use the merged configuration view, and there's no easy way for a user to to distinguish what is in the database. Most new code is expected to use notmuch_config_{get,set}, which takes enum keys. I went ahead and converted the function signature of the subcommands to take both a notmuch_config_t * and a notmuch_database_t *, one of which is always NULL. Polymorphism C style, I guess. This mostly works well, except for notmuch-show, where we can't determine early enough whether to open the database for write access. The first 10 patches are most of the groundwork. The remaining patches are mostly converting subcommands to the new configuration framework, with two or three more groundwork patches. I still haven't dealt with the searching for database features documented, but I think the existing series adds useful functionality, and in a pinch we could release with only these changes (with appropriate adjustements to the n_d_open_with_config documentation).