From d2c93b08da54d9b0eee9e65256ba84ec55f3dce0 Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Sat, 7 Jul 2012 16:12:55 +0100 Subject: [PATCH] [PATCH 0/3] Control notmuch show output --- 69/2de0b2ce4415e5d056bb19a96e396236b01ae2 | 114 ++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 69/2de0b2ce4415e5d056bb19a96e396236b01ae2 diff --git a/69/2de0b2ce4415e5d056bb19a96e396236b01ae2 b/69/2de0b2ce4415e5d056bb19a96e396236b01ae2 new file mode 100644 index 000000000..eb2e6fdf2 --- /dev/null +++ b/69/2de0b2ce4415e5d056bb19a96e396236b01ae2 @@ -0,0 +1,114 @@ +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 E7ADE431FC7 + for ; Sat, 7 Jul 2012 08:13:14 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 2.7 +X-Spam-Level: ** +X-Spam-Status: No, score=2.7 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001, + FREEMAIL_REPLY=2.499, 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 w9NFfApX1goX for ; + Sat, 7 Jul 2012 08:13:10 -0700 (PDT) +Received: from mail-wg0-f45.google.com (mail-wg0-f45.google.com + [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client + certificate requested) by olra.theworths.org (Postfix) with ESMTPS id + 5111D431FAE for ; Sat, 7 Jul 2012 08:13:10 -0700 + (PDT) +Received: by wgbdt14 with SMTP id dt14so8437273wgb.2 + for ; Sat, 07 Jul 2012 08:13:08 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id:x-mailer; + bh=2RmRLxTzPEY7REyG6NctvNOVzqoqgUDRUfOSrqDR/44=; + b=wY3w2+8m7B3/16TDO7crg2Af3lWqWUlfS3PiecD2lXLQG9YMqEae5IcFAvj2GWUNGe + fc6lJqSWaORcqn1i3yd54L+0KSUhMY2tHDYca5Fp+vbQx1auytdc4zJnKZ693TNCQXvi + gBD+OBqbNbjMNvbLAdFqXLg+CBl38M6+PSDEneGF+5N4MEoeTq4nPVnS9QLeT13e3BY0 + iLxPtkScoNodEkuANgey+LBsL5mtQ5L8SxiuspVKZ82B25eLg88VJDQy0srnTxbFRcun + xkiLi8+QItryrp5br+kophOgLgXrUo+0j2w5hr5I0nGfl2ZLwq6iR6se7bTpkd8h/SAU + TySQ== +Received: by 10.180.92.7 with SMTP id ci7mr18441319wib.1.1341673988508; + Sat, 07 Jul 2012 08:13:08 -0700 (PDT) +Received: from localhost (94-192-233-223.zone6.bethere.co.uk. + [94.192.233.223]) by mx.google.com with ESMTPS id + q6sm12651725wiy.0.2012.07.07.08.13.06 (version=TLSv1/SSLv3 cipher=OTHER); + Sat, 07 Jul 2012 08:13:07 -0700 (PDT) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [PATCH 0/3] Control notmuch show output +Date: Sat, 7 Jul 2012 16:12:55 +0100 +Message-Id: <1341673978-6094-1-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.9.1 +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: Sat, 07 Jul 2012 15:13:15 -0000 + +This is a first draft of a patch set allowing the caller to control +the output of notmuch show. This option should subsume the +--headers-only option (see +id:"1341041595-5858-1-git-send-email-markwalters1009@gmail.com") and +the reply-to patch +(id:"1340508470-16606-2-git-send-email-novalazy@gmail.com") as well as +being extensible. + +It follows the suggestions made in +id:"20120704182459.GI2342@hili.localdomain" and +id:"CAB+hUn_sxy=QP1+OzGwKOcSYGi13Q61m4-bq+PGnYxCMPd0fvg@mail.gmail.com" + +and modifies the cli parser to allow keyword lists of the form --output=from,cc,body + +The first patch adds this functionality to the option parser. It uses +a bitfield to pass the flags specified so we are limited to 32 (or +perhaps 31) possible options. + +The second patch implements this for the selection of which headers to +return. Since notmuch-reply.c wanted exactly this functionality (since +it wants in-reply-to headers and reference headers but not the date +header) it is converted to use this style. + +The third patch uses this functionality to implement the +--headers-only functionality by adding a "body" option to the list of +things the user can choose to output or not. + +Currently, I have not written any tests for the new functionality, +updated the man page, or implemented for any format except JSON. + +Do people have any comments in the current form? + +Best wishes + +Mark + + + + +Mark Walters (3): + cli: allow keyword lists in argument parser. + cli: show allow the caller to specify the headers output. + cli: allow show to omit message bodies. + + command-line-arguments.c | 47 +++++++++++++++++++++++ + command-line-arguments.h | 3 +- + notmuch-client.h | 26 ++++++++++++- + notmuch-reply.c | 12 +++++- + notmuch-show.c | 92 +++++++++++++++++++++++++++++++-------------- + 5 files changed, 146 insertions(+), 34 deletions(-) + +-- +1.7.9.1 + -- 2.26.2