Re: [PATCH] emacs: add buttons for all multipart/related parts
[notmuch-archives.git] / e1 / 6d64f5c7e98fe59e5b65de82004564d772cd54
1 Return-Path: <novalazy@gmail.com>\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 084C5431FC0\r
6         for <notmuch@notmuchmail.org>; Tue, 20 Mar 2012 15:34:22 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.799\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id vNUzpR7aR9AA for <notmuch@notmuchmail.org>;\r
17         Tue, 20 Mar 2012 15:34:21 -0700 (PDT)\r
18 Received: from mail-pz0-f53.google.com (mail-pz0-f53.google.com\r
19         [209.85.210.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 81C49431FAE\r
22         for <notmuch@notmuchmail.org>; Tue, 20 Mar 2012 15:34:21 -0700 (PDT)\r
23 Received: by dady25 with SMTP id y25so706824dad.26\r
24         for <notmuch@notmuchmail.org>; Tue, 20 Mar 2012 15:34:20 -0700 (PDT)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
26         h=from:to:cc:subject:date:message-id:x-mailer;\r
27         bh=ocv2j0ru7M3tdr3oaEIqKsmR2AMoEGP9+z2on4B6kHo=;\r
28         b=FgM6c3lCHNApHFm0L8oXUf803cirwUIn6J3kJHnmMuJgaL4ZuxD75qlR4vb3su08SW\r
29         +u6TK5VCXkWh3bBBVwcm3aIhoo8IhTCkfJ1LB2lskz+miRN0GuEma54Hm5GjVW6zEa49\r
30         oc5JRi7z0MiY53hUDTBc0qd5R9hv/Ki3O6bZ1MBR4yOlZbTeaS4MM+BVLMQHScnTkZ8K\r
31         ZEgk5LsKnCIuTEelDLlp+wA+yjjb2TkdwhUS2LMzNhvnwsuM1eajj4z0Bu9Q/fN1Y36v\r
32         3o+w0cX7CllhdmlQg9vFdWfyp+9GACLZdqe/J1MB13EC6HfOk0jteDEwE6Q1vRrJLDeG\r
33         lCoA==\r
34 Received: by 10.68.233.168 with SMTP id tx8mr5134911pbc.72.1332282860328;\r
35         Tue, 20 Mar 2012 15:34:20 -0700 (PDT)\r
36 Received: from localhost (215.42.233.220.static.exetel.com.au.\r
37         [220.233.42.215])\r
38         by mx.google.com with ESMTPS id f5sm2180693pbe.26.2012.03.20.15.34.17\r
39         (version=TLSv1/SSLv3 cipher=OTHER);\r
40         Tue, 20 Mar 2012 15:34:19 -0700 (PDT)\r
41 From: Peter Wang <novalazy@gmail.com>\r
42 To: notmuch@notmuchmail.org\r
43 Subject: [PATCH 1/2] config: Add 'config list' command\r
44 Date: Wed, 21 Mar 2012 09:31:37 +1100\r
45 Message-Id: <1332282698-7951-1-git-send-email-novalazy@gmail.com>\r
46 X-Mailer: git-send-email 1.7.4.4\r
47 X-BeenThere: notmuch@notmuchmail.org\r
48 X-Mailman-Version: 2.1.13\r
49 Precedence: list\r
50 List-Id: "Use and development of the notmuch mail system."\r
51         <notmuch.notmuchmail.org>\r
52 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
53         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
54 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
55 List-Post: <mailto:notmuch@notmuchmail.org>\r
56 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
57 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
58         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
59 X-List-Received-Date: Tue, 20 Mar 2012 22:34:22 -0000\r
60 \r
61 Add a command to list all keys in a given configuration section.\r
62 \r
63 One use is as follows: a MUA may prefer to store data in a central\r
64 notmuch configuration file so that the data is accessible across\r
65 different machines, e.g. an addressbook.  The list command helps\r
66 to implement features such as tab completion on the keys.\r
67 ---\r
68  notmuch-config.c |   27 +++++++++++++++++++++++++++\r
69  1 files changed, 27 insertions(+), 0 deletions(-)\r
70 \r
71 diff --git a/notmuch-config.c b/notmuch-config.c\r
72 index e9b2750..595cf54 100644\r
73 --- a/notmuch-config.c\r
74 +++ b/notmuch-config.c\r
75 @@ -799,6 +799,31 @@ notmuch_config_command_set (void *ctx, char *item, int argc, char *argv[])\r
76      return ret;\r
77  }\r
78  \r
79 +static int\r
80 +notmuch_config_command_list (void *ctx, char *group)\r
81 +{\r
82 +    notmuch_config_t *config;\r
83 +    char **keys;\r
84 +    size_t i, length;\r
85 +\r
86 +    config = notmuch_config_open (ctx, NULL, NULL);\r
87 +    if (config == NULL)\r
88 +       return 1;\r
89 +\r
90 +    keys = g_key_file_get_keys (config->key_file,\r
91 +                               group, &length, NULL);\r
92 +    if (keys != NULL) {\r
93 +       for (i = 0; i < length; i++)\r
94 +           printf ("%s\n", keys[i]);\r
95 +\r
96 +       free (keys);\r
97 +    }\r
98 +\r
99 +    notmuch_config_close (config);\r
100 +\r
101 +    return 0;\r
102 +}\r
103 +\r
104  int\r
105  notmuch_config_command (void *ctx, int argc, char *argv[])\r
106  {\r
107 @@ -813,6 +838,8 @@ notmuch_config_command (void *ctx, int argc, char *argv[])\r
108         return notmuch_config_command_get (ctx, argv[1]);\r
109      else if (strcmp (argv[0], "set") == 0)\r
110         return notmuch_config_command_set (ctx, argv[1], argc - 2, argv + 2);\r
111 +    else if (strcmp (argv[0], "list") == 0)\r
112 +       return notmuch_config_command_list (ctx, argv[1]);\r
113  \r
114      fprintf (stderr, "Unrecognized argument for notmuch config: %s\n",\r
115              argv[0]);\r
116 -- \r
117 1.7.4.4\r
118 \r