[PATCH 6/8] CLI: refactor dumping of tags.
[notmuch-archives.git] / fa / c07d8f388da541c03fd01e50c808e13a79e2a5
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 D72F0431FDD\r
6         for <notmuch@notmuchmail.org>; Thu,  5 Sep 2013 02:27:57 -0700 (PDT)\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 VP6FhZqdq3P7 for <notmuch@notmuchmail.org>;\r
17         Thu,  5 Sep 2013 02:27:52 -0700 (PDT)\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 B901F431FDB\r
22         for <notmuch@notmuchmail.org>; Thu,  5 Sep 2013 02:27:51 -0700 (PDT)\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 1VHVqv-0004lu-VU; Thu, 05 Sep 2013 10:27:50 +0100\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.71)\r
29         (envelope-from <m.walters@qmul.ac.uk>)\r
30         id 1VHVqv-0002fT-JS; Thu, 05 Sep 2013 10:27:49 +0100\r
31 From: Mark Walters <markwalters1009@gmail.com>\r
32 To: Austin Clements <amdragon@MIT.EDU>, notmuch@notmuchmail.org\r
33 Subject: Re: [PATCH v2 0/9] emacs: Unify common key bindings and lots more\r
34 In-Reply-To: <1378244725-18846-1-git-send-email-amdragon@mit.edu>\r
35 References: <1378244725-18846-1-git-send-email-amdragon@mit.edu>\r
36 User-Agent: Notmuch/0.15.2+269~g01f5508 (http://notmuchmail.org) Emacs/23.4.1\r
37         (x86_64-pc-linux-gnu)\r
38 Date: Thu, 05 Sep 2013 10:27:48 +0100\r
39 Message-ID: <87a9jrlisr.fsf@qmul.ac.uk>\r
40 MIME-Version: 1.0\r
41 Content-Type: text/plain; charset=us-ascii\r
42 X-Sender-Host-Address: 93.97.24.31\r
43 X-QM-SPAM-Info: Sender has good ham record.  :)\r
44 X-QM-Body-MD5: a3869301cd9ea9a0870e2c28bb776844 (of first 20000 bytes)\r
45 X-SpamAssassin-Score: 0.0\r
46 X-SpamAssassin-SpamBar: /\r
47 X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
48         determine if it is\r
49         spam. We require at least 5.0 points to mark a message as spam.\r
50         This message scored 0.0 points. Summary of the scoring: \r
51         * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
52         provider *      (markwalters1009[at]gmail.com)\r
53         *  0.0 AWL AWL: From: address is in the auto white-list\r
54 X-QM-Scan-Virus: ClamAV says the message is clean\r
55 X-BeenThere: notmuch@notmuchmail.org\r
56 X-Mailman-Version: 2.1.13\r
57 Precedence: list\r
58 List-Id: "Use and development of the notmuch mail system."\r
59         <notmuch.notmuchmail.org>\r
60 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
61         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
62 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
63 List-Post: <mailto:notmuch@notmuchmail.org>\r
64 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
65 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
66         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
67 X-List-Received-Date: Thu, 05 Sep 2013 09:27:58 -0000\r
68 \r
69 \r
70 LGTM +1. (The defcustom is a nice addition)\r
71 \r
72 Mark\r
73 \r
74 On Tue, 03 Sep 2013, Austin Clements <amdragon@MIT.EDU> wrote:\r
75 > This is v2 of id:1377793557-28878-1-git-send-email-amdragon@mit.edu.\r
76 > This fixes a problem found by Jani where notmuch-hello would reset\r
77 > point placement when refreshing in Emacs 24.  It also inverts the\r
78 > sense of notmuch-hello-auto-refresh and makes it a defcustom\r
79 > (originally I'd intended notmuch-hello-inhibit-auto-refresh for\r
80 > internal use only, but both Mark and Jani expressed interest in\r
81 > setting it).\r
82 >\r
83 > The diff from v1 follows\r
84 >\r
85 > diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el\r
86 > index 1d6c3a2..55c416a 100644\r
87 > --- a/emacs/notmuch-hello.el\r
88 > +++ b/emacs/notmuch-hello.el\r
89 > @@ -232,6 +232,11 @@ supported for \"Customized queries section\" items."\r
90 >           notmuch-hello-query-section\r
91 >           (function :tag "Custom section"))))\r
92 >  \r
93 > +(defcustom notmuch-hello-auto-refresh t\r
94 > +  "Automatically refresh when returning to the notmuch-hello buffer."\r
95 > +  :group 'notmuch-hello\r
96 > +  :type 'boolean)\r
97 > +\r
98 >  (defvar notmuch-hello-hidden-sections nil\r
99 >    "List of sections titles whose contents are hidden")\r
100 >  \r
101 > @@ -478,9 +483,6 @@ Such a list can be computed with `notmuch-hello-query-counts'."\r
102 >    ;; Lazy - rebuild everything.\r
103 >    (notmuch-hello no-display))\r
104 >  \r
105 > -(defvar notmuch-hello-inhibit-auto-refresh nil\r
106 > -  "Don't refresh notmuch-hello on window configuration changes.")\r
107 > -\r
108 >  (defun notmuch-hello-window-configuration-change ()\r
109 >    "Hook function to update the hello buffer when it is switched to."\r
110 >    (let ((hello-buf (get-buffer "*notmuch-hello*"))\r
111 > @@ -501,8 +503,11 @@ Such a list can be computed with `notmuch-hello-query-counts'."\r
112 >           ;; is currently visible, was not visible on the last\r
113 >           ;; configuration change, and this is not a new window)\r
114 >           (setq do-refresh t)))))\r
115 > -    (when (and do-refresh (not notmuch-hello-inhibit-auto-refresh))\r
116 > -      (notmuch-hello t))\r
117 > +    (when (and do-refresh notmuch-hello-auto-refresh)\r
118 > +      ;; Refresh hello as soon as we get back to redisplay.  On Emacs\r
119 > +      ;; 24, we can't do it right here because something in this\r
120 > +      ;; hook's call stack overrides hello's point placement.\r
121 > +      (run-at-time nil nil #'notmuch-hello t))\r
122 >      (when (null hello-buf)\r
123 >        ;; Clean up hook\r
124 >        (remove-hook 'window-configuration-change-hook\r
125 > @@ -785,14 +790,15 @@ following:\r
126 >  \r
127 >    ;; This may cause a window configuration change, so if the\r
128 >    ;; auto-refresh hook is already installed, avoid recursive refresh.\r
129 > -  (let ((notmuch-hello-inhibit-auto-refresh t))\r
130 > +  (let ((notmuch-hello-auto-refresh nil))\r
131 >      (if no-display\r
132 >       (set-buffer "*notmuch-hello*")\r
133 >        (switch-to-buffer "*notmuch-hello*")))\r
134 >  \r
135 >    ;; Install auto-refresh hook\r
136 > -  (add-hook 'window-configuration-change-hook\r
137 > -         #'notmuch-hello-window-configuration-change)\r
138 > +  (when notmuch-hello-auto-refresh\r
139 > +    (add-hook 'window-configuration-change-hook\r
140 > +           #'notmuch-hello-window-configuration-change))\r
141 >  \r
142 >    (let ((target-line (line-number-at-pos))\r
143 >       (target-column (current-column))\r
144 >\r
145 \r