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 93369429E36 for ; Sun, 3 Jul 2011 23:52:53 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[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 uwg12TV7brRi for ; Sun, 3 Jul 2011 23:52:52 -0700 (PDT) Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 8C131429E37 for ; Sun, 3 Jul 2011 23:52:47 -0700 (PDT) Received: by mail-wy0-f181.google.com with SMTP id 22so3733696wyh.26 for ; Sun, 03 Jul 2011 23:52:47 -0700 (PDT) Received: by 10.227.169.139 with SMTP id z11mr4901636wby.60.1309762367234; Sun, 03 Jul 2011 23:52:47 -0700 (PDT) Received: from localhost ([109.131.160.67]) by mx.google.com with ESMTPS id n18sm4229582wbh.6.2011.07.03.23.52.45 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 03 Jul 2011 23:52:46 -0700 (PDT) From: Pieter Praet To: Austin Clements Subject: [PATCH 3/5] emacs: stashing (a region of) matched-msgids Date: Mon, 4 Jul 2011 08:51:56 +0200 Message-Id: <1309762318-4530-4-git-send-email-pieter@praet.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1309762318-4530-1-git-send-email-pieter@praet.org> References: <20110703171743.GL15901@mit.edu> <1309762318-4530-1-git-send-email-pieter@praet.org> Cc: Notmuch Mail 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: Mon, 04 Jul 2011 06:52:53 -0000 Signed-off-by: Pieter Praet --- emacs/notmuch.el | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index 2338044..46e276a 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -226,6 +226,7 @@ For a mouse binding, return nil." (defvar notmuch-search-stash-map (let ((map (make-sparse-keymap))) (define-key map "i" 'notmuch-search-stash-thread-id) + (define-key map "m" 'notmuch-search-stash-matched-msgids) map) "Submap for stash commands") (fset 'notmuch-search-stash-map notmuch-search-stash-map) @@ -235,6 +236,19 @@ For a mouse binding, return nil." (interactive) (notmuch-common-do-stash (notmuch-search-find-thread-id))) +(defun notmuch-search-stash-matched-msgids () + "Copy matched Message-ID's of current thread (or threads in region) to kill-ring." + (interactive) + (save-excursion + (if (region-active-p) + (let* ((beg (region-beginning)) + (end (region-end))) + (notmuch-common-do-stash + (mapconcat 'identity + (notmuch-search-find-matched-msgids-region beg end) + " or "))) + (notmuch-common-do-stash (notmuch-search-find-matched-msgids))))) + (defvar notmuch-search-query-string) (defvar notmuch-search-target-thread) (defvar notmuch-search-target-line) -- 1.7.5.4