Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 19AD4431FDB for ; Tue, 22 Apr 2014 13:12:18 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0.201 X-Spam-Level: X-Spam-Status: No, score=0.201 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9oPQVgQ+99+D for ; Tue, 22 Apr 2014 13:12:14 -0700 (PDT) Received: from mail-wg0-f41.google.com (mail-wg0-f41.google.com [74.125.82.41]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 1A82D431FC4 for ; Tue, 22 Apr 2014 13:12:11 -0700 (PDT) Received: by mail-wg0-f41.google.com with SMTP id n12so4364317wgh.0 for ; Tue, 22 Apr 2014 13:12:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=bXlCxWOYpCW3sb2mo6EqwQIsMdINYSI0oXyw4MKecWM=; b=UO9b/d+1w1qiawwLhUP61wt05kHszI8H4dzXvVKUmiAXka40GHofr6nUsu2G6rhsM6 qr1dh6Vp21dwsrrlMNDz4SxwxYoCjoOCmjNO0cArMWRwTIx7DD9kNsZ3O7Kk2Jo8NMey /3RRQ4kkwjKiUlXm6cO9mDDbeBo3ZiJVnnRFTUxUTjD1TtWFEeyC9fzFeF7fhbIQZmvW 4RGZZWC2psBH+ZEK4kcHp7C0SUAx9D/rBgi0Sin3AOUYyO7NKcTG7S2ADa/xdr58GQmF oMmLQOTNVwFsVc3mXq6JTzaFV6pV8tggjCVY/5udSSY0jVZxOMeU8PVOqr+996OpJN3j tWgQ== X-Received: by 10.180.211.207 with SMTP id ne15mr20279169wic.31.1398197531041; Tue, 22 Apr 2014 13:12:11 -0700 (PDT) Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162]) by mx.google.com with ESMTPSA id lj15sm24553091wic.13.2014.04.22.13.12.10 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 22 Apr 2014 13:12:10 -0700 (PDT) From: Mark Walters To: notmuch@notmuchmail.org Subject: [WIP PATCH 4/4] emacs: search: add key binding for marking a thread Date: Tue, 22 Apr 2014 21:11:50 +0100 Message-Id: <1398197510-28224-5-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1398197510-28224-1-git-send-email-markwalters1009@gmail.com> References: <1398197510-28224-1-git-send-email-markwalters1009@gmail.com> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2014 20:12:18 -0000 Add a function for toggling the mark on a thread, by default bound to ",". Also make a marked thread clearly visible: this uses inverse video as being a bit like selecting. Perhaps actually using the same face (mainly backgorund colour) as a selection would make sense? --- emacs/notmuch.el | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index e1ece47..4976f0a 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -179,6 +179,7 @@ (defvar notmuch-search-mode-map (define-key map "+" 'notmuch-search-add-tag) (define-key map (kbd "RET") 'notmuch-search-show-thread) (define-key map "Z" 'notmuch-tree-from-search-current-query) + (define-key map "," 'notmuch-search-mark-thread) map) "Keymap for \"notmuch search\" buffers.") (fset 'notmuch-search-mode-map notmuch-search-mode-map) @@ -604,6 +605,17 @@ (defun notmuch-search-archive-thread (&optional unarchive beg end thread-list) (notmuch-tag-change-list notmuch-archive-tags unarchive) beg end thread-list)) (notmuch-search-next-thread)) +(defun notmuch-search-mark-thread () + "Toggle the mark on the currently selected thread." + (interactive) + (let ((thread (notmuch-search-find-thread-id))) + (if (member thread notmuch-search-marked-threads) + (setq notmuch-search-marked-threads + (delete thread notmuch-search-marked-threads)) + (push (notmuch-search-find-thread-id) notmuch-search-marked-threads))) + (notmuch-search-update-result (notmuch-search-get-result)) + (notmuch-search-next-thread)) + (defun notmuch-search-update-result (result &optional pos) "Replace the result object of the thread at POS (or point) by RESULT and redraw it. @@ -806,6 +818,9 @@ (defun notmuch-search-show-result (result pos) (dolist (spec notmuch-search-result-format) (notmuch-search-insert-field (car spec) (cdr spec) result)) (insert "\n") + (when (member (concat "thread:" (plist-get result :thread)) + notmuch-search-marked-threads) + (notmuch-apply-face nil '(:inverse-video t) nil pos (point))) (notmuch-search-color-line pos (point) (plist-get result :tags)) (put-text-property pos (point) 'notmuch-search-result result)))) -- 1.7.10.4