Re: expose notmuch_database_new to libraries?
authorJani Nikula <jani@nikula.org>
Sat, 26 Sep 2015 07:35:47 +0000 (10:35 +0300)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 21:49:38 +0000 (14:49 -0700)
91/e346d46cb9a7de80581db9b53353c59ea2d0ab [new file with mode: 0644]

diff --git a/91/e346d46cb9a7de80581db9b53353c59ea2d0ab b/91/e346d46cb9a7de80581db9b53353c59ea2d0ab
new file mode 100644 (file)
index 0000000..2bf93c2
--- /dev/null
@@ -0,0 +1,96 @@
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id E77EE6DE0AC2\r
+ for <notmuch@notmuchmail.org>; Sat, 26 Sep 2015 00:36:09 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.525\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.525 tagged_above=-999 required=5 tests=[AWL=0.195,\r
+  RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01]\r
+ autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id PUDY3CioV0X4 for <notmuch@notmuchmail.org>;\r
+ Sat, 26 Sep 2015 00:36:08 -0700 (PDT)\r
+Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com\r
+ [209.85.212.180])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id 9E0D46DE0924\r
+ for <notmuch@notmuchmail.org>; Sat, 26 Sep 2015 00:36:07 -0700 (PDT)\r
+Received: by wiclk2 with SMTP id lk2so44145672wic.1\r
+ for <notmuch@notmuchmail.org>; Sat, 26 Sep 2015 00:36:05 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:from:to:subject:in-reply-to:references\r
+ :user-agent:date:message-id:mime-version:content-type;\r
+ bh=za1Lkhv4/xMuAo3pav1Cd2DDIsm296vrW8ZlonUBjPc=;\r
+ b=BW9ILOV1fAblYC5icpI7kDhL7WgpRAiceayLu2LDugcEhS9ZqSGF1GZm+DfVUwZ8zH\r
+ dbL3R/ljxFp8IsqWllXWTQmdaTzDBgv9zfVtM2YZOOQRsFYuYFWaWOhaN5S63upUNxUM\r
+ PXgs7ng6TzfDx3oH74/hd61PaeXqtfKDkxBI8pRra8/KCqeSBX1bvN+VCAYU/f2kZhNn\r
+ +lO3x4tolBrzre1dM8dF9FLnggbiwNuLmE14kCGBU3Ddi2d5+01Nm7z9WzNsSfwbU7+v\r
+ Kq7qcnxWwWFIsb6VqXyzoUZ9TxF2/a6oq+/shNjmtzAB+l48ko0z2FdWC3xwssL101U6\r
+ aPmA==\r
+X-Gm-Message-State:\r
+ ALoCoQkHj621hrx8ry9Fs6yisuTGijsRHxlyIae4dKY8+0j3l6z5HLptR0Sz8eR8NhoDyqjuK8P4\r
+X-Received: by 10.194.190.75 with SMTP id go11mr10110286wjc.80.1443252965444; \r
+ Sat, 26 Sep 2015 00:36:05 -0700 (PDT)\r
+Received: from localhost (mobile-access-bcee63-221.dhcp.inet.fi.\r
+ [188.238.99.221])\r
+ by smtp.gmail.com with ESMTPSA id vr8sm7072831wjc.26.2015.09.26.00.36.04\r
+ (version=TLSv1/SSLv3 cipher=OTHER);\r
+ Sat, 26 Sep 2015 00:36:04 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: "Wael M. Nasreddine" <wael.nasreddine@gmail.com>,\r
+ notmuch <notmuch@notmuchmail.org>\r
+Subject: Re: expose notmuch_database_new to libraries?\r
+In-Reply-To:\r
+ <CA+kKtKDBrfPPkM+HnNJLXMHGc4Ppr=8YeJkOPuZaFewUkBqh9w@mail.gmail.com>\r
+References:\r
+ <CA+kKtKDBrfPPkM+HnNJLXMHGc4Ppr=8YeJkOPuZaFewUkBqh9w@mail.gmail.com>\r
+User-Agent: Notmuch/0.20.2+66~gb33abd9 (http://notmuchmail.org) Emacs/24.4.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Sat, 26 Sep 2015 10:35:47 +0300\r
+Message-ID: <87k2rdmy3w.fsf@nikula.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.18\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sat, 26 Sep 2015 07:36:10 -0000\r
+\r
+On Sat, 26 Sep 2015, "Wael M. Nasreddine" <wael.nasreddine@gmail.com> wrote:\r
+> I have a use case where I'd like to call 'notmuch new'\r
+> programmatically via the bindings (custom Go bindings). Is it at all\r
+> possible to expose notmuch_new_command[0] through lib/notmuch.h? The\r
+> logic of notmuch_new_command would probably have to extracted to\r
+> lib/database.cc for the exposure.\r
+\r
+Short answer, no.\r
+\r
+I'm afraid we don't have any documentation describing the split between\r
+the library and the cli, apart from the library API. IIUC the history is\r
+that it was originally all lumped together, and then the library was\r
+abstracted as a toolbox for creating email programs on top. The cli\r
+could be considered one such email program (and notmuch-emacs builds on\r
+top of the cli).\r
+\r
+I don't think the notmuch new command would be a good fit in the\r
+library. It has too much application level policy that doesn't belong in\r
+the library. That said, I could imagine coming up with another, higher\r
+level library consisting of the main building blocks of the cli, and\r
+having bindings to that. It's just that it's a non-trivial amount of\r
+work, requiring a significant programming *and* review effort.\r
+\r
+BR,\r
+Jani.\r