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 22B2B431FB6 for ; Thu, 26 Apr 2012 11:21:36 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] 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 6JeSCHA8s4sl for ; Thu, 26 Apr 2012 11:21:34 -0700 (PDT) Received: from guru.guru-group.fi (guru-group.fi [87.108.86.66]) by olra.theworths.org (Postfix) with ESMTP id 54F14431FAE for ; Thu, 26 Apr 2012 11:21:34 -0700 (PDT) Received: by guru.guru-group.fi (Postfix, from userid 501) id EA45A68055; Thu, 26 Apr 2012 21:21:28 +0300 (EEST) From: Tomi Ollila To: Mark Walters , notmuch@notmuchmail.org Subject: Re: [PATCH v2 1/2] emacs: add a filter option to show In-Reply-To: <1335373954-4578-2-git-send-email-markwalters1009@gmail.com> References: <1335373954-4578-1-git-send-email-markwalters1009@gmail.com> <1335373954-4578-2-git-send-email-markwalters1009@gmail.com> User-Agent: Notmuch/0.12+128~g512e176 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: Thu, 26 Apr 2012 18:21:36 -0000 On Wed, Apr 25 2012, Mark Walters wrote: > 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). > --- LGTM -- just one question -- to be analogous with 'notmuch-search-filter' 'notmuch-show-filter-thread' could look something like: (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: "))) (setq notmuch-show-query-context (if (string= query "") nil query)) (notmuch-show-refresh-view t)) ? Tomi > 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 30b26d1..4b4d663 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 "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) > @@ -1399,6 +1401,16 @@ current thread." > "Mark the current message as read." > (notmuch-show-tag-message "-unread")) > > +(defun notmuch-show-filter-thread () > + "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) > + (setq notmuch-show-query-context (notmuch-read-query "Filter thread: ")) > + (when (string= notmuch-show-query-context "") > + (setq notmuch-show-query-context nil)) > + (notmuch-show-refresh-view t)) > + > ;; Functions for getting attributes of several messages in the current > ;; thread. > > -- > 1.7.9.1 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch