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 YPY/CoqiAWMyCAAAbAwnHQ (envelope-from ) for ; Sun, 21 Aug 2022 05:12:10 +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 yElSCoqiAWOjFgEA9RJhRA (envelope-from ) for ; Sun, 21 Aug 2022 05:12:10 +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 64BA26905 for ; Sun, 21 Aug 2022 05:12:09 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 0063F5F389; Sun, 21 Aug 2022 03:06:34 +0000 (UTC) Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by mail.notmuchmail.org (Postfix) with ESMTPS id 206815F365 for ; Sun, 21 Aug 2022 03:06:31 +0000 (UTC) Received: from fencepost.gnu.org ([2001:470:142:3::e]:39818) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oPbIB-0008U7-4h; Sat, 20 Aug 2022 23:06:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=fqqwlammacy/YxPZg4RrWmgEvsZbpSKmi9Kk/DTJ+b4=; b=EbiDMXoJYdvGl3 y3XMCMrlJbLdPaUy2dVH1VXCADJvSKOkILkERXxW9+52Z3iF8HryDtcI44pIh9uFBIZwkF2XqL2Po ou9dVeI3R1o9Gu111XHlkkh86TygzrP7yhtPCdbuN1ri9zf6aG2dC3cG8R6o/6/5Hu0KBkXAAXsXD ph0B8CW7HTUMPSJAioZA1ZnzH4T/1XVUTBa4/owq0fdk4hOpm0xmdwbSy/Yks05YFRKr0tbIq/Pm7 VDkeSA3iyU/UMYE0Jc6k25SRADTgzkYf9cl8lfO8ZE8NYMfKR1A3US0dBLuWKWbOE0ESFiHKLcXeL jtxzNdMI+6NSQo23ECQQ==; Received: from cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net ([92.233.85.247]:47084 helo=rivendell.localdomain) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oPbIA-0000S7-57; Sat, 20 Aug 2022 23:06:26 -0400 From: jao To: notmuch@notmuchmail.org Subject: [PATCH] emacs: new notmuch-tree-process-exit-functions Date: Sun, 21 Aug 2022 04:06:18 +0100 Message-Id: <20220821030618.2935554-1-jao@gnu.org> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Message-ID-Hash: CDGIPPY2JM75LGJY2NQM3T4H6WDXGD5Z X-Message-ID-Hash: CDGIPPY2JM75LGJY2NQM3T4H6WDXGD5Z X-MailFrom: jao@gnu.org 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 CC: jao 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=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1661051529; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=X3C2mQtvM6YQ0IXm1AmsSKHTztnPLbtKLEO16b8rOjI=; b=E47BwLSgpg1JldxS6MCgaTUG//etiavkJaFITAoId9QG4gNnq9iSUGGYxPNs91HmRTQPOL t8cCSdkOS64hZbPkLDhxUKQWwAOvZOeKaLrSK1hnVxDOMs1o86qsRWB7StfzkmXDUHcspF NnXBRaX0YWTQrjkVCiQY9EmnKcSw02X/y+Qr6jUZRhDGDsyWB7/3G0BDThxb3Hs0X0wLIU rKNRLvYhwtwQ/vd5mdGhjRMU1ZZ+OMMuQ572GaarzUHvTy0N0Ul7uHvEoJijSfs/Z1ltGs N47Q7EqvmSFQqLT56GkR7b4N7MbaC/nvz2oNC00/8xboEOd2sExzCfN2N2qrJg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1661051529; a=rsa-sha256; cv=none; b=ijJ/QNLGpiuFK/NX6h4aYRr1LbzC5yaG5gLZcfdvPJBexvjqAFeUwDVgyUTwOr4VRTQgUw Dm8HW6+8+kba+Q6+UGSFDxbCzubqSNWoBAq1FZaDBwtJx8aFNi0KxucsgZt1cavIMrjnFw FpADtDi7uK1hAw9bjmJmJ3vJrmTnvik2CCSCkhKchRGYMxaQUC9saefppTcN9axdMz99+S xZ68x0MLMG1Wi3AnXYzcGHVCQbKk9t38bXa3/Q3IUtpxmON10DPT8iWm3D42SImKEEud0l WKcSqVnhYubtd7AArd7rt/URehiHV0oUwbzeGXkaWrpSpLd2Zayg6z1zutI85Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gnu.org header.s=fencepost-gnu-org header.b=EbiDMXoJ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gnu.org (policy=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: 7.30 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gnu.org header.s=fencepost-gnu-org header.b=EbiDMXoJ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gnu.org (policy=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: 64BA26905 X-Spam-Score: 7.30 X-Migadu-Scanner: scn1.migadu.com X-TUID: uL9JNVx6T7NF Hook run when the tree insertion process finishes its job. -- This patch supersedes , but changing the new variable name. 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). 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..7ceddee2 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-exit-functions nil + "Functions called when the process inserting a tree of results finishes. + +Functions in this list are called with one argument, the process +object, and 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-exit-functions proc)))))) (defun notmuch-tree-process-filter (proc string) "Process and filter the output of \"notmuch show\" for tree view." -- 2.37.2