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 2753A6DE02A6 for ; Tue, 31 May 2016 18:12:34 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.012 X-Spam-Level: X-Spam-Status: No, score=-0.012 tagged_above=-999 required=5 tests=[AWL=-0.001, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-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 FxEm43MNNb2q for ; Tue, 31 May 2016 18:12:26 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id DC6056DE028C for ; Tue, 31 May 2016 18:12:25 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.84) (envelope-from ) id 1b7uhg-0002nI-Km; Tue, 31 May 2016 21:12:12 -0400 Received: (nullmailer pid 12976 invoked by uid 1000); Wed, 01 Jun 2016 01:12:21 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: Re: [RFC2 Patch 5/5] lib: iterator API for message properties In-Reply-To: <1464608999-14774-6-git-send-email-david@tethera.net> References: <1463927339-5441-1-git-send-email-david@tethera.net> <1464608999-14774-1-git-send-email-david@tethera.net> <1464608999-14774-6-git-send-email-david@tethera.net> User-Agent: Notmuch/0.22+28~gb9bf3f4 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Tue, 31 May 2016 22:12:21 -0300 Message-ID: <8760tthfuy.fsf@zancas.localnet> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.20 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: Wed, 01 Jun 2016 01:12:34 -0000 David Bremner writes: > + notmuch_message_properties_t *list; > + RUN(notmuch_message_add_property (message, "testkey1", "bob")); > + RUN(notmuch_message_add_property (message, "testkey1", "testvalue2")); > + RUN(notmuch_message_add_property (message, "testkey1", "alice")); > + > + for (list = notmuch_message_get_properties (message, "testkey1", TRUE); > + notmuch_message_properties_valid (list); notmuch_message_properties_move_to_next (list)) { > + printf("%s\n", notmuch_message_properties_value(list)); > + } > + notmuch_message_properties_destroy (list); I was thinking a bit about how to dump/restore these. The most upwardly compatible way that i thought of is something like #= msg-id key=val key=val i.e. duplicate the msg-id for messages with properties This would be ignored by old notmuch-restore. Otherwise, maybe something like msg-id -- +tag +tag # key=val key=val I'm not sure. this might crash old notmuch-restore. How important is backward compatibility, and how important is minimizing dump size? It's a bit hard to predict the things people might use message properties for, but for thread surgery, I would expect a small number of messages with properties. d