Re: Avoiding the "huge INBOX of death"
[notmuch-archives.git] / dc / 8a1259c7bef21d567f4fa043f12e396f3e07ce
1 Return-Path: <m.walters@qmul.ac.uk>\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 AC07B431FAF\r
6         for <notmuch@notmuchmail.org>; Sun,  6 Jan 2013 07:43:41 -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: -1.098\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5\r
12         tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,\r
13         NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] 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 hGEIwkuMZLTk for <notmuch@notmuchmail.org>;\r
17         Sun,  6 Jan 2013 07:43:40 -0800 (PST)\r
18 Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])\r
19         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 2130D431FAE\r
22         for <notmuch@notmuchmail.org>; Sun,  6 Jan 2013 07:43:40 -0800 (PST)\r
23 Received: from smtp.qmul.ac.uk ([138.37.6.40])\r
24         by mail2.qmul.ac.uk with esmtp (Exim 4.71)\r
25         (envelope-from <m.walters@qmul.ac.uk>)\r
26         id 1TrsNo-0001Ae-Jk; Sun, 06 Jan 2013 15:43:33 +0000\r
27 Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost)\r
28         by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69)\r
29         (envelope-from <m.walters@qmul.ac.uk>)\r
30         id 1TrsNo-0005zL-9d; Sun, 06 Jan 2013 15:43:32 +0000\r
31 From: Mark Walters <markwalters1009@gmail.com>\r
32 To: Tomi Ollila <tomi.ollila@iki.fi>, David Bremner <david@tethera.net>,\r
33         notmuch@notmuchmail.org\r
34 Subject: Re: [PATCH] emacs: show: make id links respect window\r
35 In-Reply-To: <m2zk0ni9jg.fsf@guru.guru-group.fi>\r
36 References: <1355958602-16752-1-git-send-email-markwalters1009@gmail.com>\r
37         <87bodjfnt0.fsf@zancas.localnet> <87mwx2jsu0.fsf@qmul.ac.uk>\r
38         <87bodgrh6a.fsf@zancas.localnet>\r
39         <m2zk0ni9jg.fsf@guru.guru-group.fi>\r
40 User-Agent: Notmuch/0.14+236~g1d0044f (http://notmuchmail.org) Emacs/23.4.1\r
41         (x86_64-pc-linux-gnu)\r
42 Date: Sun, 06 Jan 2013 15:43:35 +0000\r
43 Message-ID: <87k3rqz594.fsf@qmul.ac.uk>\r
44 MIME-Version: 1.0\r
45 Content-Type: text/plain; charset=us-ascii\r
46 X-Sender-Host-Address: 93.97.24.31\r
47 X-QM-SPAM-Info: Sender has good ham record.  :)\r
48 X-QM-Body-MD5: 98603f3e42f2273d9f40b14ec3035a33 (of first 20000 bytes)\r
49 X-SpamAssassin-Score: -1.8\r
50 X-SpamAssassin-SpamBar: -\r
51 X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
52         determine if it is\r
53         spam. We require at least 5.0 points to mark a message as spam.\r
54         This message scored -1.8 points.\r
55         Summary of the scoring: \r
56         * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/,\r
57         *      medium trust\r
58         *      [138.37.6.40 listed in list.dnswl.org]\r
59         * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
60         provider *      (markwalters1009[at]gmail.com)\r
61         *  0.5 AWL AWL: From: address is in the auto white-list\r
62 X-QM-Scan-Virus: ClamAV says the message is clean\r
63 X-BeenThere: notmuch@notmuchmail.org\r
64 X-Mailman-Version: 2.1.13\r
65 Precedence: list\r
66 List-Id: "Use and development of the notmuch mail system."\r
67         <notmuch.notmuchmail.org>\r
68 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
69         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
70 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
71 List-Post: <mailto:notmuch@notmuchmail.org>\r
72 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
73 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
74         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
75 X-List-Received-Date: Sun, 06 Jan 2013 15:43:41 -0000\r
76 \r
77 \r
78 On Sat, 05 Jan 2013, Tomi Ollila <tomi.ollila@iki.fi> wrote:\r
79 > On Wed, Dec 26 2012, David Bremner <david@tethera.net> wrote:\r
80 >\r
81 >> Mark Walters <markwalters1009@gmail.com> writes:\r
82 >>\r
83 >>>> I can imagine that people would want/like the "open in other window" \r
84 >>>> effect of the current code, even if the reason is a bug.\r
85 >>>\r
86 >>> That's definitely possible. I generally expect a mouse click to select\r
87 >>> the window I click and this feels counter intuitive. I think that some\r
88 >>> people might like an option "open this link in a new window" but I would\r
89 >>> guess that would like that whether they clicked or pressed RET on the\r
90 >>> button.\r
91 >>\r
92 >> I don't care much either way myself, but before we change notmuch-show\r
93 >> behaviour (effectively) to accomodate notmuch-pick, I'd like a bit more\r
94 >> feedback from other people.\r
95 >\r
96 > I tested the old behaviour -- split frame to 2 windows, one containing\r
97 > *scratch* and one *notmuch-hello*. Then I searched for 'obsoletes',\r
98 > chose last message (id:1356936162-2589-1-git-send-email-amdragon@mit.edu)\r
99 > moved point to *scratch* buffer and clicked the id: link -- and indeed,\r
100 > the *scratch* window was replaced.\r
101 >\r
102 > I didn't look or test Mark's patch as he stated:\r
103 > "The lisp is not pretty but seems to work." ;)\r
104 > ... well, not entirely because of that but I trust it opens the message\r
105 > in window where the clicked link were and keeps point where it used to\r
106 > be before clicking (in case point was in different window).\r
107 \r
108 It doesn't quite do this: point moves to the window that was clicked. It\r
109 is just as easy to do as Tomi says (patch below but I should resend if\r
110 people like it so the commit message gets picked up).\r
111 \r
112 Incidentally, I would be interested to know what people expect the\r
113 following to do: go to notmuch hello and then search. Now display the\r
114 results in two windows simultaneously (either split the frame into two\r
115 windows (c-x 2) or use 2 frames (C-x 5 2)) and then press q.\r
116 \r
117 What actually happens is that q runs kill buffer so it disappears in\r
118 both windows: one of which will fall back to notmuch-hello and one of\r
119 which will fall back to some other window (eg scratch)\r
120 \r
121 Best wishes\r
122 \r
123 Mark\r
124 \r
125  emacs/notmuch-show.el |    5 +++++\r
126  1 files changed, 5 insertions(+), 0 deletions(-)\r
127 \r
128 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
129 index 5751d98..00b9b56 100644\r
130 --- a/emacs/notmuch-show.el\r
131 +++ b/emacs/notmuch-show.el\r
132 @@ -1077,6 +1077,11 @@ buttons for a corresponding notmuch search."\r
133         (make-text-button (first link) (second link)\r
134                           'action `(lambda (arg)\r
135                                      (notmuch-show ,(third link)))\r
136 +                         'mouse-action `(lambda (arg)\r
137 +                                          (let* ((event last-input-event)\r
138 +                                                 (window (car (cadr event))))\r
139 +                                            (with-selected-window window\r
140 +                                              (notmuch-show ,(third link)))))\r
141                           'follow-link t\r
142                           'help-echo "Mouse-1, RET: search for this message"\r
143                           'face goto-address-mail-face)))))\r
144 -- \r
145 1.7.9.1\r
146 \r