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 4FE95431FC0 for ; Sat, 28 Apr 2012 17:06:42 -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 o6vITV0hQcEV for ; Sat, 28 Apr 2012 17:06:41 -0700 (PDT) Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com [209.85.212.173]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 0BCBE431FAE for ; Sat, 28 Apr 2012 17:06:37 -0700 (PDT) Received: by wibhq7 with SMTP id hq7so1395682wib.2 for ; Sat, 28 Apr 2012 17:06:36 -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:x-mailer:in-reply-to:references; bh=VDADjiWVwENBIy1ws4BzAer35+1ZsBveYSTkYpyz/TE=; b=WaBy1P8bOIeuBghwelqrB+TAt0B0wjLYBi4Evb3n6mv2AzZfWCEB2aM8OuDehJEtkK rQrWenShtw+4F5f0bGX78RLqQI4v0otXJkoftnq5jevSK6wTHgg5RI5ROxyOfxWY9kZo PoInCH6PHHRgM3/EM71l7x3VXRQO0n2/wpGbsMlJU87O6SWINyWL1UWxf3Ob/u7/SFCx ETsYniySrqSnQCgfMPbGOKOrA+JRYMb8nQXDw0WlHyjCrYvH+YFwr5DeJPDPUG6CGg5Y KgstXiywt4hDccNvpMSl6lMYhEbSjxpi/AFfvrvit7nJZYyxPWhcGOcYYUwUEGPGPWUF s9KQ== Received: by 10.180.76.240 with SMTP id n16mr10449420wiw.10.1335657996682; Sat, 28 Apr 2012 17:06:36 -0700 (PDT) Received: from localhost (94-192-233-223.zone6.bethere.co.uk. [94.192.233.223]) by mx.google.com with ESMTPS id u9sm16579515wix.0.2012.04.28.17.06.35 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 28 Apr 2012 17:06:35 -0700 (PDT) From: Mark Walters To: notmuch@notmuchmail.org Subject: [Patch v4 2/3] emacs: add a filter option to show Date: Sun, 29 Apr 2012 01:06:45 +0100 Message-Id: <1335658006-20161-3-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 1.7.9.1 In-Reply-To: <1335658006-20161-1-git-send-email-markwalters1009@gmail.com> References: <1335658006-20161-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: Sun, 29 Apr 2012 00:06:42 -0000 Show the current thread with a different filter (i.e., open messages in the thread matching the new query). Bound to 'l' for "limit". Note that it is not the same as filter in search mode as it replaces the existing query rather than ANDing with it (but it does keep the thread-id part of the query). --- emacs/notmuch-show.el | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 3bd9a64..f52a96d 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -42,6 +42,7 @@ (declare-function notmuch-search-next-thread "notmuch" nil) (declare-function notmuch-search-show-thread "notmuch" nil) (declare-function notmuch-update-tags "notmuch" (current-tags tag-changes)) +(declare-function notmuch-read-query "notmuch" (prompt)) (defcustom notmuch-message-headers '("Subject" "To" "Cc" "Date") "Headers that should be shown in a message, in this order. @@ -1161,6 +1162,7 @@ reset based on the original query." (define-key map "s" 'notmuch-search) (define-key map "m" 'notmuch-mua-new-mail) (define-key map "f" 'notmuch-show-forward-message) + (define-key map "l" 'notmuch-show-filter-thread) (define-key map "r" 'notmuch-show-reply-sender) (define-key map "R" 'notmuch-show-reply) (define-key map "|" 'notmuch-show-pipe-message) @@ -1403,6 +1405,16 @@ current thread." "Mark the current message as read." (notmuch-show-tag-message "-unread")) +(defun notmuch-show-filter-thread (query) + "Filter or LIMIT the current thread based on a new query string. + +Reshows the current thread with matches defined by the new query-string." + (interactive (list (notmuch-read-query "Filter thread: "))) + (let ((msg-id (notmuch-show-get-message-id))) + (setq notmuch-show-query-context (if (string= query "") nil query)) + (notmuch-show-refresh-view t) + (notmuch-show-goto-message msg-id))) + ;; Functions for getting attributes of several messages in the current ;; thread. -- 1.7.9.1