Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id CA5F1431FAF for ; Mon, 10 Dec 2012 22:55:32 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id V9yUcbzFhzbV for ; Mon, 10 Dec 2012 22:55:32 -0800 (PST) Received: from mail-da0-f53.google.com (mail-da0-f53.google.com [209.85.210.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 338E9431FAE for ; Mon, 10 Dec 2012 22:55:32 -0800 (PST) Received: by mail-da0-f53.google.com with SMTP id x6so1438442dac.26 for ; Mon, 10 Dec 2012 22:55:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:subject:date:message-id:x-mailer:x-gm-message-state; bh=xrc1QyoClPTLoE1AI4Z0kUTyAVDv1BIelVeZ1mcaL50=; b=AwWp1kKjQphS0lpRArricXvXBJbKSSpHfvxyf8YEqLTlxjWtKCf1pa40JHQbIIK0RU 4LYk1wiG/+ombReJjGADqISHlWlzJgUBCHEOPNidSZ+QVE81UHWlX3iEjryqREWkRMV8 QF3j5+Fjl/NJ+7jWrt+qfUrSeFcD3lRtfKpXTnU4PafALVlhoKleDkTwysKnB5kMuQWk gq/nJ5tIXE0btX35izw3T/lvPE2htHvcQNClLPoQqtguSQoY/vY1WUMB6w1aF+rPPSOj 7MjIgJ/7O1SVOPPZxR5+mBB8MFYNoJLCusuhT7zXX74IOJUD5hTCcJAM50xzHTJ/2IGI Vvyg== Received: by 10.68.190.38 with SMTP id gn6mr46324456pbc.6.1355208930383; Mon, 10 Dec 2012 22:55:30 -0800 (PST) Received: from localhost ([2601:9:580:4c:21f:16ff:fe34:119e]) by mx.google.com with ESMTPS id d1sm4902265pav.6.2012.12.10.22.55.28 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 10 Dec 2012 22:55:29 -0800 (PST) From: Michael Forney To: notmuch@notmuchmail.org Subject: [PATCH 0/2] lib: Allow read-only messages to be synchronized to a writable database Date: Mon, 10 Dec 2012 22:54:51 -0800 Message-Id: <1355208893-16122-1-git-send-email-mforney@mforney.org> X-Mailer: git-send-email 1.8.0 X-Gm-Message-State: ALoCoQmhUlhlC3iOjmp52p7fTF+d1EYD+noC4KmVVSu28lP0pvqb5IqHTAVcdr/b6mp4OOxA1EPU X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 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: Tue, 11 Dec 2012 06:55:32 -0000 In developing ner (a notmuch ui), I open a read-only database connection so I don't interfere with other notmuch programs, but this makes it difficult to make modifications to the tags of messages I open. The first patch replaces the freeze/thaw functionality with a single sync function. This way, read-only messages can be modified just as writable ones can be, but the notmuch_message_sync operation requires a writable database connection. The second patch adds a function `notmuch_database_sync_message' which will perform the synchronization using the given database (and does not care if the modified message was opened with a read-only database). I've attempted to make these changes in the notmuch bindings as well, but haven't tested them. Feedback is welcome! Michael Forney (2): lib: Replace freeze/thaw functionality with single sync function lib: Allow synchronizing message changes with a separate database connection bindings/go/src/notmuch/notmuch.go | 70 ++++------------ bindings/python/docs/source/message.rst | 4 +- bindings/python/notmuch/__init__.py | 1 - bindings/python/notmuch/errors.py | 7 -- bindings/python/notmuch/message.py | 141 ++++++++------------------------ bindings/ruby/defs.h | 6 +- bindings/ruby/init.c | 12 +-- bindings/ruby/message.c | 27 +----- bindings/ruby/status.c | 2 - contrib/notmuch-deliver/src/main.c | 10 +++ lib/database.cc | 21 +++-- lib/message.cc | 92 +++++---------------- lib/notmuch-private.h | 7 +- lib/notmuch.h | 107 ++++++++++-------------- notmuch-new.c | 4 +- notmuch-tag.c | 4 +- tag-util.c | 10 +-- 17 files changed, 153 insertions(+), 372 deletions(-) -- 1.8.0