From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 30EE26DE0EF3 for ; Wed, 13 Nov 2019 00:00:16 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.338 X-Spam-Level: X-Spam-Status: No, score=-0.338 tagged_above=-999 required=5 tests=[AWL=-0.138, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1] autolearn=disabled 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 oqbmh4rd_8xT for ; Wed, 13 Nov 2019 00:00:15 -0800 (PST) Received: from jb55.com (jb55.com [45.79.91.128]) by arlo.cworth.org (Postfix) with ESMTPS id 16EB36DE0E84 for ; Wed, 13 Nov 2019 00:00:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d= jb55.com; h=from:to:subject:date:message-id; s=default; bh=SvkiCfpChBOrMUPlXI9XTdn/uTLnS2uaKMGO1TCvtnM=; b=hrwfb2VthvtSk60JXERDtsGkbtsSoMeRWTwPBYCNVNDkjye4L0A6LgW0UcVutxMHcnl+R7Ofbap8Fkt0sgf60JyNocFC988pXQ28sinsjyNY5hgHP3JVCNu03YuBQEdJDCL07mHS4AOTbQ8m0wekjUxM9g4Uom++wKyiu/xBkGLkG+zqKWvKjJGG7QSEDx8FBxXlHBPrg0JCNtTvH3e6ZK2LhQnveINgFBYUBl5xvoWnlcU/GQXv9Obaksjqyj65YKE0ysufxICzEJNMvP8NAxjR8wmnHwA2wXzku3/PIPgKqr4dm7N9HKgvHjleQDYzoGkHzibUWreNVm21O7Iwxg== Received: from jb55.com (S010660e327dca171.vc.shawcable.net [24.84.152.187]) by jb55.com (OpenSMTPD) with ESMTPSA id eba15636 TLS version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Wed, 13 Nov 2019 08:00:13 +0000 (UTC) From: William Casarin To: notmuch@notmuchmail.org Cc: Teemu Likonen , Johan Parin , David Edmondson , William Casarin Subject: [PATCH] emacs: bind C-u Z to notmuch-tree-from-search-thread Date: Wed, 13 Nov 2019 00:00:04 -0800 Message-Id: <20191113080004.32214-1-jb55@jb55.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: , X-List-Received-Date: Wed, 13 Nov 2019 08:00:16 -0000 This is an unbound function that is quite useful. It opens a selected thread in notmuch-tree from the current search query. Signed-off-by: William Casarin --- emacs/notmuch.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index 773d1206..b5c361ca 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -517,10 +517,13 @@ thread." (concat "*" (truncate-string-to-width subject 30 nil nil t) "*")) (message "End of search results.")))) -(defun notmuch-tree-from-search-current-query () +(put 'notmuch-tree-from-search-current-query 'notmuch-prefix-doc + "Show the selected thread with notmuch-tree") +(defun notmuch-tree-from-search-current-query (&optional search-thread) "Call notmuch tree with the current query" - (interactive) - (notmuch-tree notmuch-search-query-string)) + (interactive "P") + (if search-thread (notmuch-tree-from-search-thread) + (notmuch-tree notmuch-search-query-string))) (defun notmuch-tree-from-search-thread () "Show the selected thread with notmuch-tree" base-commit: 7ad7cfbff232431377562271901ee00202bf0bd0 -- 2.23.0