From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 92220431FAF for ; Tue, 24 Apr 2012 16:16:51 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 2.7 X-Spam-Level: ** X-Spam-Status: No, score=2.7 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, FREEMAIL_REPLY=2.499, 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 BiqpRm+Bg+Wo for ; Tue, 24 Apr 2012 16:16:51 -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 E89DC431FAE for ; Tue, 24 Apr 2012 16:16:50 -0700 (PDT) Received: by wgbds1 with SMTP id ds1so4445369wgb.2 for ; Tue, 24 Apr 2012 16:16:48 -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; bh=Augww/GqItfyElilXAbAqyeCsMsUBtKj38ke0K3+RkE=; b=WhLPUXc2g856unzjF1Y3uxpY3KyIttghrAfqsvOEFsXTGajf4oOu8Ko6rqQyhKBTfi ZkIIFFtASb7mh0iP/GfaXv8PPmELIFi0HHHNvBRkjy2lPpgNCdiX/82tT4k4cp+u9QKU 6XBVtlm6euBtH6qmiaVnNjLGM259Ik3PIkGQ0TC97+KUActnnphwWauDr9kvN4oNwX+Z XcwfAhqyx/+sXRtvV6J7BFODSk5fMxyXXZ2P+k2CwofnQj8jILljMq++fCXFs5/kKt/4 CIb4WoIkz53yQFLTOOYYnL6LNwGA+7fIBe4i8y2/0OvfB5vKp37ytbzr6jm29Vqo6Gv4 EkEQ== Received: by 10.180.77.4 with SMTP id o4mr931533wiw.17.1335309408298; Tue, 24 Apr 2012 16:16:48 -0700 (PDT) Received: from localhost (94-192-233-223.zone6.bethere.co.uk. [94.192.233.223]) by mx.google.com with ESMTPS id u9sm33087681wix.0.2012.04.24.16.16.45 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 Apr 2012 16:16:47 -0700 (PDT) From: Mark Walters To: notmuch@notmuchmail.org Subject: [PATCH] emacs: add a filter option to show Date: Wed, 25 Apr 2012 00:17:01 +0100 Message-Id: <1335309421-18893-1-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 1.7.9.1 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, 24 Apr 2012 23:16:51 -0000 Show the current thread with a different filter (i.e., open messages in the thread matching the new query). Currently bound to 'F'. Note that it is not the same as filter in search as it replaces the existing query rather than ANDing with it (but it does keep the threadid part of the query). --- I think filtering (i.e. refining current query) is not ideal as one might want to remove some aspects of the query. Hence this patch replaces the query-context. Note does not fully work with excludes pending id:"1331836090-30560-1-git-send-email-markwalters1009@gmail.com" Best wishes Mark emacs/notmuch-show.el | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 30b26d1..4a5b8b1 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. @@ -1157,6 +1158,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 "F" '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) @@ -1399,6 +1401,12 @@ current thread." "Mark the current message as read." (notmuch-show-tag-message "-unread")) +(defun notmuch-show-filter-thread () + "Show the current thread with a different filter" + (interactive) + (setq notmuch-show-query-context (notmuch-read-query "Filter thread: ")) + (notmuch-show-refresh-view t)) + ;; Functions for getting attributes of several messages in the current ;; thread. -- 1.7.9.1