Re: [PATCH 9/9] add has: query prefix to search for specific properties
[notmuch-archives.git] / c4 / 89dd5c0150d15360026de247bf012f0153281d
1 Return-Path: <dme@dme.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 EECEE429E35\r
6         for <notmuch@notmuchmail.org>; Tue, 17 Jan 2012 01:14:12 -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 DCpJ1cWYtlsl for <notmuch@notmuchmail.org>;\r
16         Tue, 17 Jan 2012 01:14:12 -0800 (PST)\r
17 Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com\r
18  [74.125.82.45])        (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
19  certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
20  59726429E2F    for <notmuch@notmuchmail.org>; Tue, 17 Jan 2012 01:14:12 -0800\r
21  (PST)\r
22 Received: by wgbdr13 with SMTP id dr13so1013590wgb.2\r
23         for <notmuch@notmuchmail.org>; Tue, 17 Jan 2012 01:14:11 -0800 (PST)\r
24 Received: by 10.180.24.105 with SMTP id t9mr26293623wif.19.1326791651183;\r
25         Tue, 17 Jan 2012 01:14:11 -0800 (PST)\r
26 Received: from hotblack-desiato.hh.sledj.net\r
27         (host81-149-164-25.in-addr.btopenworld.com. [81.149.164.25])\r
28         by mx.google.com with ESMTPS id ex2sm41915116wib.1.2012.01.17.01.14.08\r
29         (version=TLSv1/SSLv3 cipher=OTHER);\r
30         Tue, 17 Jan 2012 01:14:09 -0800 (PST)\r
31 Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000)\r
32         id B1E8DA0048; Tue, 17 Jan 2012 09:14:07 +0000 (GMT)\r
33 To: Aaron Ecay <aaronecay@gmail.com>\r
34 Subject: Re: [PATCH] emacs: Improved printing support.\r
35 In-Reply-To: <m2vcobbaol.fsf@gmail.com>\r
36 References: <1325240897-27525-1-git-send-email-dme@dme.org>\r
37         <1325599946-5936-1-git-send-email-dme@dme.org>\r
38         <m2vcobbaol.fsf@gmail.com>\r
39 User-Agent: Notmuch/0.11+64~g42e8f66 (http://notmuchmail.org) Emacs/24.0.92.1\r
40         (x86_64-pc-linux-gnu)\r
41 From: David Edmondson <dme@dme.org>\r
42 Date: Tue, 17 Jan 2012 09:14:07 +0000\r
43 Message-ID: <cunk44qr8rk.fsf@hotblack-desiato.hh.sledj.net>\r
44 MIME-Version: 1.0\r
45 Content-Type: multipart/signed; boundary="=-=-=";\r
46         micalg=pgp-sha1; protocol="application/pgp-signature"\r
47 Cc: notmuch <notmuch@notmuchmail.org>\r
48 X-BeenThere: notmuch@notmuchmail.org\r
49 X-Mailman-Version: 2.1.13\r
50 Precedence: list\r
51 List-Id: "Use and development of the notmuch mail system."\r
52         <notmuch.notmuchmail.org>\r
53 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
54         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
55 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
56 List-Post: <mailto:notmuch@notmuchmail.org>\r
57 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
58 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
59         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
60 X-List-Received-Date: Tue, 17 Jan 2012 09:14:13 -0000\r
61 \r
62 --=-=-=\r
63 Content-Type: text/plain; charset=utf-8\r
64 Content-Transfer-Encoding: quoted-printable\r
65 \r
66 On Mon, 16 Jan 2012 16:27:06 -0500, Aaron Ecay <aaronecay@gmail.com> wrote:\r
67 > > +;;\r
68 >=20\r
69 > The above is just a stray comment line, right?\r
70 \r
71 I tend to use them as spacers, but, sure.\r
72 \r
73 > > +(defun notmuch-show-with-message-as-text (fn)\r
74 > > +  "Apply function `fn' to a text representation of the current\r
75 > > +message."\r
76 >=20\r
77 > I think the docstring should say what agrs get passed to =E2=80=98fn=E2=\r
78 =80=99.  Also,\r
79 > function arguments should be referred to with capital letters, and the\r
80 > first line should be a complete sentence.  I=E2=80=99d recommend =E2=80=\r
81 =9CApply FN to\r
82 > (...the rest unchanged)=E2=80=9D for brevity in the first line.\r
83 >=20\r
84 > (For anyone who is curious, these and other conventions are documented\r
85 > in section D.6 of the Elisp manual.)\r
86 \r
87 Will fix.\r
88 > > +                 (concat "Tags: "\r
89 > > +                         (mapconcat '(lambda (tag) tag) tags ", ") "\n")\r
90 >=20\r
91 > #'identity instead of the lambda\r
92 \r
93 /me slaps head. What was I thinking?\r
94 \r
95 > > +    (all (buffer-substring (notmuch-show-message-top)\r
96 > > +                           (notmuch-show-message-bottom)))\r
97 > > +\r
98 > > +    (file (make-temp-file "notmuch")))\r
99 > > +    (with-temp-file file\r
100 > > +      (insert all)\r
101 > > +      (indent-rigidly (point-min) (point-max) (- depth))\r
102 > > +      ;; Remove the original header.\r
103 > > +      (goto-char (point-min))\r
104 > > +      (re-search-forward "^$" (point-max) nil)\r
105 > > +      (delete-region (point-min) (point))\r
106 > > +      (insert header))\r
107 > > +    (funcall fn file (notmuch-show-get-message-properties))\r
108 > > +    (delete-file file)))\r
109 >=20\r
110 > Why does this function write to a file?  It seems that, of the print\r
111 > methods, two (ps-print and lpr) don=E2=80=99t use the file at all.  One\r
112 > (ps-print/evince) creates yet another file, without depending on the\r
113 > first.  The other muttprint functions do use the file.  So:\r
114 > - This function would be more general if it didn=E2=80=99t handle file-wr=\r
115 iting\r
116 >   itself, but rather let each consumer of text-ified messages handle\r
117 >   that if needed.\r
118 > - It would be cleaner if print backends that don=E2=80=99t crucially depe=\r
119 nd on\r
120 >   the existence of a file didn=E2=80=99t create one at all.  If muttprint=\r
121  can\r
122 >   accept a message on stdin (it looks from the source like it can; it\r
123 >   gives me some error message about Iconv Perl modules when I try to run\r
124 >   it, so I can=E2=80=99t be sure), maybe writing to a file isn=E2=80=99t =\r
125 necessary at\r
126 >   all.\r
127 \r
128 I'll rework it, thanks for the review!\r
129 \r
130 --=-=-=\r
131 Content-Type: application/pgp-signature\r
132 \r
133 -----BEGIN PGP SIGNATURE-----\r
134 Version: GnuPG v1.4.11 (GNU/Linux)\r
135 \r
136 iEYEARECAAYFAk8VO98ACgkQaezQq/BJZRZ8IwCghNfw/w0mKjnD8UbSAj7z7t5w\r
137 9CQAn1KdZZIqPT59rZ/FNUTVC7+k9lSR\r
138 =wzL6\r
139 -----END PGP SIGNATURE-----\r
140 --=-=-=--\r