[PATCH] emacs: add a filter option to show
authorMark Walters <markwalters1009@gmail.com>
Tue, 24 Apr 2012 23:17:01 +0000 (00:17 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:46:42 +0000 (09:46 -0800)
3e/a3d596311cc1bc78f5fc2687a1f9abafc0f16a [new file with mode: 0644]

diff --git a/3e/a3d596311cc1bc78f5fc2687a1f9abafc0f16a b/3e/a3d596311cc1bc78f5fc2687a1f9abafc0f16a
new file mode 100644 (file)
index 0000000..f91651d
--- /dev/null
@@ -0,0 +1,120 @@
+Return-Path: <markwalters1009@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 92220431FAF\r
+       for <notmuch@notmuchmail.org>; Tue, 24 Apr 2012 16:16:51 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 2.7\r
+X-Spam-Level: **\r
+X-Spam-Status: No, score=2.7 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
+       FREEMAIL_REPLY=2.499, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id BiqpRm+Bg+Wo for <notmuch@notmuchmail.org>;\r
+       Tue, 24 Apr 2012 16:16:51 -0700 (PDT)\r
+Received: from mail-wg0-f41.google.com (mail-wg0-f41.google.com\r
+ [74.125.82.41])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ E89DC431FAE   for <notmuch@notmuchmail.org>; Tue, 24 Apr 2012 16:16:50 -0700\r
+ (PDT)\r
+Received: by wgbds1 with SMTP id ds1so4445369wgb.2\r
+       for <notmuch@notmuchmail.org>; Tue, 24 Apr 2012 16:16:48 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id:x-mailer;\r
+       bh=Augww/GqItfyElilXAbAqyeCsMsUBtKj38ke0K3+RkE=;\r
+       b=WhLPUXc2g856unzjF1Y3uxpY3KyIttghrAfqsvOEFsXTGajf4oOu8Ko6rqQyhKBTfi\r
+       ZkIIFFtASb7mh0iP/GfaXv8PPmELIFi0HHHNvBRkjy2lPpgNCdiX/82tT4k4cp+u9QKU\r
+       6XBVtlm6euBtH6qmiaVnNjLGM259Ik3PIkGQ0TC97+KUActnnphwWauDr9kvN4oNwX+Z\r
+       XcwfAhqyx/+sXRtvV6J7BFODSk5fMxyXXZ2P+k2CwofnQj8jILljMq++fCXFs5/kKt/4\r
+       CIb4WoIkz53yQFLTOOYYnL6LNwGA+7fIBe4i8y2/0OvfB5vKp37ytbzr6jm29Vqo6Gv4\r
+       EkEQ==\r
+Received: by 10.180.77.4 with SMTP id o4mr931533wiw.17.1335309408298;\r
+       Tue, 24 Apr 2012 16:16:48 -0700 (PDT)\r
+Received: from localhost (94-192-233-223.zone6.bethere.co.uk.\r
+ [94.192.233.223])     by mx.google.com with ESMTPS id\r
+ u9sm33087681wix.0.2012.04.24.16.16.45 (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Tue, 24 Apr 2012 16:16:47 -0700 (PDT)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] emacs: add a filter option to show\r
+Date: Wed, 25 Apr 2012 00:17:01 +0100\r
+Message-Id: <1335309421-18893-1-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 24 Apr 2012 23:16:51 -0000\r
+\r
+Show the current thread with a different filter (i.e., open messages\r
+in the thread matching the new query).\r
+\r
+Currently bound to 'F'.\r
+\r
+Note that it is not the same as filter in search as it replaces the\r
+existing query rather than ANDing with it (but it does keep the\r
+threadid part of the query).\r
+---\r
+\r
+I think filtering (i.e. refining current query) is not ideal as one\r
+might want to remove some aspects of the query. Hence this patch\r
+replaces the query-context. \r
+\r
+Note does not fully work with excludes pending\r
+id:"1331836090-30560-1-git-send-email-markwalters1009@gmail.com"\r
+\r
+Best wishes\r
+\r
+Mark\r
+\r
+ emacs/notmuch-show.el |    8 ++++++++\r
+ 1 files changed, 8 insertions(+), 0 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index 30b26d1..4a5b8b1 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -42,6 +42,7 @@\r
+ (declare-function notmuch-search-next-thread "notmuch" nil)\r
+ (declare-function notmuch-search-show-thread "notmuch" nil)\r
+ (declare-function notmuch-update-tags "notmuch" (current-tags tag-changes))\r
++(declare-function notmuch-read-query "notmuch" (prompt))\r
\r
+ (defcustom notmuch-message-headers '("Subject" "To" "Cc" "Date")\r
+   "Headers that should be shown in a message, in this order.\r
+@@ -1157,6 +1158,7 @@ reset based on the original query."\r
+       (define-key map "s" 'notmuch-search)\r
+       (define-key map "m" 'notmuch-mua-new-mail)\r
+       (define-key map "f" 'notmuch-show-forward-message)\r
++      (define-key map "F" 'notmuch-show-filter-thread)\r
+       (define-key map "r" 'notmuch-show-reply-sender)\r
+       (define-key map "R" 'notmuch-show-reply)\r
+       (define-key map "|" 'notmuch-show-pipe-message)\r
+@@ -1399,6 +1401,12 @@ current thread."\r
+   "Mark the current message as read."\r
+   (notmuch-show-tag-message "-unread"))\r
\r
++(defun notmuch-show-filter-thread ()\r
++  "Show the current thread with a different filter"\r
++  (interactive)\r
++  (setq notmuch-show-query-context (notmuch-read-query "Filter thread: "))\r
++  (notmuch-show-refresh-view t))\r
++\r
+ ;; Functions for getting attributes of several messages in the current\r
+ ;; thread.\r
\r
+-- \r
+1.7.9.1\r
+\r