Re: [PATCH v4 01/16] add util/search-path.{c, h} to test for executables in $PATH
[notmuch-archives.git] / 5b / 4da5647df0021fb8f489ce00a45c72f5cb6814
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 arlo.cworth.org (Postfix) with ESMTP id 0F2696DE15D8\r
6  for <notmuch@notmuchmail.org>; Fri, 26 Jun 2015 15:50:54 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.18\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.18 tagged_above=-999 required=5 tests=[AWL=0.750,\r
12  DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13  FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001,\r
14  RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01,\r
15  RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled\r
16 Received: from arlo.cworth.org ([127.0.0.1])\r
17  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
18  with ESMTP id fmw-wTVJjyWJ for <notmuch@notmuchmail.org>;\r
19  Fri, 26 Jun 2015 15:50:52 -0700 (PDT)\r
20 Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com\r
21  [209.85.212.174])\r
22  by arlo.cworth.org (Postfix) with ESMTPS id DD19A6DE13DB\r
23  for <notmuch@notmuchmail.org>; Fri, 26 Jun 2015 15:50:50 -0700 (PDT)\r
24 Received: by wiwl6 with SMTP id l6so56397547wiw.0\r
25  for <notmuch@notmuchmail.org>; Fri, 26 Jun 2015 15:50:49 -0700 (PDT)\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
27  h=from:to:cc:subject:date:message-id:in-reply-to:references;\r
28  bh=/0KRNuxODxNgd0G72Q1PscTWINEZ/ygjJTn6ygGveec=;\r
29  b=S+qLDegNW0aUCLz8OH1yuRwcgecaYiymW6eT+/V5av+TnLZLqdi5OQyjNygkH1r5G+\r
30  reW7fn9TgFfIzL1z3vrH2EY6oO+37UcVOhAiKymABIrJS/vzK1miTv+nEHZRaRbvs/Nf\r
31  t+/mLLjG+ZJv36oy/OdDAwcigeQRVKgqrm8DQ1LAHDPmUnUbCMa+Jd8E4YX326UJm5FP\r
32  BkuIx2Ht1VyxBVOlW61jHJuN1IElxETjx0EK6IZmDWQwrfqAYDsTZCxI7O/WY4WU5tCc\r
33  ZMPaBfVNuCBqnXUYpQQtj69O/MVyEQyEoqUIuxtDAZCq/e/qhMA8TxQvBrA6HGy+pJoP\r
34  G+8Q==\r
35 X-Received: by 10.194.58.109 with SMTP id p13mr7352970wjq.36.1435359049406;\r
36  Fri, 26 Jun 2015 15:50:49 -0700 (PDT)\r
37 Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162])\r
38  by mx.google.com with ESMTPSA id js3sm52131130wjc.5.2015.06.26.15.50.48\r
39  (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
40  Fri, 26 Jun 2015 15:50:48 -0700 (PDT)\r
41 From: Mark Walters <markwalters1009@gmail.com>\r
42 To: notmuch@notmuchmail.org\r
43 Subject: [PATCH 2/4] emacs: tree: bind o to toggle sort order\r
44 Date: Fri, 26 Jun 2015 23:50:33 +0100\r
45 Message-Id: <1435359035-6767-3-git-send-email-markwalters1009@gmail.com>\r
46 X-Mailer: git-send-email 2.1.4\r
47 In-Reply-To: <1435359035-6767-1-git-send-email-markwalters1009@gmail.com>\r
48 References: <1435359035-6767-1-git-send-email-markwalters1009@gmail.com>\r
49 X-BeenThere: notmuch@notmuchmail.org\r
50 X-Mailman-Version: 2.1.18\r
51 Precedence: list\r
52 List-Id: "Use and development of the notmuch mail system."\r
53  <notmuch.notmuchmail.org>\r
54 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
55  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
56 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
57 List-Post: <mailto:notmuch@notmuchmail.org>\r
58 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
59 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
60  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
61 X-List-Received-Date: Fri, 26 Jun 2015 22:50:54 -0000\r
62 \r
63 ---\r
64  emacs/notmuch-tree.el | 23 ++++++++++++++++++++++-\r
65  1 file changed, 22 insertions(+), 1 deletion(-)\r
66 \r
67 diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el\r
68 index 8b6cd51..6afed76 100644\r
69 --- a/emacs/notmuch-tree.el\r
70 +++ b/emacs/notmuch-tree.el\r
71 @@ -194,6 +194,10 @@ (defvar notmuch-tree-message-buffer nil\r
72  (make-variable-buffer-local 'notmuch-tree-message-buffer)\r
73  (put 'notmuch-tree-message-buffer 'permanent-local t)\r
74  \r
75 +(defvar notmuch-tree-oldest-first nil\r
76 +  "Controls whether to sort oldest-first or not")\r
77 +(make-variable-buffer-local 'notmuch-tree-oldest-first)\r
78 +\r
79  (defun notmuch-tree-to-message-pane (func)\r
80    "Execute FUNC in message pane.\r
81  \r
82 @@ -265,6 +269,7 @@ (defvar notmuch-tree-mode-map\r
83      (define-key map "A" 'notmuch-tree-archive-thread)\r
84      (define-key map "a" 'notmuch-tree-archive-message-then-next)\r
85      (define-key map "=" 'notmuch-tree-refresh-view)\r
86 +    (define-key map "o" 'notmuch-tree-toggle-order)\r
87      (define-key map "z" 'notmuch-tree-to-tree)\r
88      (define-key map "n" 'notmuch-tree-next-matching-message)\r
89      (define-key map "p" 'notmuch-tree-prev-matching-message)\r
90 @@ -562,6 +567,18 @@ (defun notmuch-tree-refresh-view ()\r
91                          query-context\r
92                          target)))\r
93  \r
94 +(defun notmuch-tree-toggle-order ()\r
95 +  "Toggle the current search order.\r
96 +\r
97 +By default, the threads in `notmuch-tree' are displayed\r
98 +reverse-chronological order (newest thread at the beginning of\r
99 +the buffer).\r
100 +\r
101 +This command toggles the sort order for the current search."\r
102 +  (interactive)\r
103 +  (setq notmuch-tree-oldest-first (not notmuch-tree-oldest-first))\r
104 +  (notmuch-tree-refresh-view))\r
105 +\r
106  (defun notmuch-tree-thread-top ()\r
107    (when (notmuch-tree-get-message-properties)\r
108      (while (not (or (notmuch-tree-get-prop :first) (eobp)))\r
109 @@ -872,7 +889,11 @@ (defun notmuch-tree-worker (basic-query &optional query-context target open-targ\r
110      (let ((proc (notmuch-start-notmuch\r
111                  "notmuch-tree" (current-buffer) #'notmuch-tree-process-sentinel\r
112                  "show" "--body=false" "--format=sexp"\r
113 -                message-arg search-args))\r
114 +                message-arg\r
115 +                (if oldest-first\r
116 +                        "--sort=oldest-first"\r
117 +                      "--sort=newest-first")\r
118 +                search-args))\r
119           ;; Use a scratch buffer to accumulate partial output.\r
120           ;; This buffer will be killed by the sentinel, which\r
121           ;; should be called no matter how the process dies.\r
122 -- \r
123 2.1.4\r
124 \r