[PATCH 4/4] Update NEWS for user.other_name
[notmuch-archives.git] / 26 / 0d7c55f0834d33c89613abc3a875ff219fd828
1 Return-Path: <markwalters1009@gmail.com>\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 B23C1431FB6\r
6         for <notmuch@notmuchmail.org>; Tue, 25 Dec 2012 03:47:20 -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.201\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
14         RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
15 Received: from olra.theworths.org ([127.0.0.1])\r
16         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
17         with ESMTP id HbaoozFY4dIU for <notmuch@notmuchmail.org>;\r
18         Tue, 25 Dec 2012 03:47:20 -0800 (PST)\r
19 Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com\r
20         [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
21         (No client certificate requested)\r
22         by olra.theworths.org (Postfix) with ESMTPS id 0A902431FAE\r
23         for <notmuch@notmuchmail.org>; Tue, 25 Dec 2012 03:47:19 -0800 (PST)\r
24 Received: by mail-wi0-f181.google.com with SMTP id hm9so4396319wib.14\r
25         for <notmuch@notmuchmail.org>; Tue, 25 Dec 2012 03:47:18 -0800 (PST)\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
27         h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to\r
28         :references; bh=x86aCTQG0pbWn0QDbnfFRqxURSBPbhK0zoZ1d/q7F50=;\r
29         b=bGxfB0gK2EradHRJQuKzIMPq5IsNI7Kaww/MeBOyb0BzlK2T+R8dB6ONZ1YWbhoKjA\r
30         Jwcvl7uDFXAacUJbmvllbRqFOhrhbhTdisLYHB7xyfXSPmoiiKZkioO/2g2Jg0WJYwyZ\r
31         6FIiBGTO0PPkbrdUZD3lVEedRGp+w5QSUBxYhOia1eArwXlLbIxJtT1gYtrGdjJ0dXmL\r
32         IkdTb5o5mOU041jdYlktFml095ZusL3bVXREiB0oiHUx+JmSm3cJyjUn5E7HO6oCCqTc\r
33         P8gGfgDO9ocTwrVP/DHfjlDXSrBhatExBbtcsZa+HKvseyZYKtkXBJebCfspGL86THEd\r
34         R4vw==\r
35 X-Received: by 10.194.71.140 with SMTP id v12mr39400114wju.36.1356436038906;\r
36         Tue, 25 Dec 2012 03:47:18 -0800 (PST)\r
37 Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
38         by mx.google.com with ESMTPS id bw9sm20886001wib.5.2012.12.25.03.47.17\r
39         (version=TLSv1/SSLv3 cipher=OTHER);\r
40         Tue, 25 Dec 2012 03:47:18 -0800 (PST)\r
41 From: Mark Walters <markwalters1009@gmail.com>\r
42 To: notmuch@notmuchmail.org\r
43 Subject: [PATCH] contrib: pick: close message pane when quitting from show in\r
44         the message pane\r
45 Date: Tue, 25 Dec 2012 11:47:17 +0000\r
46 Message-Id: <1356436037-15597-1-git-send-email-markwalters1009@gmail.com>\r
47 X-Mailer: git-send-email 1.7.9.1\r
48 In-Reply-To: <1355650241-27196-1-git-send-email-markwalters1009@gmail.com>\r
49 References: <1355650241-27196-1-git-send-email-markwalters1009@gmail.com>\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: Tue, 25 Dec 2012 11:47:20 -0000\r
63 \r
64 We add a hook to the show buffer in the message window to close the\r
65 message window when that buffer quits.  It checks that the\r
66 message-window is still displaying the show-message buffer and then\r
67 closes it.\r
68 ---\r
69 This is just a slightly tidier version of the previous patch. It is\r
70 more natural to reuse the nomuch-pick-message-window variable (as it\r
71 serves the same pupose) rather than adding a new variable and\r
72 cluttering up the name space (and it also keeps the clutter in the\r
73 notmuch-pick namespace).\r
74 \r
75 I think this a good candidate for 0.15: it fixes an annoying bug in pick. \r
76 \r
77 Best wishes\r
78 \r
79 Mark\r
80 \r
81 \r
82  contrib/notmuch-pick/notmuch-pick.el |   19 +++++++++++++++++++\r
83  1 files changed, 19 insertions(+), 0 deletions(-)\r
84 \r
85 diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el\r
86 index 1a553d4..7d01f4c 100644\r
87 --- a/contrib/notmuch-pick/notmuch-pick.el\r
88 +++ b/contrib/notmuch-pick/notmuch-pick.el\r
89 @@ -157,6 +157,10 @@\r
90  (make-variable-buffer-local 'notmuch-pick-query-context)\r
91  (defvar notmuch-pick-buffer-name nil)\r
92  (make-variable-buffer-local 'notmuch-pick-buffer-name)\r
93 +;; This variable is the window used for the message pane. It is set\r
94 +;; in both the parent pick buffer and the child show buffer. It is\r
95 +;; used to try and close the message pane when quitting pick or the\r
96 +;; child show buffer.\r
97  (defvar notmuch-pick-message-window nil)\r
98  (make-variable-buffer-local 'notmuch-pick-message-window)\r
99  (put 'notmuch-pick-message-window 'permanent-local t)\r
100 @@ -324,6 +328,16 @@ Does NOT change the database."\r
101                  (notmuch-prettify-subject (notmuch-search-find-subject)))\r
102    (notmuch-pick-show-match-message-with-wait))\r
103  \r
104 +(defun notmuch-pick-message-window-kill-hook ()\r
105 +  (let ((buffer (current-buffer)))\r
106 +    (when (and (window-live-p notmuch-pick-message-window)\r
107 +              (eq (window-buffer notmuch-pick-message-window) buffer))\r
108 +      ;; We do not want an error if this is the sole window in the\r
109 +      ;; frame and I do not know how to test for that in emacs pre\r
110 +      ;; 24. Hence we just ignore-errors.\r
111 +      (ignore-errors\r
112 +       (delete-window notmuch-pick-message-window)))))\r
113 +\r
114  (defun notmuch-pick-show-message ()\r
115    "Show the current message (in split-pane)."\r
116    (interactive)\r
117 @@ -341,6 +355,11 @@ Does NOT change the database."\r
118         (let ((notmuch-show-indent-messages-width 0))\r
119           (setq current-prefix-arg '(4))\r
120           (setq buffer (notmuch-show id nil nil nil))))\r
121 +      ;; We need the `let' as notmuch-pick-message-window is buffer local.\r
122 +      (let ((window notmuch-pick-message-window))\r
123 +       (with-current-buffer buffer\r
124 +         (setq notmuch-pick-message-window window)\r
125 +         (add-hook 'kill-buffer-hook 'notmuch-pick-message-window-kill-hook)))\r
126        (notmuch-pick-tag-update-display (list "-unread"))\r
127        (setq notmuch-pick-message-buffer buffer))))\r
128  \r
129 -- \r
130 1.7.9.1\r
131 \r