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 18F19431FB6
\r
6 for <notmuch@notmuchmail.org>; Sat, 5 Apr 2014 18:30:41 -0700 (PDT)
\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 pVckcPazvs9W for <notmuch@notmuchmail.org>;
\r
16 Sat, 5 Apr 2014 18:30:33 -0700 (PDT)
\r
17 Received: from dmz-mailsec-scanner-3.mit.edu (dmz-mailsec-scanner-3.mit.edu
\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 7827D431FAF
\r
22 for <notmuch@notmuchmail.org>; Sat, 5 Apr 2014 18:30:33 -0700 (PDT)
\r
23 X-AuditID: 1209190e-f79ee6d000000c40-08-5340ae385e56
\r
24 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])
\r
25 (using TLS with cipher AES256-SHA (256/256 bits))
\r
26 (Client did not present a certificate)
\r
27 by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP
\r
28 id 45.3B.03136.83EA0435; Sat, 5 Apr 2014 21:30:32 -0400 (EDT)
\r
29 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])
\r
30 by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id s361UVBQ024227;
\r
31 Sat, 5 Apr 2014 21:30:32 -0400
\r
32 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])
\r
33 (authenticated bits=0)
\r
34 (User authenticated as amdragon@ATHENA.MIT.EDU)
\r
35 by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s361UTjV021355
\r
36 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);
\r
37 Sat, 5 Apr 2014 21:30:30 -0400
\r
38 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80)
\r
39 (envelope-from <amdragon@mit.edu>)
\r
40 id 1WWbun-0007BH-Fo; Sat, 05 Apr 2014 21:30:29 -0400
\r
41 Date: Sat, 5 Apr 2014 21:30:29 -0400
\r
42 From: Austin Clements <amdragon@MIT.EDU>
\r
43 To: Mark Walters <markwalters1009@gmail.com>
\r
44 Subject: Re: [PATCH 5/5] emacs: Add a sort-order option to saved-searches
\r
45 Message-ID: <20140406013029.GG15472@mit.edu>
\r
46 References: <1396733065-32602-1-git-send-email-markwalters1009@gmail.com>
\r
47 <1396733065-32602-6-git-send-email-markwalters1009@gmail.com>
\r
49 Content-Type: text/plain; charset=us-ascii
\r
50 Content-Disposition: inline
\r
51 In-Reply-To: <1396733065-32602-6-git-send-email-markwalters1009@gmail.com>
\r
52 User-Agent: Mutt/1.5.21 (2010-09-15)
\r
53 X-Brightmail-Tracker:
\r
54 H4sIAAAAAAAAA+NgFvrPIsWRmVeSWpSXmKPExsUixG6nomuxziHYYM0WVYvVc3ksrt+cyezA
\r
55 5LFz1l12j2erbjEHMEVx2aSk5mSWpRbp2yVwZdzbaVAwX7Li9dM77A2MB4S7GDk5JARMJJ4v
\r
56 7WCGsMUkLtxbzwZiCwnMZpK4P9eii5ELyN7AKNH7cCEzhHOKSeLGnOdQzhJGiWNP7zN1MXJw
\r
57 sAioSJzZHg/SzSagIbFt/3JGEFtEQEfi9qEF7CA2s4C0xLffzUwgtrCAp8Sjty2sIK28QDVN
\r
58 G+whFncySmztcQGxeQUEJU7OfMIC0aolcePfS7BNIGOW/+MACXMKeEm867sIViIKdMCUk9vY
\r
59 JjAKzULSPQtJ9yyE7gWMzKsYZVNyq3RzEzNzilOTdYuTE/PyUot0jfVyM0v0UlNKNzGCwplT
\r
60 km8H49eDSocYBTgYlXh4L+Y5BAuxJpYVV+YeYpTkYFIS5e2aARTiS8pPqcxILM6ILyrNSS0+
\r
61 xCjBwawkwvskCCjHm5JYWZValA+TkuZgURLnfWttFSwkkJ5YkpqdmlqQWgSTleHgUJLgdVkL
\r
62 1ChYlJqeWpGWmVOCkGbi4AQZzgM0/NUakOHFBYm5xZnpEPlTjIpS4ryCIM0CIImM0jy4Xli6
\r
63 ecUoDvSKMK8OSBUPMFXBdb8CGswENLghzA5kcEkiQkqqgZFfp8HyssWE8wlyXHsy9x66ac//
\r
64 JvKTHfsMmZb87f+iVD+lH8if8CC2fmn2supJlnuad0pH8PqLy/bKVNYVX36zT+3VhTUTOLnr
\r
65 k8QNz53/Exbm/zKh5XXd0y3v652r+iv5JVY7FCSUl/P3C7vI73hV2/e/1VPRdqvJthvTv8Ur
\r
66 +otX7by3UImlOCPRUIu5qDgRALxS48sSAwAA
\r
67 Cc: notmuch@notmuchmail.org
\r
68 X-BeenThere: notmuch@notmuchmail.org
\r
69 X-Mailman-Version: 2.1.13
\r
71 List-Id: "Use and development of the notmuch mail system."
\r
72 <notmuch.notmuchmail.org>
\r
73 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
74 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
75 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
76 List-Post: <mailto:notmuch@notmuchmail.org>
\r
77 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
78 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
79 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
80 X-List-Received-Date: Sun, 06 Apr 2014 01:30:41 -0000
\r
82 Quoth Mark Walters on Apr 05 at 10:24 pm:
\r
83 > This adds a sort-order option to saved-searches, stores it in the
\r
84 > saved-search buttons (widgets), and uses the stored value when the
\r
85 > button is pressed.
\r
87 > Storing the sort-order in the widget was suggested by Jani in
\r
88 > id:4c3876274126985683e888641b29cf18142a5eb8.1391771337.git.jani@nikula.org.
\r
90 > emacs/notmuch-hello.el | 11 ++++++++++-
\r
91 > emacs/notmuch-lib.el | 7 ++++++-
\r
92 > 2 files changed, 16 insertions(+), 2 deletions(-)
\r
94 > diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
\r
95 > index aa40e6f..6a28372 100644
\r
96 > --- a/emacs/notmuch-hello.el
\r
97 > +++ b/emacs/notmuch-hello.el
\r
98 > @@ -364,7 +364,8 @@ (defun notmuch-hello-reflect (list ncols)
\r
99 > (defun notmuch-hello-widget-search (widget &rest ignore)
\r
100 > (notmuch-search (widget-get widget
\r
101 > :notmuch-search-terms)
\r
102 > - notmuch-search-oldest-first))
\r
103 > + (widget-get widget
\r
104 > + :notmuch-search-oldest-first)))
\r
106 > (defun notmuch-saved-search-count (search)
\r
107 > (car (process-lines notmuch-command "count" search)))
\r
108 > @@ -496,12 +497,20 @@ (defun notmuch-hello-insert-buttons (searches)
\r
109 > (widget-insert (make-string column-indent ? )))
\r
110 > (let* ((name (plist-get elem :name))
\r
111 > (query (plist-get elem :query))
\r
112 > + (oldest-first (cond
\r
113 > + ((eq (plist-get elem :sort-order) 'newest-first)
\r
115 > + ((eq (plist-get elem :sort-order) 'oldest-first)
\r
118 > + notmuch-search-oldest-first)))
\r
120 (case (plist-get elem :sort-order)
\r
123 (otherwise notmuch-search-oldest-first))
\r
125 > (msg-count (plist-get elem :count)))
\r
126 > (widget-insert (format "%8s "
\r
127 > (notmuch-hello-nice-number msg-count)))
\r
128 > (widget-create 'push-button
\r
129 > :notify #'notmuch-hello-widget-search
\r
130 > :notmuch-search-terms query
\r
131 > + :notmuch-search-oldest-first oldest-first
\r
133 > (setq column-indent
\r
134 > (1+ (max 0 (- column-width (length name)))))))
\r
135 > diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
\r
136 > index 8a12f91..8aa8cfc 100644
\r
137 > --- a/emacs/notmuch-lib.el
\r
138 > +++ b/emacs/notmuch-lib.el
\r
139 > @@ -125,7 +125,12 @@ (define-widget 'notmuch-saved-search-plist 'list
\r
140 > (group :format "%v" :inline t (const :format " Query: " :query) (string :format "%v")))
\r
141 > (checklist :inline t
\r
143 > - (group :format "%v" :inline t (const :format "Count-Query: " :count-query) (string :format "%v")))))
\r
144 > + (group :format "%v" :inline t (const :format "Count-Query: " :count-query) (string :format "%v"))
\r
145 > + (group :format "%v" :inline t (const :format "" :sort-order)
\r
146 > + (choice :tag " Sort Order"
\r
148 Should there be a colon? (I haven't applied the patches and I'm
\r
149 afraid this is beyond my mental implementation of define-widget!)
\r
151 > + (const :tag "Default" nil)
\r
152 > + (const :tag "Oldest-first" oldest-first)
\r
153 > + (const :tag "Newest-first" newest-first))))))
\r
155 > (defcustom notmuch-saved-searches '((:name "inbox" :query "tag:inbox")
\r
156 > (:name "unread" :query "tag:unread"))
\r