From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id EE8336DE00E8 for ; Sat, 28 Jan 2017 05:40:36 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.09 X-Spam-Level: X-Spam-Status: No, score=0.09 tagged_above=-999 required=5 tests=[AWL=0.110, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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 WsI06GSbfIF5 for ; Sat, 28 Jan 2017 05:40:35 -0800 (PST) Received: from mail-lf0-f65.google.com (mail-lf0-f65.google.com [209.85.215.65]) by arlo.cworth.org (Postfix) with ESMTPS id 247026DE00AC for ; Sat, 28 Jan 2017 05:40:35 -0800 (PST) Received: by mail-lf0-f65.google.com with SMTP id h65so27845209lfi.3 for ; Sat, 28 Jan 2017 05:40:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nikula-org.20150623.gappssmtp.com; s=20150623; h=from:to:subject:in-reply-to:references:date:message-id:mime-version; bh=43n1eDQfmAwOM1hva0O49V7BMZHYaBIOBYt645Mdm4Y=; b=B0N869TGY4TTLIRg/GdhbFMno6V2yY+SKUBdqFcTIDKxFde1Hr5/ZV+nBb6agatsYo HOm7+NGB/n+LpF9Ow/6wlQYKEemjZOG1mk369gOZTAIGYmURj8pCtzrdD+LSF1+/4O5a G2/Mp5TnDj3H4BluCtXnVPyrRdPbk9R/sD3kxm80NztSqMvk3cNRfx681bK61Yn9MUY1 LS33lax8WHfZM+SV4cKskgZkwO58TYTdYGYafzrmz5RgmtBxtLAwck7vuo2jn1+jryhV 17XPl0/ika7z/qCwA2EbQIf2rVCT635gXa1vs2ivL4xM2EpzlumirFWKlyEiGp/3AcmG lbIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version; bh=43n1eDQfmAwOM1hva0O49V7BMZHYaBIOBYt645Mdm4Y=; b=IR8fr0XT/x/TFfUD/rOk2E7vSNFqKWIklwKgOPres9AdwLi8JZPDJcx7VmGwBDoAIN 26EBbE0PdOWsO/r1eo6mjzvuOwW5N3UPZEjMpODoQMXNAe3MIZx+/2Uk+qf9gihG4fN3 7LstTi3fgNT0EPuf5Sr16/MmNw8yL4JjFKfvxue8cTj/1EjkeG5B5PS7KUJ3ah3geOPf BkXpZgW2a+QGchfqyb8jB+DVixfDpw8qkGAhkNDHEDfIp5ED0ZXaOHLtzUacNeI/oh93 0Y27Jkp5RvWam/Dih3D1P/miC3CNSLz9g/nIVOmtLOSFzhkrGF7jeJIaRIhJbZrtqU/U ZmDw== X-Gm-Message-State: AIkVDXKEzOmANcQa+3OV7mPz40wnUxiG5XhQUBPABETJqrztwuqzW/pIj+OQE0dxTKsORA== X-Received: by 10.46.75.25 with SMTP id y25mr4851552lja.45.1485610833117; Sat, 28 Jan 2017 05:40:33 -0800 (PST) Received: from localhost (mobile-access-5d6a3e-39.dhcp.inet.fi. [93.106.62.39]) by smtp.gmail.com with ESMTPSA id c143sm2106933lfc.13.2017.01.28.05.40.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 28 Jan 2017 05:40:32 -0800 (PST) From: Jani Nikula To: Tomi Ollila , notmuch@notmuchmail.org Subject: Re: [PATCH] cli/show: list all filenames of a message in the formatted output In-Reply-To: References: <20170110201929.21875-1-jani@nikula.org> Date: Sat, 28 Jan 2017 15:40:31 +0200 Message-ID: <87fuk3ti9c.fsf@nikula.org> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 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, 28 Jan 2017 13:40:37 -0000 On Wed, 25 Jan 2017, Tomi Ollila wrote: > On Tue, Jan 10 2017, Jani Nikula wrote: > >> Instead of just having the first filename for the message, list all >> duplicate filenames of the message as a list in the formatted >> outputs. This bumps the format version to 3. > > Great stuff -- just now quite a few (~33) tests fail ;) I'll fix that up iff we decide this is the way to go. BR, Jani. > >> >> --- >> >> I presume the UI could do fancy things with this to highlight messages >> with dupes better. I haven't quite figured out yet what that could be, >> but this seems like the right thing to do regardless. >> --- >> devel/schemata | 5 ++++- >> notmuch-client.h | 2 +- >> notmuch-show.c | 16 +++++++++++++++- >> 3 files changed, 20 insertions(+), 3 deletions(-) >> >> diff --git a/devel/schemata b/devel/schemata >> index 41dc4a60fff3..6dede7a453d7 100644 >> --- a/devel/schemata >> +++ b/devel/schemata >> @@ -26,6 +26,9 @@ v1 >> v2 >> - Added the thread_summary.query field. >> >> +v3 >> +- Replaced message.filename string with a list of filenames. >> + >> Common non-terminals >> -------------------- >> >> @@ -59,7 +62,7 @@ message = { >> # (format_message_sprinter) >> id: messageid, >> match: bool, >> - filename: string, >> + filename: [string*], >> timestamp: unix_time, # date header as unix time >> date_relative: string, # user-friendly timestamp >> tags: [string*], >> diff --git a/notmuch-client.h b/notmuch-client.h >> index d026e6004239..21b087980a17 100644 >> --- a/notmuch-client.h >> +++ b/notmuch-client.h >> @@ -145,7 +145,7 @@ chomp_newline (char *str) >> * this. New (required) map fields can be added without increasing >> * this. >> */ >> -#define NOTMUCH_FORMAT_CUR 2 >> +#define NOTMUCH_FORMAT_CUR 3 >> /* The minimum supported structured output format version. Requests >> * for format versions below this will return an error. */ >> #define NOTMUCH_FORMAT_MIN 1 >> diff --git a/notmuch-show.c b/notmuch-show.c >> index 22fa655ad20d..3b9e31247f2c 100644 >> --- a/notmuch-show.c >> +++ b/notmuch-show.c >> @@ -133,7 +133,21 @@ format_message_sprinter (sprinter_t *sp, notmuch_message_t *message) >> sp->boolean (sp, notmuch_message_get_flag (message, NOTMUCH_MESSAGE_FLAG_EXCLUDED)); >> >> sp->map_key (sp, "filename"); >> - sp->string (sp, notmuch_message_get_filename (message)); >> + if (notmuch_format_version >= 3) { >> + notmuch_filenames_t *filenames; >> + >> + sp->begin_list (sp); >> + for (filenames = notmuch_message_get_filenames (message); >> + notmuch_filenames_valid (filenames); >> + notmuch_filenames_move_to_next (filenames)) { >> + sp->string (sp, notmuch_message_get_filename (message)); >> + sp->separator (sp); >> + } >> + notmuch_filenames_destroy (filenames); >> + sp->end (sp); >> + } else { >> + sp->string (sp, notmuch_message_get_filename (message)); >> + } >> >> sp->map_key (sp, "timestamp"); >> date = notmuch_message_get_date (message); >> -- >> 2.11.0 >> >> _______________________________________________ >> notmuch mailing list >> notmuch@notmuchmail.org >> https://notmuchmail.org/mailman/listinfo/notmuch > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > https://notmuchmail.org/mailman/listinfo/notmuch