Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 66 / 8c643aa070e2edb19294437250b3bb8dcfeb7d
1 Return-Path: <tomi.ollila@iki.fi>\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 1EE03431FAF\r
6         for <notmuch@notmuchmail.org>; Wed,  5 Nov 2014 12:50:14 -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\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         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 VxWAGAte-jxM for <notmuch@notmuchmail.org>;\r
16         Wed,  5 Nov 2014 12:50:06 -0800 (PST)\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
18         by olra.theworths.org (Postfix) with ESMTP id 84823431FAE\r
19         for <notmuch@notmuchmail.org>; Wed,  5 Nov 2014 12:50:06 -0800 (PST)\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
21         by guru.guru-group.fi (Postfix) with ESMTP id AFEC1100033;\r
22         Wed,  5 Nov 2014 22:49:29 +0200 (EET)\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>\r
24 To: Michal Sojka <sojkam1@fel.cvut.cz>, notmuch@notmuchmail.org\r
25 Subject: Re: [PATCH v3 06/10] cli: Introduce "notmuch address" command\r
26 In-Reply-To: <1415147159-19946-7-git-send-email-sojkam1@fel.cvut.cz>\r
27 References: <1415147159-19946-1-git-send-email-sojkam1@fel.cvut.cz>\r
28         <1415147159-19946-7-git-send-email-sojkam1@fel.cvut.cz>\r
29 User-Agent: Notmuch/0.18.2+169~g5bcdd1c (http://notmuchmail.org) Emacs/24.3.1\r
30         (x86_64-unknown-linux-gnu)\r
31 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
32         $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
33         !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
34 Date: Wed, 05 Nov 2014 22:49:29 +0200\r
35 Message-ID: <m24mud1ig6.fsf@guru.guru-group.fi>\r
36 MIME-Version: 1.0\r
37 Content-Type: text/plain\r
38 X-BeenThere: notmuch@notmuchmail.org\r
39 X-Mailman-Version: 2.1.13\r
40 Precedence: list\r
41 List-Id: "Use and development of the notmuch mail system."\r
42         <notmuch.notmuchmail.org>\r
43 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
44         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
45 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
46 List-Post: <mailto:notmuch@notmuchmail.org>\r
47 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
48 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
49         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
50 X-List-Received-Date: Wed, 05 Nov 2014 20:50:14 -0000\r
51 \r
52 On Wed, Nov 05 2014, Michal Sojka <sojkam1@fel.cvut.cz> wrote:\r
53 \r
54 > This moves address-related functionality from search command to the\r
55 > new address command. The implementation shares almost all code and\r
56 > some command line options.\r
57 >\r
58 > Options --offset and --limit were intentionally not included in the\r
59 > address command, because they refer to messages numbers, which users\r
60 > do not see in the output. This could confuse users because, for\r
61 > example, they could see more addresses in the output that what was\r
62 > specified with --limit. This functionality can be correctly\r
63 > reimplemented for address subcommand later.\r
64 >\r
65 > Also useless values of --exclude flag were not included in the address\r
66 > command.\r
67 >\r
68 > This was inspired by a patch from Jani Nikula.\r
69 > ---\r
70 >  completion/notmuch-completion.bash | 42 ++++++++++++++++-\r
71 >  completion/notmuch-completion.zsh  | 10 +++-\r
72 >  doc/man1/notmuch-address.rst       | 89 ++++++++++++++++++++++++++++++++++++\r
73 >  doc/man1/notmuch-search.rst        | 20 +-------\r
74 >  doc/man1/notmuch.rst               |  7 +--\r
75 >  notmuch-client.h                   |  3 ++\r
76 >  notmuch-search.c                   | 93 +++++++++++++++++++++++++++-----------\r
77 >  notmuch.c                          |  2 +\r
78 >  8 files changed, 216 insertions(+), 50 deletions(-)\r
79 >  create mode 100644 doc/man1/notmuch-address.rst\r
80 >\r
81 > [ nnn lines removed ]\r
82 >\r
83 > +\r
84 > +int\r
85 > +notmuch_address_command (notmuch_config_t *config, int argc, char *argv[])\r
86 > +{\r
87 > +    search_context_t *ctx = &search_context;\r
88 > +    int opt_index, ret;\r
89 > +\r
90 > +    notmuch_opt_desc_t options[] = {\r
91 > +     { NOTMUCH_OPT_KEYWORD_FLAGS, &ctx->output, "output", 'o',\r
92 > +       (notmuch_keyword_t []){ { "sender", OUTPUT_SENDER },\r
93 > +                               { "recipients", OUTPUT_RECIPIENTS },\r
94 > +                               { 0, 0 } } },\r
95 > +     { NOTMUCH_OPT_KEYWORD, &ctx->exclude, "exclude", 'x',\r
96 > +       (notmuch_keyword_t []){ { "true", NOTMUCH_EXCLUDE_TRUE },\r
97 > +                               { "false", NOTMUCH_EXCLUDE_FALSE },\r
98 > +                               { 0, 0 } } },\r
99 > +     { NOTMUCH_OPT_INHERIT, &common_options, NULL, 0, 0 },\r
100 > +     { 0, 0, 0, 0, 0 }\r
101 > +    };\r
102 > +\r
103 > +    opt_index = parse_arguments (argc, argv, options, 1);\r
104 > +    if (opt_index < 0)\r
105 > +     return EXIT_FAILURE;\r
106 > +\r
107 > +    if (! ctx->output)\r
108 > +     ctx->output = OUTPUT_SENDER | OUTPUT_RECIPIENTS;\r
109 \r
110 If no --output options are given, the default could be just\r
111 to OUTPUT_SENDER (for the speed and as this behaviour is not documented) \r
112 \r
113 (this can be also addressed in later patch, provided that this\r
114 functionality gets more "votes" from the community)\r
115 \r
116 Tomi\r
117 \r
118 > +\r
119 > +    if (_notmuch_search_prepare (ctx, config,\r
120 > +                              argc - opt_index, argv + opt_index))\r
121 > +     return EXIT_FAILURE;\r
122 > +\r
123 > +    ret = do_search_messages (ctx);\r
124 > +\r
125 > +    _notmuch_search_cleanup (ctx);\r
126 > +\r
127 > +    return ret ? EXIT_FAILURE : EXIT_SUCCESS;\r
128 > +}\r