Re: [PATCH] emacs: notmuch-hello: Add variable to control order or saved-search results

2014-02-07 Thread Keith Packard
Carl Worth  writes:

> This allows for the user to control the order that results are
> returned from saved-searches, (and independently from the order of all
> other searches which is controlled by notmuch-search-oldest-first).

After we lost this from notmuch, I added this to my .emacs, which made
my hello searches oldest first:

(defun notmuch-hello-widget-search (widget &rest ignore)
 (notmuch-search (widget-get widget
  :notmuch-search-terms)
 t))


-- 
keith.pack...@intel.com


pgp2wWQx1qZST.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] emacs: notmuch-hello: Add variable to control order or saved-search results

2014-02-07 Thread Keith Packard
Carl Worth  writes:

> This allows for the user to control the order that results are
> returned from saved-searches, (and independently from the order of all
> other searches which is controlled by notmuch-search-oldest-first).

After we lost this from notmuch, I added this to my .emacs, which made
my hello searches oldest first:

(defun notmuch-hello-widget-search (widget &rest ignore)
 (notmuch-search (widget-get widget
  :notmuch-search-terms)
 t))


-- 
keith.packard at intel.com
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 810 bytes
Desc: not available
URL: 



[PATCH] emacs: notmuch-hello: Add variable to control order or saved-search results

2014-02-06 Thread Carl Worth
This allows for the user to control the order that results are
returned from saved-searches, (and independently from the order of all
other searches which is controlled by notmuch-search-oldest-first).
---

This allows me to get back to the behavior that notmuch had long ago,
(the documentation for the changed behavior was updated in commit
c1a42652a173a4bb70ab72388e6ad150d19a2b06). I'm not sure when the
actual behavioral change was made.

A fanicer change might allow for a configurable sort order for each
saved search, but this more minimal change at least lets me use the
latest notmuch once again.

 emacs/notmuch-hello.el | 18 +-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index 7b3d76b..a9f8230 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -59,6 +59,14 @@ alist to be used."
   :value notmuch-sort-saved-searches))
   :group 'notmuch-hello)
 
+(defcustom notmuch-saved-searches-oldest-first t
+  "Show the oldest mail first for saved-search results.
+
+This variable defines the default sort order for displaying
+saved-search results."
+  :type 'boolean
+  :group 'notmuch-hello)
+
 (defvar notmuch-hello-indent 4
   "How much to indent non-headers.")
 
@@ -327,6 +335,14 @@ diagonal."
  :notmuch-search-terms)
  notmuch-search-oldest-first))
 
+; Like notmuch-hello-widget-search, but with the
+; notmuch-saved-searches-oldest-first variable controlling the sort
+; order.
+(defun notmuch-hello-do-saved-search (widget &rest ignore)
+  (notmuch-search (widget-get widget
+ :notmuch-search-terms)
+ notmuch-saved-searches-oldest-first))
+
 (defun notmuch-saved-search-count (search)
   (car (process-lines notmuch-command "count" search)))
 
@@ -460,7 +476,7 @@ Such a list can be computed with 
`notmuch-hello-query-counts'."
(widget-insert (format "%8s "
   (notmuch-hello-nice-number msg-count)))
(widget-create 'push-button
-  :notify #'notmuch-hello-widget-search
+  :notify #'notmuch-hello-do-saved-search
   :notmuch-search-terms query
   name)
(setq column-indent
-- 
1.9.rc1

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch