"snoozing" with notmuch?
[notmuch-archives.git] / 72 / 90ae6a98e32269b5c0dd9e1abb07871b4267d9
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 BD178429E4D\r
6         for <notmuch@notmuchmail.org>; Mon, 16 Jan 2012 03:43:30 -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 zlpP47owpJcj for <notmuch@notmuchmail.org>;\r
16         Mon, 16 Jan 2012 03:43:30 -0800 (PST)\r
17 Received: from mail-we0-f181.google.com (mail-we0-f181.google.com\r
18         [74.125.82.181]) (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 EC163429E4A\r
21         for <notmuch@notmuchmail.org>; Mon, 16 Jan 2012 03:43:29 -0800 (PST)\r
22 Received: by werh12 with SMTP id h12so1356403wer.26\r
23         for <notmuch@notmuchmail.org>; Mon, 16 Jan 2012 03:43:28 -0800 (PST)\r
24 Received: by 10.216.139.205 with SMTP id c55mr4753005wej.31.1326714208573;\r
25         Mon, 16 Jan 2012 03:43:28 -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 l8sm19011984wiy.5.2012.01.16.03.43.26\r
29         (version=TLSv1/SSLv3 cipher=OTHER);\r
30         Mon, 16 Jan 2012 03:43:27 -0800 (PST)\r
31 Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000)\r
32         id 4B4AA9FD88; Mon, 16 Jan 2012 11:43:25 +0000 (GMT)\r
33 To: Pieter Praet <pieter@praet.org>,\r
34         Jameson Graef Rollins <jrollins@finestructure.net>\r
35 Subject: Re: [PATCH 2/3] emacs: `notmuch-show-buttonize-links' only\r
36         `notmuch-show's a message if it exists\r
37 In-Reply-To: <1326389025-18877-2-git-send-email-pieter@praet.org>\r
38 References: <874nw0ltwz.fsf@praet.org>\r
39         <1326389025-18877-1-git-send-email-pieter@praet.org>\r
40         <1326389025-18877-2-git-send-email-pieter@praet.org>\r
41 User-Agent: Notmuch/0.11+64~g42e8f66 (http://notmuchmail.org) Emacs/24.0.92.1\r
42         (x86_64-pc-linux-gnu)\r
43 From: David Edmondson <dme@dme.org>\r
44 Date: Mon, 16 Jan 2012 11:43:25 +0000\r
45 Message-ID: <cun7h0r50v6.fsf@hotblack-desiato.hh.sledj.net>\r
46 MIME-Version: 1.0\r
47 Content-Type: multipart/signed; boundary="=-=-=";\r
48         micalg=pgp-sha1; protocol="application/pgp-signature"\r
49 Cc: Notmuch Mail <notmuch@notmuchmail.org>\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: Mon, 16 Jan 2012 11:43:30 -0000\r
63 \r
64 --=-=-=\r
65 Content-Type: text/plain\r
66 \r
67 On Thu, 12 Jan 2012 18:23:44 +0100, Pieter Praet <pieter@praet.org> wrote:\r
68 > +      (make-text-button string-start string-end\r
69 >                       'action `(lambda (arg)\r
70 > -                                (notmuch-show ,(match-string-no-properties 0)))\r
71 > +                                (notmuch-show-if-found ,message-id))\r
72 \r
73 I like this, but wonder idly about the performance impact (not enough to\r
74 suggest denying it, though).\r
75 \r
76 > +(defun notmuch-show-found-target-p (target)\r
77 > +  (let ((args `("count" ,target)))\r
78 > +    (> (string-to-number (substring\r
79 > +      (with-output-to-string\r
80 > +        (apply 'call-process notmuch-command nil standard-output nil args))\r
81 > +      0 -1)) 0)))\r
82 \r
83 `substring' seems unnecessary, presuming that it's to get rid of the\r
84 carriage return.\r
85 \r
86 > +(defun notmuch-show-if-found (target &rest args)\r
87 > +  (if (notmuch-show-found-target-p target nil)\r
88 > +      (notmuch-show target args)\r
89 > +    (error (format "Can't find target: %s" target))))\r
90 \r
91 `error' will format strings without help.\r
92 \r
93 --=-=-=\r
94 Content-Type: application/pgp-signature\r
95 \r
96 -----BEGIN PGP SIGNATURE-----\r
97 Version: GnuPG v1.4.11 (GNU/Linux)\r
98 \r
99 iEYEARECAAYFAk8UDV0ACgkQaezQq/BJZRYJCwCdEkfK7yTRdmrdlrPEFZ46S66t\r
100 R0oAnAuXhl6ns+eRsCE2Om9JDH49pCe+\r
101 =BLek\r
102 -----END PGP SIGNATURE-----\r
103 --=-=-=--\r