[Patch v5 6/8] lib: add private function to extract the database for a message.
[notmuch-archives.git] / aa / e1d3b04a72851aaa5bbe3492356788d2deeb83
1 Return-Path: <amdragon@mit.edu>\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 C29FD431FAF\r
6         for <notmuch@notmuchmail.org>; Sun,  6 Jan 2013 23:04:21 -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 imAXnic6kmpw for <notmuch@notmuchmail.org>;\r
16         Sun,  6 Jan 2013 23:04:19 -0800 (PST)\r
17 Received: from dmz-mailsec-scanner-1.mit.edu (DMZ-MAILSEC-SCANNER-1.MIT.EDU\r
18         [18.9.25.12])\r
19         by olra.theworths.org (Postfix) with ESMTP id AF7EE431FAE\r
20         for <notmuch@notmuchmail.org>; Sun,  6 Jan 2013 23:04:19 -0800 (PST)\r
21 X-AuditID: 1209190c-b7fa86d000001d37-34-50ea737249a6\r
22 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])\r
23         by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id E2.53.07479.2737AE05; Mon,  7 Jan 2013 02:04:18 -0500 (EST)\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
26         by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id r0774H4Z026496; \r
27         Mon, 7 Jan 2013 02:04:18 -0500\r
28 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
29         (authenticated bits=0)\r
30         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
31         by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id r0774FCc016660\r
32         (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);\r
33         Mon, 7 Jan 2013 02:04:16 -0500 (EST)\r
34 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80)\r
35         (envelope-from <amdragon@mit.edu>)\r
36         id 1Ts6kp-0005KJ-2y; Mon, 07 Jan 2013 02:04:15 -0500\r
37 From: Austin Clements <amdragon@MIT.EDU>\r
38 To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org\r
39 Subject: Re: [PATCH] emacs: show: make id links respect window\r
40 In-Reply-To: <1355958602-16752-1-git-send-email-markwalters1009@gmail.com>\r
41 References: <1355958602-16752-1-git-send-email-markwalters1009@gmail.com>\r
42 User-Agent: Notmuch/0.14+236~gf64406d (http://notmuchmail.org) Emacs/23.4.1\r
43         (i486-pc-linux-gnu)\r
44 Date: Mon, 07 Jan 2013 02:04:14 -0500\r
45 Message-ID: <87vcb9jwy9.fsf@awakening.csail.mit.edu>\r
46 MIME-Version: 1.0\r
47 Content-Type: text/plain; charset=us-ascii\r
48 X-Brightmail-Tracker:\r
49  H4sIAAAAAAAAA+NgFnrDIsWRmVeSWpSXmKPExsUixCmqrFtU/CrAYNFmQYvVc3ksrt+cyezA\r
50         5LFz1l12j2erbjEHMEVx2aSk5mSWpRbp2yVwZXxacZ2loEGw4vqDP+wNjPN5uxg5OSQETCRe\r
51         rvzPDGGLSVy4t56ti5GLQ0hgH6PEiWUHmCGc9YwSv85+Z4JwLjBJzH4+lx3CWcIo8fL1FbB+\r
52         NgENiW37lzOC2CICrhJPv30GiwsL2Enca53ABmJzCnhJdN1bydrFyAHU7Cnx6rsMSFhUIF7i\r
53         +b1vLCA2i4CqxOnuh2DlvEDnPWvYwAphC0qcnPkErIZZQEvixr+XTBMYBWYhSc1CklrAyLSK\r
54         UTYlt0o3NzEzpzg1Wbc4OTEvL7VI11AvN7NELzWldBMjOCAleXYwvjmodIhRgINRiYf3gsGr\r
55         ACHWxLLiytxDjJIcTEqivMcKgUJ8SfkplRmJxRnxRaU5qcWHGCU4mJVEeHnsgXK8KYmVValF\r
56         +TApaQ4WJXHeyyk3/YUE0hNLUrNTUwtSi2CyMhwcShK8e4uAGgWLUtNTK9Iyc0oQ0kwcnCDD\r
57         eYCGvwGp4S0uSMwtzkyHyJ9i1OVoeHnjKaMQS15+XqqUOO8ekCIBkKKM0jy4ObBE8opRHOgt\r
58         YV5TkCoeYBKCm/QKaAkT0JLUx89BlpQkIqSkGhiD7tYKzGr9/1Gf9+Tpf0FvyuaYT7sh+ddV\r
59         52rmxYiFUnpSl17mv64ROxVvOaPAJNQhtm9DwJUexbgdi4pud3/RFuhhPRF4UC/4dq2AzMuv\r
60         92d9UU2bVBKSdnNlxw5xo+3+1rapbW8Or2XteL/Cc8WDfP04vlDLJyIvGheuEfo71yv/70aX\r
61         1BlKLMUZiYZazEXFiQAYp0Yu/wIAAA==\r
62 X-BeenThere: notmuch@notmuchmail.org\r
63 X-Mailman-Version: 2.1.13\r
64 Precedence: list\r
65 List-Id: "Use and development of the notmuch mail system."\r
66         <notmuch.notmuchmail.org>\r
67 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
68         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
69 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
70 List-Post: <mailto:notmuch@notmuchmail.org>\r
71 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
72 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
73         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
74 X-List-Received-Date: Mon, 07 Jan 2013 07:04:21 -0000\r
75 \r
76 On Wed, 19 Dec 2012, Mark Walters <markwalters1009@gmail.com> wrote:\r
77 > There is a bug in current notmuch: if you have multiple windows in one\r
78 > frame and click an id button link in a show buffer that does not\r
79 > contain point then the link is opened in the window containing point.\r
80 >\r
81 > This reads the mouse event to make sure that the correct window is\r
82 > used for the link.\r
83 \r
84 Personally I prefer that point move to the clicked window, as this patch\r
85 does.  The fact that it's even possible for point not to move to the\r
86 clicked window I find strange.\r
87 \r
88 > ---\r
89 >\r
90 > I think this is a bug but that could be debated. It is particularly\r
91 > easy to trigger with notmuch pick because that uses the split pane\r
92 > while focus usually remains in the `pick' pane rather than the `show'\r
93 > pane.\r
94 >\r
95 > The lisp is not pretty but seems to work.\r
96 >\r
97 > Best wishes\r
98 >\r
99 > Mark\r
100 >\r
101 >\r
102 >\r
103 >\r
104 >  emacs/notmuch-show.el |    5 +++++\r
105 >  1 files changed, 5 insertions(+), 0 deletions(-)\r
106 >\r
107 > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
108 > index 5751d98..5664ea3 100644\r
109 > --- a/emacs/notmuch-show.el\r
110 > +++ b/emacs/notmuch-show.el\r
111 > @@ -1077,6 +1077,11 @@ buttons for a corresponding notmuch search."\r
112 >       (make-text-button (first link) (second link)\r
113 >                         'action `(lambda (arg)\r
114 >                                    (notmuch-show ,(third link)))\r
115 > +                       'mouse-action `(lambda (arg)\r
116 > +                                        (let* ((event last-input-event)\r
117 > +                                               (window (car (cadr event))))\r
118 \r
119 Better would be (posn-window (event-start event)).  If you use the\r
120 accessors, I don't think the let bindings are really necessary since the\r
121 code becomes self-documenting.\r
122 \r
123 > +                                          (select-window window)\r
124 > +                                          (notmuch-show ,(third link))))\r
125 \r
126 Would it be better to (button-activate arg) so you don't have to\r
127 duplicate the action code?  (Then you also wouldn't need the\r
128 quasiquoting and unquoting.)\r
129 \r
130 >                         'follow-link t\r
131 >                         'help-echo "Mouse-1, RET: search for this message"\r
132 >                         'face goto-address-mail-face)))))\r
133 > -- \r
134 > 1.7.9.1\r
135 >\r
136 > _______________________________________________\r
137 > notmuch mailing list\r
138 > notmuch@notmuchmail.org\r
139 > http://notmuchmail.org/mailman/listinfo/notmuch\r