Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 5a / 3e0e590578e28c9d53bf52afbf47d85b38bb13
1 Return-Path: <jani@nikula.org>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 5D5E0431FB6\r
6         for <notmuch@notmuchmail.org>; Thu,  8 Mar 2012 16:48:44 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id xw0mLNyia2CO for <notmuch@notmuchmail.org>;\r
16         Thu,  8 Mar 2012 16:48:43 -0800 (PST)\r
17 Received: from mail-lpp01m010-f53.google.com (mail-lpp01m010-f53.google.com\r
18         [209.85.215.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 7669D431FAE\r
21         for <notmuch@notmuchmail.org>; Thu,  8 Mar 2012 16:48:43 -0800 (PST)\r
22 Received: by lahc1 with SMTP id c1so1165104lah.26\r
23         for <notmuch@notmuchmail.org>; Thu, 08 Mar 2012 16:48:40 -0800 (PST)\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
25         d=google.com; s=20120113;\r
26         h=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
27         :mime-version:content-type:x-gm-message-state;\r
28         bh=OEtb7ZIev9W+R+BNTQRVBycCS/8lS0CyXNP57l5Uxjs=;\r
29         b=CNlnSKrxRWGMnKLDMzIHUt5foUC/6tdVeRbTO1fUe9Nw/F61587WM6CIREH/QH0eVi\r
30         +gdiZoIYxEO5gnJ6JXDxv0/dyuvS80uQNhJhLh61WRHB0INySzP9QJoZD5uZU0IUo3uN\r
31         4X36UasGThhV355RXri6AxKvmRXemgSZOA7awxe0A9VnNIOR49/Mun3z3rIF90e+OUcH\r
32         dRAHWHjsqsCUDuZRxGGLLr0zeHTqe3AOopgJR8Lq8PZJNagAj8gopgsfaY/hzO3Nbagc\r
33         O2n4ZIGLrotsRbLeN3RUhjvzC4Fi0Bcrk3VTUp/DufMNXJPQdgBxXkrRPJhRs2Zo6e0w\r
34         NwqQ==\r
35 Received: by 10.112.47.161 with SMTP id e1mr100575lbn.42.1331254120312;\r
36         Thu, 08 Mar 2012 16:48:40 -0800 (PST)\r
37 Received: from localhost (dsl-hkibrasgw4-fe50f800-253.dhcp.inet.fi.\r
38         [84.248.80.253])\r
39         by mx.google.com with ESMTPS id p9sm4315364lbw.10.2012.03.08.16.48.37\r
40         (version=SSLv3 cipher=OTHER); Thu, 08 Mar 2012 16:48:38 -0800 (PST)\r
41 From: Jani Nikula <jani@nikula.org>\r
42 To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org\r
43 Subject: Re: [PATCH 0/2] cli: Parsing. Add option NOTMUCH_OPT_INT_OR_BOOLEAN\r
44 In-Reply-To: <1331244944-7960-1-git-send-email-markwalters1009@gmail.com>\r
45 References: <1331244944-7960-1-git-send-email-markwalters1009@gmail.com>\r
46 User-Agent: Notmuch/0.11.1+295~g780f284 (http://notmuchmail.org) Emacs/23.3.1\r
47         (i686-pc-linux-gnu)\r
48 Date: Fri, 09 Mar 2012 02:48:35 +0200\r
49 Message-ID: <87lina8uqk.fsf@nikula.org>\r
50 MIME-Version: 1.0\r
51 Content-Type: text/plain; charset=us-ascii\r
52 X-Gm-Message-State:\r
53  ALoCoQnhkiMV0N+Y0j0cvS0egUJSXr7GVgJJMMm2k3nvQ9V4ll4z4NHDrVfFdauxSCCIEG5eSPIS\r
54 X-BeenThere: notmuch@notmuchmail.org\r
55 X-Mailman-Version: 2.1.13\r
56 Precedence: list\r
57 List-Id: "Use and development of the notmuch mail system."\r
58         <notmuch.notmuchmail.org>\r
59 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
60         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
61 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
62 List-Post: <mailto:notmuch@notmuchmail.org>\r
63 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
64 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
65         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
66 X-List-Received-Date: Fri, 09 Mar 2012 00:48:44 -0000\r
67 \r
68 On Thu,  8 Mar 2012 22:15:42 +0000, Mark Walters <markwalters1009@gmail.com> wrote:\r
69 > The first patch adds a new command line parsing option\r
70 > NOTMUCH_OPT_INT_OR_BOOLEAN for command line parsing which accepts\r
71 > --verbose=3 and --verbose with the latter setting verbose to 1. It\r
72 > also allows --verbose=0 so (with a little caller support) the user can\r
73 > turn off boolean options.\r
74\r
75 > It also means that extra options can be added to the command line\r
76 > programs in a backwards compatible manner (e.g. if --verbose already\r
77 > exists we could add --verbose=2).\r
78\r
79 > The second patch uses this to make the --entire-thread option to\r
80 > notmuch-show a NOTMUCH_OPT_INT_OR_BOOLEAN. In particular this allows\r
81 > the caller to disable --entire-thread (with --entire-thread=0) when\r
82 > format=json.\r
83 \r
84 I'm afraid I find both of the patches a bit hacky. The first because\r
85 it's more about optional arguments to options than int-or-bool. The\r
86 second because it's more about detecting whether the user has provided\r
87 an option than int-or-bool.\r
88 \r
89 For booleans, I think the notmuch style would be to allow --foo=true and\r
90 --foo=false in addition to just --foo (which implies true) so you could\r
91 also disable booleans. I think this would be fairly simple to implement,\r
92 and would require no changes to option parser users.\r
93 \r
94 With --entire-thread the bigger problem is detecting whether the option\r
95 was specified by the user or not. It would be great if the option parser\r
96 could provide this information, but it might take a while to get\r
97 there... In the mean time, I think I would rather see a well commented\r
98 local hack here initializing the notmuch_bool_t params.entire_thread to\r
99 -1, and changing it to TRUE or FALSE if not already done so by\r
100 parse_arguments().\r
101 \r
102 \r
103 BR,\r
104 Jani.\r
105 \r
106 \r
107\r
108 > Best wishes\r
109\r
110 > Mark\r
111\r
112 > Mark Walters (2):\r
113 >   cli: Parsing. Add option NOTMUCH_OPT_INT_OR_BOOLEAN\r
114 >   cli: make --entire-thread option notmuch-show.c INT_OR_BOOLEAN\r
115\r
116 >  command-line-arguments.c |   29 +++++++++++++++++++++++++++--\r
117 >  command-line-arguments.h |    3 +++\r
118 >  notmuch-show.c           |   10 ++++++++--\r
119 >  3 files changed, 38 insertions(+), 4 deletions(-)\r
120\r
121 > -- \r
122 > 1.7.9.1\r
123\r
124 > _______________________________________________\r
125 > notmuch mailing list\r
126 > notmuch@notmuchmail.org\r
127 > http://notmuchmail.org/mailman/listinfo/notmuch\r