From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id QKAzKLCSpF7yVwAA0tVLHw (envelope-from ) for ; Sat, 25 Apr 2020 19:42:40 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 8Kc4JbeSpF5LHgAA1q6Kng (envelope-from ) for ; Sat, 25 Apr 2020 19:42:47 +0000 Received: from arlo.cworth.org (arlo.cworth.org [50.126.95.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D0349943098 for ; Sat, 25 Apr 2020 19:42:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 4E3886DE1444; Sat, 25 Apr 2020 12:42:41 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Xm-aAQWZBIMs; Sat, 25 Apr 2020 12:42:40 -0700 (PDT) Received: from arlo.cworth.org (localhost [IPv6:::1]) by arlo.cworth.org (Postfix) with ESMTP id 3AECB6DE1413; Sat, 25 Apr 2020 12:42:40 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 8C8426DE1413 for ; Sat, 25 Apr 2020 12:42:39 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qDBN5Mk05y5S for ; Sat, 25 Apr 2020 12:42:37 -0700 (PDT) Received: from cfg.domain (jb55.com [45.79.91.128]) by arlo.cworth.org (Postfix) with ESMTPS id 9C7106DE13E6 for ; Sat, 25 Apr 2020 12:42:37 -0700 (PDT) Received: from jb55.com (S010660e327dca171.vc.shawcable.net [24.84.152.187]) by jb55.com (OpenSMTPD) with ESMTPSA id db5c9fdf (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Sat, 25 Apr 2020 19:42:46 +0000 (UTC) From: William Casarin To: notmuch@notmuchmail.org Subject: [PATCH] emacs/tree: add notmuch-tree-filter Date: Sat, 25 Apr 2020 12:42:34 -0700 Message-Id: <20200425194234.17971-1-jb55@jb55.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: notmuch-bounces@notmuchmail.org Sender: "notmuch" X-Scanner: scn0 X-Spam-Score: -0.01 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 50.126.95.6 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Scan-Result: default: False [-0.01 / 13.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; GENERIC_REPUTATION(0.00)[-0.45947778629281]; DWL_DNSWL_FAIL(0.00)[50.126.95.6:server fail]; R_SPF_ALLOW(-0.20)[+a:c]; IP_REPUTATION_HAM(0.00)[asn: 27017(-0.18), country: US(-0.00), ip: 50.126.95.6(-0.46)]; TO_DN_NONE(0.00)[]; MX_GOOD(-0.50)[cached: notmuchmail.org]; MAILLIST(-0.20)[mailman]; RECEIVED_SPAMHAUS_PBL(0.00)[24.84.152.187:received]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:27017, ipnet:50.126.64.0/18, country:US]; MIME_TRACE(0.00)[0:+]; FROM_NEQ_ENVFROM(0.00)[jb55@jb55.com,notmuch-bounces@notmuchmail.org]; ARC_NA(0.00)[]; URIBL_BLOCKED(0.00)[jb55.com:email,notmuchmail.org:email]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[notmuch@notmuchmail.org]; DMARC_NA(0.00)[jb55.com]; HAS_LIST_UNSUB(-0.01)[]; RCPT_COUNT_ONE(0.00)[1]; DNSWL_BLOCKED(0.00)[50.126.95.6:from]; MID_CONTAINS_FROM(1.00)[]; RCVD_COUNT_SEVEN(0.00)[8]; FORGED_SENDER_MAILLIST(0.00)[] X-TUID: VefN26U7rKqL This implements the notmuch-tree version of notmuch-show-filter-thread and binds it to the L key. Signed-off-by: William Casarin --- emacs/notmuch-tree.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el index e5c23de2..8f7738d7 100644 --- a/emacs/notmuch-tree.el +++ b/emacs/notmuch-tree.el @@ -328,6 +328,7 @@ FUNC." (define-key map "p" 'notmuch-tree-prev-matching-message) (define-key map "N" 'notmuch-tree-next-message) (define-key map "P" 'notmuch-tree-prev-message) + (define-key map "L" 'notmuch-tree-filter) (define-key map (kbd "M-p") 'notmuch-tree-prev-thread) (define-key map (kbd "M-n") 'notmuch-tree-next-thread) (define-key map "k" 'notmuch-tag-jump) @@ -965,6 +966,14 @@ Complete list of currently available key bindings: (insert (format " (process returned %d)" exit-status))) (insert "\n"))))))))) +(defun notmuch-tree-filter (query) + "Filter or LIMIT the current tree based on a new query string. + +Reshows the current tree with matches defined by the new query-string." + (interactive (list (notmuch-read-query "Filter tree: "))) + (setq notmuch-tree-query-context (if (string= query "") nil query)) + (notmuch-tree-refresh-view t)) + (defun notmuch-tree-process-filter (proc string) "Process and filter the output of \"notmuch show\" for tree view" (let ((results-buf (process-buffer proc)) -- 2.25.1