Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / d7 / 81be28dd558f54be0644de225db8bc6d5683bf
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 601A3431FB6\r
6         for <notmuch@notmuchmail.org>; Thu,  6 Dec 2012 14:30:05 -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 yQxdTGsctFB8 for <notmuch@notmuchmail.org>;\r
16         Thu,  6 Dec 2012 14:30:05 -0800 (PST)\r
17 Received: from mail-la0-f53.google.com (mail-la0-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 A9FCF431FAE\r
21         for <notmuch@notmuchmail.org>; Thu,  6 Dec 2012 14:30:04 -0800 (PST)\r
22 Received: by mail-la0-f53.google.com with SMTP id w12so5835867lag.26\r
23         for <notmuch@notmuchmail.org>; Thu, 06 Dec 2012 14:30:03 -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:cc:subject:date:message-id:x-mailer:x-gm-message-state;\r
27         bh=ivJzNGYJ+2ho34b0H5sBN4Tn7tXpK1wyuttWWWDbJ3k=;\r
28         b=CImAD2A5NSKaCtZRXWf3Qte4ZfckUqiPjWh6/obZ6pFsT5klCyEr/A1g+k1U+CuSnv\r
29         74C0aywwunK7WiqMcFpCztYnj/03Plqrs6HSTFpgl/RfyN83gFVqjsrHKTUmNVvT444N\r
30         n0t5QNJt/eqhEsm7z49UUXG5nKuBXzeLX5cRkVokSi4NP2u7vqzTPvoRGe3Ndj715f0d\r
31         ZcNo/X+ZGf5E7V2K8TzGn6ZxSpWI9ZE3JCTN5sEE08Pm2ii3eE/HwAxml6YOZ9uCaKU3\r
32         oYljtgjJEzx3Yg9+vhkMGBRzHCQohptpGyZ05cAAikqvsudgN8vnRptl451rYtPZBW5i\r
33         PTHA==\r
34 Received: by 10.152.105.68 with SMTP id gk4mr3375775lab.48.1354833001821;\r
35         Thu, 06 Dec 2012 14:30:01 -0800 (PST)\r
36 Received: from localhost (dsl-hkibrasgw4-fe51df00-27.dhcp.inet.fi.\r
37         [80.223.81.27])\r
38         by mx.google.com with ESMTPS id pw17sm3924175lab.5.2012.12.06.14.29.59\r
39         (version=SSLv3 cipher=OTHER); Thu, 06 Dec 2012 14:30:00 -0800 (PST)\r
40 From: Jani Nikula <jani@nikula.org>\r
41 To: notmuch@notmuchmail.org\r
42 Subject: [PATCH 1/2] sprinter: add text0 formatter for null character\r
43         separated text\r
44 Date: Fri,  7 Dec 2012 00:29:57 +0200\r
45 Message-Id:\r
46  <30f03a18ed10c221c13b6672f90654963c76452d.1354832980.git.jani@nikula.org>\r
47 X-Mailer: git-send-email 1.7.10.4\r
48 X-Gm-Message-State:\r
49  ALoCoQmQpnigYXJ2Vi5ev3kCONReBwMqdJUl0XWI6qCzRXnFh7JE6hNOJ8aLKP7Dos4Cco6Ia3af\r
50 X-BeenThere: notmuch@notmuchmail.org\r
51 X-Mailman-Version: 2.1.13\r
52 Precedence: list\r
53 List-Id: "Use and development of the notmuch mail system."\r
54         <notmuch.notmuchmail.org>\r
55 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
56         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
57 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
58 List-Post: <mailto:notmuch@notmuchmail.org>\r
59 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
60 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
61         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
62 X-List-Received-Date: Thu, 06 Dec 2012 22:30:05 -0000\r
63 \r
64 Same as the text formatter, but with each field separated by a null\r
65 character rather than a newline character.\r
66 ---\r
67  sprinter-text.c |   22 ++++++++++++++++++++++\r
68  sprinter.h      |    6 ++++++\r
69  2 files changed, 28 insertions(+)\r
70 \r
71 diff --git a/sprinter-text.c b/sprinter-text.c\r
72 index 10343be..7779488 100644\r
73 --- a/sprinter-text.c\r
74 +++ b/sprinter-text.c\r
75 @@ -68,6 +68,14 @@ text_separator (struct sprinter *sp)\r
76  }\r
77  \r
78  static void\r
79 +text0_separator (struct sprinter *sp)\r
80 +{\r
81 +    struct sprinter_text *sptxt = (struct sprinter_text *) sp;\r
82 +\r
83 +    fputc ('\0', sptxt->stream);\r
84 +}\r
85 +\r
86 +static void\r
87  text_set_prefix (struct sprinter *sp, const char *prefix)\r
88  {\r
89      struct sprinter_text *sptxt = (struct sprinter_text *) sp;\r
90 @@ -133,3 +141,17 @@ sprinter_text_create (const void *ctx, FILE *stream)\r
91      res->stream = stream;\r
92      return &res->vtable;\r
93  }\r
94 +\r
95 +struct sprinter *\r
96 +sprinter_text0_create (const void *ctx, FILE *stream)\r
97 +{\r
98 +    struct sprinter *sp;\r
99 +\r
100 +    sp = sprinter_text_create (ctx, stream);\r
101 +    if (! sp)\r
102 +       return NULL;\r
103 +\r
104 +    sp->separator = text0_separator;\r
105 +\r
106 +    return sp;\r
107 +}\r
108 diff --git a/sprinter.h b/sprinter.h\r
109 index 912a526..74e7fec 100644\r
110 --- a/sprinter.h\r
111 +++ b/sprinter.h\r
112 @@ -66,6 +66,12 @@ typedef struct sprinter {\r
113  struct sprinter *\r
114  sprinter_text_create (const void *ctx, FILE *stream);\r
115  \r
116 +/* Create a new unstructured printer that emits the text format for\r
117 + * "notmuch search", with each field separated by a null character\r
118 + * instead of the newline character. */\r
119 +struct sprinter *\r
120 +sprinter_text0_create (const void *ctx, FILE *stream);\r
121 +\r
122  /* Create a new structure printer that emits JSON. */\r
123  struct sprinter *\r
124  sprinter_json_create (const void *ctx, FILE *stream);\r
125 -- \r
126 1.7.10.4\r
127 \r