From 573de066fe50888e0c226662b747aca3e0f9850b Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Wed, 25 Apr 2012 22:55:06 +2000 Subject: [PATCH] Re: [PATCH] emacs: add a filter option to show --- 6c/e8e2b8e613caa1dc8e074fd331d3ad84ebed84 | 146 ++++++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 6c/e8e2b8e613caa1dc8e074fd331d3ad84ebed84 diff --git a/6c/e8e2b8e613caa1dc8e074fd331d3ad84ebed84 b/6c/e8e2b8e613caa1dc8e074fd331d3ad84ebed84 new file mode 100644 index 000000000..cca477e99 --- /dev/null +++ b/6c/e8e2b8e613caa1dc8e074fd331d3ad84ebed84 @@ -0,0 +1,146 @@ +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 C0CC0431FAF + for ; Tue, 24 Apr 2012 19:55:14 -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 eLZfgDsWxdOE for ; + Tue, 24 Apr 2012 19:55:10 -0700 (PDT) +Received: from dmz-mailsec-scanner-8.mit.edu (DMZ-MAILSEC-SCANNER-8.MIT.EDU + [18.7.68.37]) + by olra.theworths.org (Postfix) with ESMTP id 84128431FAE + for ; Tue, 24 Apr 2012 19:55:10 -0700 (PDT) +X-AuditID: 12074425-b7f4a6d0000008e0-bb-4f97678d98be +Received: from mailhub-auth-1.mit.edu ( [18.9.21.35]) + by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP + id C5.6C.02272.D87679F4; Tue, 24 Apr 2012 22:55:09 -0400 (EDT) +Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) + by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id q3P2t8DK008930; + Tue, 24 Apr 2012 22:55:09 -0400 +Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) + (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q3P2t7rj000363 + (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); + Tue, 24 Apr 2012 22:55:07 -0400 (EDT) +Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77) + (envelope-from ) + id 1SMsNn-0007wX-0J; Tue, 24 Apr 2012 22:55:07 -0400 +Date: Tue, 24 Apr 2012 22:55:06 -0400 +From: Austin Clements +To: Mark Walters +Subject: Re: [PATCH] emacs: add a filter option to show +Message-ID: <20120425025506.GM17810@mit.edu> +References: <1335309421-18893-1-git-send-email-markwalters1009@gmail.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <1335309421-18893-1-git-send-email-markwalters1009@gmail.com> +User-Agent: Mutt/1.5.21 (2010-09-15) +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFuplleLIzCtJLcpLzFFi42IR4hRV1u1Nn+5vsGQ7r8XquTwW12/OZHZg + 8tg56y67x7NVt5gDmKK4bFJSczLLUov07RK4Mr4838dSsEOsYk2HQwPjXKEuRk4OCQETie6v + bWwQtpjEhXvrgWwuDiGBfYwSp1f/Y4RwNjBK9C9YxAThnGSS+DG/nxnCWcIoMW/uFSaQfhYB + VYnt75rAZrEJaEhs27+cEcQWEdCRuH1oATuIzSwgLfHtdzNYvbCAucSF6X1g9bxANZ/WXAer + ERLwlLi+ZQcLRFxQ4uTMJywQvVoSN/69BOrlAJuz/B8HiMkp4CUxaYImSIWogIrElJPb2CYw + Cs1C0jwLSfMshOYFjMyrGGVTcqt0cxMzc4pTk3WLkxPz8lKLdC30cjNL9FJTSjcxgkKa3UV1 + B+OEQ0qHGAU4GJV4eGfvneYvxJpYVlyZe4hRkoNJSZT3ZOp0fyG+pPyUyozE4oz4otKc1OJD + jBIczEoivEK3gMp5UxIrq1KL8mFS0hwsSuK8mlrv/IQE0hNLUrNTUwtSi2CyMhwcShK8v9KA + hgoWpaanVqRl5pQgpJk4OEGG8wAN1wWmACHe4oLE3OLMdIj8KUZdjmtfjl5hFGLJy89LlRLn + ZQUpEgApyijNg5sDS0WvGMWB3hLm/QSyjgeYxuAmvQJawgS05FsQyAfFJYkIKakGRsnXn7aW + LrqvfXbilvmT+7fY6Lcv4Vp2QnJaS8ymtQcik5VEZstu7P130sIzmjNikneaJfNZTQ1NBj3p + BYp18+v/xhtc5s7xniby9mf8qyWLH/l1Lj0dk3Xi3Vel16UqM1mP35nc8+6bJecDYTnPFqMn + 8nrHJctve62/e2DH/c+yp09vTEjcWq3EUpyRaKjFXFScCACD061ZIAMAAA== +Cc: notmuch@notmuchmail.org +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: Wed, 25 Apr 2012 02:55:14 -0000 + +LGTM. I've been wanting this functionality for a while, but have been +too lazy to implement it myself. + +I do have one request, though. Could we bind this to 'l' for "limit"? +Generally we've been quite good at making the shift key a modifier to +the functionality of the lower-case binding, which argues against 'F'. +It would also make sense to switch away from 'f' for filtering +(limiting) in search-view; 'f' is one of the few bindings that's used +in both search and show mode with completely different meanings and +'l' would be a good candidate for the related functionality in both +views. + +Quoth Mark Walters on Apr 25 at 12:17 am: +> 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. +> -- 2.26.2