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 olra.theworths.org (Postfix) with ESMTP id 19AD4431FDB
\r
6 for <notmuch@notmuchmail.org>; Tue, 22 Apr 2014 13:12:18 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0.201 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,
\r
14 RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
15 Received: from olra.theworths.org ([127.0.0.1])
\r
16 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
17 with ESMTP id 9oPQVgQ+99+D for <notmuch@notmuchmail.org>;
\r
18 Tue, 22 Apr 2014 13:12:14 -0700 (PDT)
\r
19 Received: from mail-wg0-f41.google.com (mail-wg0-f41.google.com
\r
20 [74.125.82.41]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client
\r
21 certificate requested) by olra.theworths.org (Postfix) with ESMTPS id
\r
22 1A82D431FC4 for <notmuch@notmuchmail.org>; Tue, 22 Apr 2014 13:12:11 -0700
\r
24 Received: by mail-wg0-f41.google.com with SMTP id n12so4364317wgh.0
\r
25 for <notmuch@notmuchmail.org>; Tue, 22 Apr 2014 13:12:11 -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=bXlCxWOYpCW3sb2mo6EqwQIsMdINYSI0oXyw4MKecWM=;
\r
29 b=UO9b/d+1w1qiawwLhUP61wt05kHszI8H4dzXvVKUmiAXka40GHofr6nUsu2G6rhsM6
\r
30 qr1dh6Vp21dwsrrlMNDz4SxwxYoCjoOCmjNO0cArMWRwTIx7DD9kNsZ3O7Kk2Jo8NMey
\r
31 /3RRQ4kkwjKiUlXm6cO9mDDbeBo3ZiJVnnRFTUxUTjD1TtWFEeyC9fzFeF7fhbIQZmvW
\r
32 4RGZZWC2psBH+ZEK4kcHp7C0SUAx9D/rBgi0Sin3AOUYyO7NKcTG7S2ADa/xdr58GQmF
\r
33 oMmLQOTNVwFsVc3mXq6JTzaFV6pV8tggjCVY/5udSSY0jVZxOMeU8PVOqr+996OpJN3j
\r
35 X-Received: by 10.180.211.207 with SMTP id ne15mr20279169wic.31.1398197531041;
\r
36 Tue, 22 Apr 2014 13:12:11 -0700 (PDT)
\r
37 Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162])
\r
38 by mx.google.com with ESMTPSA id
\r
39 lj15sm24553091wic.13.2014.04.22.13.12.10 for <multiple recipients>
\r
40 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
\r
41 Tue, 22 Apr 2014 13:12:10 -0700 (PDT)
\r
42 From: Mark Walters <markwalters1009@gmail.com>
\r
43 To: notmuch@notmuchmail.org
\r
44 Subject: [WIP PATCH 4/4] emacs: search: add key binding for marking a thread
\r
45 Date: Tue, 22 Apr 2014 21:11:50 +0100
\r
46 Message-Id: <1398197510-28224-5-git-send-email-markwalters1009@gmail.com>
\r
47 X-Mailer: git-send-email 1.7.10.4
\r
48 In-Reply-To: <1398197510-28224-1-git-send-email-markwalters1009@gmail.com>
\r
49 References: <1398197510-28224-1-git-send-email-markwalters1009@gmail.com>
\r
50 X-BeenThere: notmuch@notmuchmail.org
\r
51 X-Mailman-Version: 2.1.13
\r
53 List-Id: "Use and development of the notmuch mail system."
\r
54 <notmuch.notmuchmail.org>
\r
55 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
56 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
57 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
58 List-Post: <mailto:notmuch@notmuchmail.org>
\r
59 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
60 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
61 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
62 X-List-Received-Date: Tue, 22 Apr 2014 20:12:18 -0000
\r
64 Add a function for toggling the mark on a thread, by default bound to
\r
65 ",". Also make a marked thread clearly visible: this uses inverse
\r
66 video as being a bit like selecting. Perhaps actually using the same
\r
67 face (mainly backgorund colour) as a selection would make sense?
\r
69 emacs/notmuch.el | 15 +++++++++++++++
\r
70 1 file changed, 15 insertions(+)
\r
72 diff --git a/emacs/notmuch.el b/emacs/notmuch.el
\r
73 index e1ece47..4976f0a 100644
\r
74 --- a/emacs/notmuch.el
\r
75 +++ b/emacs/notmuch.el
\r
76 @@ -179,6 +179,7 @@ (defvar notmuch-search-mode-map
\r
77 (define-key map "+" 'notmuch-search-add-tag)
\r
78 (define-key map (kbd "RET") 'notmuch-search-show-thread)
\r
79 (define-key map "Z" 'notmuch-tree-from-search-current-query)
\r
80 + (define-key map "," 'notmuch-search-mark-thread)
\r
82 "Keymap for \"notmuch search\" buffers.")
\r
83 (fset 'notmuch-search-mode-map notmuch-search-mode-map)
\r
84 @@ -604,6 +605,17 @@ (defun notmuch-search-archive-thread (&optional unarchive beg end thread-list)
\r
85 (notmuch-tag-change-list notmuch-archive-tags unarchive) beg end thread-list))
\r
86 (notmuch-search-next-thread))
\r
88 +(defun notmuch-search-mark-thread ()
\r
89 + "Toggle the mark on the currently selected thread."
\r
91 + (let ((thread (notmuch-search-find-thread-id)))
\r
92 + (if (member thread notmuch-search-marked-threads)
\r
93 + (setq notmuch-search-marked-threads
\r
94 + (delete thread notmuch-search-marked-threads))
\r
95 + (push (notmuch-search-find-thread-id) notmuch-search-marked-threads)))
\r
96 + (notmuch-search-update-result (notmuch-search-get-result))
\r
97 + (notmuch-search-next-thread))
\r
99 (defun notmuch-search-update-result (result &optional pos)
\r
100 "Replace the result object of the thread at POS (or point) by
\r
101 RESULT and redraw it.
\r
102 @@ -806,6 +818,9 @@ (defun notmuch-search-show-result (result pos)
\r
103 (dolist (spec notmuch-search-result-format)
\r
104 (notmuch-search-insert-field (car spec) (cdr spec) result))
\r
106 + (when (member (concat "thread:" (plist-get result :thread))
\r
107 + notmuch-search-marked-threads)
\r
108 + (notmuch-apply-face nil '(:inverse-video t) nil pos (point)))
\r
109 (notmuch-search-color-line pos (point) (plist-get result :tags))
\r
110 (put-text-property pos (point) 'notmuch-search-result result))))
\r