1 Return-Path: <pieter@praet.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 696AA431FAF
\r
6 for <notmuch@notmuchmail.org>; Mon, 16 Jan 2012 08:51:34 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\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 va+ZZVWus2Oj for <notmuch@notmuchmail.org>;
\r
16 Mon, 16 Jan 2012 08:51:28 -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 4AA1B431FAE
\r
21 for <notmuch@notmuchmail.org>; Mon, 16 Jan 2012 08:51:28 -0800 (PST)
\r
22 Received: by werb13 with SMTP id b13so3677wer.26
\r
23 for <notmuch@notmuchmail.org>; Mon, 16 Jan 2012 08:51:27 -0800 (PST)
\r
24 Received: by 10.216.139.25 with SMTP id b25mr2635152wej.28.1326732687026;
\r
25 Mon, 16 Jan 2012 08:51:27 -0800 (PST)
\r
26 Received: from localhost ([109.131.75.86])
\r
27 by mx.google.com with ESMTPS id fy5sm35020711wib.7.2012.01.16.08.51.25
\r
28 (version=TLSv1/SSLv3 cipher=OTHER);
\r
29 Mon, 16 Jan 2012 08:51:26 -0800 (PST)
\r
30 From: Pieter Praet <pieter@praet.org>
\r
31 To: David Edmondson <dme@dme.org>,
\r
32 Jameson Graef Rollins <jrollins@finestructure.net>
\r
33 Subject: Re: [PATCH 2/3] emacs: `notmuch-show-buttonize-links' only
\r
34 `notmuch-show's a message if it exists
\r
35 In-Reply-To: <cun7h0r50v6.fsf@hotblack-desiato.hh.sledj.net>
\r
36 References: <874nw0ltwz.fsf@praet.org>
\r
37 <1326389025-18877-1-git-send-email-pieter@praet.org>
\r
38 <1326389025-18877-2-git-send-email-pieter@praet.org>
\r
39 <cun7h0r50v6.fsf@hotblack-desiato.hh.sledj.net>
\r
40 User-Agent: Notmuch/0.11+78~g6c58370 (http://notmuchmail.org) Emacs/23.3.1
\r
41 (x86_64-unknown-linux-gnu)
\r
42 Date: Mon, 16 Jan 2012 17:49:42 +0100
\r
43 Message-ID: <87lip7a8yh.fsf@praet.org>
\r
45 Content-Type: text/plain; charset=us-ascii
\r
46 Cc: Notmuch Mail <notmuch@notmuchmail.org>
\r
47 X-BeenThere: notmuch@notmuchmail.org
\r
48 X-Mailman-Version: 2.1.13
\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: Mon, 16 Jan 2012 16:51:34 -0000
\r
61 On Mon, 16 Jan 2012 11:43:25 +0000, David Edmondson <dme@dme.org> wrote:
\r
62 > On Thu, 12 Jan 2012 18:23:44 +0100, Pieter Praet <pieter@praet.org> wrote:
\r
63 > > + (make-text-button string-start string-end
\r
64 > > 'action `(lambda (arg)
\r
65 > > - (notmuch-show ,(match-string-no-properties 0)))
\r
66 > > + (notmuch-show-if-found ,message-id))
\r
68 > I like this, but wonder idly about the performance impact (not enough to
\r
69 > suggest denying it, though).
\r
72 Hardly noticable (if at all) AFAICT, but yeah, it *does* cost one
\r
73 extra notmuch(1) invocation at every `push-button' event...
\r
75 Still, rather that than potentially dumping users in a blank screen IMO.
\r
77 Can't think of a better solution ATM.
\r
79 > > +(defun notmuch-show-found-target-p (target)
\r
80 > > + (let ((args `("count" ,target)))
\r
81 > > + (> (string-to-number (substring
\r
82 > > + (with-output-to-string
\r
83 > > + (apply 'call-process notmuch-command nil standard-output nil args))
\r
86 > `substring' seems unnecessary, presuming that it's to get rid of the
\r
90 Correct. Mindless proactiveness, I guess :) Removed.
\r
92 > > +(defun notmuch-show-if-found (target &rest args)
\r
93 > > + (if (notmuch-show-found-target-p target nil)
\r
94 > > + (notmuch-show target args)
\r
95 > > + (error (format "Can't find target: %s" target))))
\r
97 > `error' will format strings without help.
\r