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