From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id KJKRBOzrA2GCbgEAgWs5BA (envelope-from ) for ; Fri, 30 Jul 2021 14:09:16 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id qCoeAOzrA2E9EwAAbx9fmQ (envelope-from ) for ; Fri, 30 Jul 2021 12:09:16 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (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 BE292C9D5 for ; Fri, 30 Jul 2021 14:09:15 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 05709291E1; Fri, 30 Jul 2021 08:09:04 -0400 (EDT) Received: from mail.yoctocell.xyz (h87-96-130-155.cust.a3fiber.se [87.96.130.155]) by mail.notmuchmail.org (Postfix) with ESMTPS id 521BB29CED for ; Tue, 29 Dec 2020 10:09:26 -0500 (EST) From: yoctocell DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1609253986; bh=fSFwx6HZ7N+sDWJ2dOxrOJ3MMOWUT4USxTCb74oqJxY=; h=From:To:Subject:Date; b=gGD4TQa8/twFr+TA/JI25ymdk1BstArL++gW/LX/g/I4uGVi6HAI4jyva5xKulv6c 4jCpuUkwplee3IPOW6SaQqmKXC79MMfbBwRcC45SITUmO5pCabSXjc29n8feRn6H74 8/7ATb347+0aOvZdJpu4iHL9CtbeWETEtZKNK8LA= To: notmuch@notmuchmail.org Subject: emacs-notmuch: notmuch-show-hook runs too early Date: Tue, 29 Dec 2020 15:59:43 +0100 Message-ID: <875z4kd5eo.fsf@yoctocell.xyz> MIME-Version: 1.0 X-MailFrom: public@yoctocell.xyz X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0 Message-ID-Hash: 7BFFMCJ2QTA47RVNUV5D5MSIAD7GVBDL X-Message-ID-Hash: 7BFFMCJ2QTA47RVNUV5D5MSIAD7GVBDL X-Mailman-Approved-At: Fri, 30 Jul 2021 12:08:59 -0400 X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: multipart/mixed; boundary="===============7180929882843489632==" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1627646955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type:list-id: list-help:list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=TwiYUo/6zbRf5GQTXUV8HUHOuhBH7raJaaoFNhL0uLU=; b=MeKS04+fKzS63tNEPKNVpcVIXYQFJGQTNFvN3LKiJxBBRPzXHUPyuBMFqg+sEIlYEXOVxN WOGEJ/p7B2i1e8hk4WDDGiIgMCqtpBCc2814yDATdrq2+8JixsO94+iAxuPmHN0mM9+ABB xJf98q2u3iq3RGUuRJgxUAipsGk+uNyxFjSz3N+if6oTR5Up5iMB0asRGFJqxV7nvgfpJy nmvfZ8FupXYy+OXgGiHuDaO13aKVv5D/Us+ug3mi9QxykAxK7tixSNuXRPzY30aHnmcSql 5unpTYxzCv5x4zj6FnJ3qJW5xaZbHSzfLjae6eTzDV0naS3V8J0CcbtKfxHgkA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1627646955; a=rsa-sha256; cv=none; b=PDLWeOu3x1Yb4tjmcAtDuOE0dTa5ayvgAUgPSpZQm6xeQkX4T5dETjsSWesop9mK53lWMt /cscwazZhm5kIpyYyshr9eFw/Zk/cGxqfHZewz29u02m2XVADHNZTylJQYJtC+fC92DzP+ SQwq1vOUVnRe7UOA9/vDf0wSfsgyUKeWg4Z9U/x5BBRXLSDst9tgOXGoQKt/sH92DdS21o Fn0MrFt2HoXoI+VFf5Zqkwa3qgchEv7gHRQbC9rXd0BVaIsf1okYfdbwD1WoOFo/+VDlgN NrZVyAy0tQynyGHCdooeo2dTvrhwbj6O/hwWFtjo/ARlApOxXuiScZcsc/4LnA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=yoctocell.xyz header.s=mail header.b=gGD4TQa8; dmarc=fail reason="SPF not aligned (relaxed)" header.from=yoctocell.xyz (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -0.51 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=yoctocell.xyz header.s=mail header.b=gGD4TQa8; dmarc=fail reason="SPF not aligned (relaxed)" header.from=yoctocell.xyz (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: BE292C9D5 X-Spam-Score: -0.51 X-Migadu-Scanner: scn1.migadu.com X-TUID: nvzhheskmi2b --===============7180929882843489632== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable I am using a package called gnus-article-treat-patch[0] which colorizes patches in emails. It works expected when I manually call `ft/gnus-article-treat-patch` in a notmuch-show buffer, but it doesn't work when I add it as a hook. (add-hook 'notmuch-show-hook 'ft/gnus-article-treat-patch) `notmuch-show-hook` seems to be called too early so `ft/gnus-article-treat-patch` isn't able to read the contents of the message and apply any highlighting. I managed to get it to work with the following patch. diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 056c4e30..f9f3bdb1 100644 =2D-- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -1317,11 +1317,11 @@ If no messages match the query return NIL." (notmuch-sanitize (notmuch-show-strip-re (notmuch-show-get-subject))))) =2D (run-hooks 'notmuch-show-hook) (if state (notmuch-show-apply-state state) ;; With no state to apply, just go to the first message. =2D (notmuch-show-goto-first-wanted-message))) + (notmuch-show-goto-first-wanted-message)) + (run-hooks 'notmuch-show-hook)) ;; Report back to the caller whether any messages matched. forest)) =2D-=20 yoctocell 8B88 2502 31D7 03B1 68BC 2691 3851 020D 7E61 BBC2 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJJBAEBCAAzFiEEAVhh4yyK5+SEykIzrPUJmaL7XHkFAl/rRF8VHHB1YmxpY0B5 b2N0b2NlbGwueHl6AAoJEKz1CZmi+1x5YLQQAIYTTfeqV+aHLB6KNN2d34ZGn+F1 4pv5+waGblcJjAoN5BoWftmz1pZr2ObBEOZvW6gQsV+6hvu73+cB4cN8JjjXRlSt ZVjGxM3CtZ5TgnczaNgGZbWBcMigm4Yv0/nYurN/r5bMFHfaH8AZy1QNC7zBvNjD P1phCFtqgoX0713ARGndVW9lgKdBDVXPt6hWHTmhFgWJBrmrE9pyN9JyMDDOms6l FuhG+dmC4h9Cf/SQY8Jo2Zm1LC0T31ct8rQbBDFI8DXBx5almrXFoQJROF4D+MT+ J9WL1pDFJHy0JC56KCr8/RKjvZub37406Ffpb7kAUVA4Ox2lM2Vfs+MQlK5mYHUB zD7bEQlCdutSknJZpQQJXFKGJ9fUpX6TJWvsSFj+iQxT8skSDHvDPJH/+eTa5zQA 7X4wnenSvtAadjQXpYTNCrUdc9J9XqvZF23NKNi/LrZRouLCFIROcSFxTy+rGSRA R0L3ZIBN5tIqSdc6fmjKegDfYbzseQE6bHyix7JLL3nlZijKas+95fdRtcA9fMlT 2+I6+rGzsxDsyCnDhHRHWtiDN9xh6DPO9Ix6wjZW+k95uQKzcY5nyK6GUamBtikg jq1vvRgcfgcxqT8AMHnagV+2AO2/pfS64jis4O8nqGGzt2Lp9pejYPNdS6ncXBQN IVdssosajLjh50gR =HKiN -----END PGP SIGNATURE----- --=-=-=-- --===============7180929882843489632== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============7180929882843489632==--