From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id wT6BBXJ6/GJdDQAAbAwnHQ (envelope-from ) for ; Wed, 17 Aug 2022 07:19:46 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 6FxrBHJ6/GKhQAAA9RJhRA (envelope-from ) for ; Wed, 17 Aug 2022 07:19:46 +0200 Received: from mail.notmuchmail.org (yantan.tethera.net [135.181.149.255]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 947CE857F for ; Wed, 17 Aug 2022 07:19:45 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id F10CE5FD33; Wed, 17 Aug 2022 05:19:42 +0000 (UTC) Received: from meesny.iki.fi (meesny.iki.fi [IPv6:2001:67c:2b0:1c1::201]) by mail.notmuchmail.org (Postfix) with ESMTPS id B62925E027 for ; Wed, 17 Aug 2022 05:19:40 +0000 (UTC) Received: from c53 (gw1.nor.fi [185.218.193.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: too) by meesny.iki.fi (Postfix) with ESMTPSA id 0C6E6202C5; Wed, 17 Aug 2022 08:19:39 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1660713579; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PnM5SnB7Mxhn8Mj7b3I5Xq4+0wZ22PaS6CZMJGyeaIA=; b=msf6DM14aWaSpIU+nE3bprMKRjLIJ4cXt9265xn4D8SbZPVWsG+ylkgryqvAXOwmJs3rx5 amzukoTHPQWVZCwjEFY3y9l0NLKzA+JHhLKeF74L5TYzcTWXJIIZeSnizO8K2cN4JO+Mmw 64TZQFk4IL5fGvhwXx5UZ85fefF11Ww= From: Tomi Ollila To: jao , notmuch@notmuchmail.org Subject: Re: [PATCH] emacs: new notmuch-tree-process-hook In-Reply-To: <20220816214023.1523322-1-jao@gnu.org> References: <20220816214023.1523322-1-jao@gnu.org> User-Agent: Notmuch/0.36+55~gfb9633d (https://notmuchmail.org) Emacs/27.1 X-Face: HhBM'cA~ MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1660713579; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PnM5SnB7Mxhn8Mj7b3I5Xq4+0wZ22PaS6CZMJGyeaIA=; b=lFwGL/fMWFNjsx1lRnGq8YrMPQu31Ziu0yp0OTU380LFDfCNInKndgvIW6RHBO2L2ZiTxO RgXqMBQrnCmgI+/P5svSo/qJ11bqcXeoXCa/OvKXonZp2KTx81a+NerNTTXYsQ9VCyUMEf rHB18M5naSOwPoMDrUQNJ99kGJBbmQM= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=too smtp.mailfrom=tomi.ollila@iki.fi ARC-Seal: i=1; s=meesny; d=iki.fi; t=1660713579; a=rsa-sha256; cv=none; b=ExICtBfqLYqYKMgRFw1kGontJSor6b0kdF7k5jit1Bf2GHFWDcQIqvDIksFHd/pYBdrRmX bCjOzzBmfEeJCqQvOR9Tqef4CsqSDcBGu1F8depe69ZoaUNFIbRz3rSW9fGNag9etItGDB CBAN6wiWK9UqmtBHY4hZVXzPAfNo5uk= Message-ID-Hash: VCQF62CEOUAXWTZBBNCO5LFSOCNW4JAP X-Message-ID-Hash: VCQF62CEOUAXWTZBBNCO5LFSOCNW4JAP X-MailFrom: tomi.ollila@iki.fi X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: DE ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1660713585; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=9Rf604f7H7f09YPb0+NiEg8fZv4oVFqTFZomIwiEtck=; b=en+u9qGW5mqaL8VirQ8dXt3ZK+i2qULAIKgeFRQ+ASaFuD0nBOWUvfQI+sG1KyKbuCo3VD 2PL/Ki4RFUWL1n36Z9ld2SVzPYzi8UwT3WKj9UufA/+j2XtPmuPFCQRNqutfBTiTNxkQr/ RePh/IEkGA+bnDsRQlOt4wthKnC8DpCLuS9esnlFtnmF23d/HHEKtA46a843FIvX6IRn5K RKK18Fxf5d0vGVKVGoQ34rpHIoWvKyaUnnyFcFRgNV51xGSSqUrqM4F9zSX4Lh9+eGPzsU lgbYWgBTfDMJFGkiGZDKk0TyVe2fNNDkuvir2YKSAEy60vLLzSFKyibqmL6Ljw== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1660713585; a=rsa-sha256; cv=fail; b=A9Szgnp7jxJfXgts1JpyUzx7Ex1nfMnbpT3oVlHgZc31/SXr1esmkYz6jROJ+2ugcvtYrL QncCgq+/Nt7PGgPK5+wQqzsWl1cw+SCuKqqEH0SNIwaePWZwDnCcvxRNdlSoKVfMH8V1r3 K4ifX8bwWYo3V+MtpveodVQSou0qUFha05qoHLTDvseGDFDn9swXFcQkU4wiqxjwhnfS0Q cd/ahAa65/AFazmTvNdHsVCByaYYYnkwptoTPaq9sPN3zx2o/1ewiDJK5D11FS/ddt19mb WhoDarAXS64YtOS8MPFi4p2cdzGLQxA7ecAhFkmQpHzSlHMIcvh7UnbPIVCHvA== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=iki.fi header.s=meesny header.b=msf6DM14; arc=reject ("signature check failed: fail, {[1] = sig:iki.fi:reject}"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: 2.61 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=iki.fi header.s=meesny header.b=msf6DM14; arc=reject ("signature check failed: fail, {[1] = sig:iki.fi:reject}"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 947CE857F X-Spam-Score: 2.61 X-Migadu-Scanner: scn1.migadu.com X-TUID: 0E1yXvniW903 On Tue, Aug 16 2022, jao@gnu.org wrote: > Hook run when the tree insertion process finishes its job. > > -- > > Right now, it can be used for silly things like removing or changing > the the "End of search." hardcoded message in the tree buffer. But > also for more sophisticated things like folding all threads in add-ons > like my outline mode for tree buffers (to be submitted). 2 things: - is the name matching to the functionality enough - IIRC if "hook" function takes args it should not be named as *-hook (?) (but *-functions) Tomi > > Signed-off-by: jao > --- > emacs/notmuch-tree.el | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el > index f63ac9a5..265f7c1f 100644 > --- a/emacs/notmuch-tree.el > +++ b/emacs/notmuch-tree.el > @@ -1084,6 +1084,12 @@ Complete list of currently available key bindings: > (setq buffer-read-only t) > (setq truncate-lines t)) > > +(defvar notmuch-tree-process-hook nil > + "Hook executed when the process inserting a tree of results finishes. > + > +Functions in this hook are called with one argument, the process > +object, with the tree results buffer as the current buffer.") > + > (defun notmuch-tree-process-sentinel (proc _msg) > "Add a message to let user know when \"notmuch tree\" exits." > (let ((buffer (process-buffer proc)) > @@ -1102,7 +1108,8 @@ Complete list of currently available key bindings: > (insert "End of search results.") > (unless (= exit-status 0) > (insert (format " (process returned %d)" exit-status))) > - (insert "\n"))))))))) > + (insert "\n")))) > + (run-hook-with-args 'notmuch-tree-process-hook proc)))))) > > (defun notmuch-tree-process-filter (proc string) > "Process and filter the output of \"notmuch show\" for tree view." > -- > 2.37.2 > > _______________________________________________ > notmuch mailing list -- notmuch@notmuchmail.org > To unsubscribe send an email to notmuch-leave@notmuchmail.org