--- /dev/null
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 8B87E431FC0\r
+ for <notmuch@notmuchmail.org>; Tue, 2 Oct 2012 13:18:17 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id Vz8PLPghhA9I for <notmuch@notmuchmail.org>;\r
+ Tue, 2 Oct 2012 13:18:16 -0700 (PDT)\r
+Received: from mail-qc0-f181.google.com (mail-qc0-f181.google.com\r
+ [209.85.216.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 59837431FBD\r
+ for <notmuch@notmuchmail.org>; Tue, 2 Oct 2012 13:18:16 -0700 (PDT)\r
+Received: by mail-qc0-f181.google.com with SMTP id x40so6183217qcp.26\r
+ for <notmuch@notmuchmail.org>; Tue, 02 Oct 2012 13:18:16 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=google.com; s=20120113;\r
+ h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references\r
+ :x-gm-message-state;\r
+ bh=gErQ33LhLmCiLz5SlCFgl7kq4SsynwBoXmOn/B1y2IU=;\r
+ b=NfRMBCrAj+9bYuaeN+kTxL79f7JTATFhrhnZC76jmt2eDwscInCkYdUdjZX7kvFa7L\r
+ dW+rq5YkaCeMQeJA/VSkGSFF6wKSMTwgex5ABjx3QhhlRNRjAQjZXWIgAVvnYzMcawYe\r
+ 6hORwfWjb9mYe1dSgKLUjnU1bIf/TmVm8mFaAkvDPjwjJt6ReN9An6CwM6yJ0LH1lSmn\r
+ TxQb60nRUrSEH9+V9PWSWPIL32QiWkRZTD21jmd4P/rWbgWiD7v4K8pSjhJrEu7SRQRW\r
+ K0TzpUKNd6mJusfE/ZGLeQbi2Hs2G/V5QSJtwczPpw05QCI18EEFb1ZQGa2JajKenanJ\r
+ vifw==\r
+Received: by 10.49.59.82 with SMTP id x18mr7678668qeq.9.1349209096102;\r
+ Tue, 02 Oct 2012 13:18:16 -0700 (PDT)\r
+Received: from localhost ([2001:4b98:dc0:43:216:3eff:fe1b:25f3])\r
+ by mx.google.com with ESMTPS id ck11sm2295914qab.17.2012.10.02.13.18.15\r
+ (version=SSLv3 cipher=OTHER); Tue, 02 Oct 2012 13:18:15 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 2/2] emacs: add support for defining custom sort order for\r
+ saved searches\r
+Date: Tue, 2 Oct 2012 22:18:03 +0200\r
+Message-Id: <1349209083-7170-3-git-send-email-jani@nikula.org>\r
+X-Mailer: git-send-email 1.7.2.5\r
+In-Reply-To: <1349209083-7170-1-git-send-email-jani@nikula.org>\r
+References: <1349209083-7170-1-git-send-email-jani@nikula.org>\r
+X-Gm-Message-State:\r
+ ALoCoQnDCNmQs701/We4W+bYGWKiZzJq2jvJYivvyXKir9xZgxyXdTE3EOBSddy9kPvPeY5BNIpM\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 02 Oct 2012 20:18:18 -0000\r
+\r
+Add a new customization option notmuch-saved-searches-oldest-first to\r
+define custom sort order for saved searches. Do this as a separate\r
+option from notmuch-saved-searches to dodge backwards compatibility\r
+issues.\r
+\r
+NOTES:\r
+\r
+If the name of a tag matches the name of a saved search with a custom\r
+sort order, then the search for that tag using the all tags section of\r
+notmuch-hello will use the custom sort order too.\r
+\r
+If you change any sort orders, you must refresh notmuch-hello for the\r
+changes to take effect.\r
+\r
+Only searches initiated from notmuch-hello will be affected.\r
+---\r
+ emacs/notmuch-hello.el | 6 +++++-\r
+ emacs/notmuch-lib.el | 9 +++++++++\r
+ 2 files changed, 14 insertions(+), 1 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el\r
+index 532f06d..e410357 100644\r
+--- a/emacs/notmuch-hello.el\r
++++ b/emacs/notmuch-hello.el\r
+@@ -433,7 +433,11 @@ Such a list can be computed with `notmuch-hello-query-counts'."\r
+ (widget-create 'push-button\r
+ :notify #'notmuch-hello-widget-search\r
+ :notmuch-search-terms query\r
+- :notmuch-search-oldest-first notmuch-search-oldest-first\r
++ :notmuch-search-oldest-first\r
++ (let ((m (assoc\r
++ name\r
++ notmuch-saved-searches-oldest-first)))\r
++ (if m (cdr m) notmuch-search-oldest-first))\r
+ name)\r
+ (setq column-indent\r
+ (1+ (max 0 (- column-width (length name)))))))\r
+diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el\r
+index 69867ad..e1cd7d2 100644\r
+--- a/emacs/notmuch-lib.el\r
++++ b/emacs/notmuch-lib.el\r
+@@ -82,6 +82,15 @@\r
+ :type '(alist :key-type string :value-type string)\r
+ :group 'notmuch-hello)\r
+ \r
++(defcustom notmuch-saved-searches-oldest-first nil\r
++ "List of saved searches with custom sort order.\r
++\r
++For each saved search name appearing in the list, use t for\r
++oldest-first, nil for newest-first. Saved searches not present in\r
++this list will use `notmuch-search-oldest-first' sort order."\r
++ :type '(alist :key-type string :value-type boolean)\r
++ :group 'notmuch-hello)\r
++\r
+ (defcustom notmuch-archive-tags '("-inbox")\r
+ "List of tag changes to apply to a message or a thread when it is archived.\r
+ \r
+-- \r
+1.7.2.5\r
+\r