From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id aIdyNOPrA2G8cAEAgWs5BA (envelope-from ) for ; Fri, 30 Jul 2021 14:09:07 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id +FAnMOPrA2G8fwAA1q6Kng (envelope-from ) for ; Fri, 30 Jul 2021 12:09:07 +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 9069ACE8C for ; Fri, 30 Jul 2021 14:09:07 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 365C4291D5; Fri, 30 Jul 2021 08:09:01 -0400 (EDT) X-Greylist: delayed 339 seconds by postgrey-1.36 at nmbug; Tue, 29 Dec 2020 10:04:26 EST Received: from mail.yoctocell.xyz (h87-96-130-155.cust.a3fiber.se [87.96.130.155]) by mail.notmuchmail.org (Postfix) with ESMTPS id EF78D27C7D for ; Tue, 29 Dec 2020 10:04:26 -0500 (EST) From: yoctocell DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1609253926; bh=1DizUD7gvQw88AoPXMFMfFWiWA1ZJANZLNDbMprGTGA=; h=From:To:Subject:Date; b=eucdGxG1pXmHNZSAB3E4y0EDGCh5ZkTg3lOCnJFavN3E0JhtvPQAZsvr5FR+P1k6h gi+SIu/Q7AC0g9xt8FD5XqomMYIt3+dOPZoNYX1v7dPpOvtzregz7BZZifmzZR/rjM 3o8t9jlBRtOAhl3pUpHD5JDtpAx5WLkiRRrMh7gQ= To: notmuch@notmuchmail.org Subject: emacs-notmuch: notmuch-show-hook runs too early Date: Tue, 29 Dec 2020 15:58:45 +0100 Message-ID: <87a6twd5ga.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: QJCJWU3AMOWIE3657H74NPXCHUALQVO3 X-Message-ID-Hash: QJCJWU3AMOWIE3657H74NPXCHUALQVO3 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="===============0257170980075192923==" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1627646947; 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=LHsdysLFL5hzXSGPhMHKg4j3JqIN834zaEZae3fU1Mg=; b=cB6wf8wRulUunM8730x0TvssN4ersY/IqayZFAjSOPDWEhEtR2vnpRt+UhX5kKDyRLn3oR yTkjpLpi7fbhZnUVO1VziSN1UmoRfCoTdrN5hSSCyPBcRGRDF1uCI0aGhf8tosolg5ugBn rcN4eEuxxTQggaSr5BHMK2xT4eTRAJn6gczj8T/xHFaKTwanrzXQE0F+ag5xdmZJga1zGk 1EnE3mVsZYl+vofqVePBiktXqwVgaeCBA1OsxYaEHI0deXN+FTm31j6y5HNqhfNoS3SCd4 T17SBk3s8mv20Dx8huU+0aanf694NmrPMRhfKMopvr4eW+WHlrkaRkQY100piw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1627646947; a=rsa-sha256; cv=none; b=eMiLojeiQykEQgoHvo7u7R82wKE0o3/Lb1H7MDWAZhQn1REgG0zAUISEuOD+56s8ycptfu crtk5ZqqE/8Js2cCxwHQ1tlP8ba4v9WygWw7AKJuiEYeFejo4i51WfdQsk8ZhxAHUDvP7P AwgH0o5o4d7P49Tt8I9L2yxyPUVbjXe1leMK1rJumZPzbA0k5LXMSTuyt/DBa5r7Z8gaH3 F4YCFp7tgJmBJtjv/yOvhBhLlIfKI3ITnGo/tpzrQAGurdCZk24s54DgEYd12NsPd9sK7M pygR0r6MStzY62NRaT44EV8Zh/5/kkvXmhhorjn/nwEzjzS6KVvH/9niILMyHA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=yoctocell.xyz header.s=mail header.b=eucdGxG1; 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=eucdGxG1; 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: 9069ACE8C X-Spam-Score: -0.51 X-Migadu-Scanner: scn1.migadu.com X-TUID: 9Z00iys4EuDh --===============0257170980075192923== 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/rRCUVHHB1YmxpY0B5 b2N0b2NlbGwueHl6AAoJEKz1CZmi+1x5WAIQAJhR3cxWMcNfRmmVB7tMDIk6qmo5 8V4vUVxQQUNalixQbudaCfjH/FXCMwwivRCjk5MFZtM/0n98R3SgzQmQTcyQBXYM NQ24rofTeZFnhGWz3W8Lao0S1p09j7WZuZE3dN9ZzD5h2hqdc71ECT+R40n8cn+q QTFcJ5pn1WzBQXuTzu8RP2/QPYGqECB5AMSREh6BgrpWqZ5tYSjbTF4z5qcOP4HM A3lf9DJSU96WEPINCTEtiqMnYUt179IqzXVDG+Vl9NExwGA7k+pZdzog4kkmNlnI r0I4l1Q5XLVA1YB65ykkUWJ1RZ4XqocnAP65lkIyqBPpfI5v94FfKHbtXYQ1bhcn MyMWcRni+75ac5UqjYeoXg+y+tzodHGTgEIrZXsawVXHHb+ak5HHpZWJI3AoPXdG dZ1T6x8EQXPfjPvgCb3lEQKIv7hVYvfELiPSaKZpDFddYeslW9846xEHZd8PlxL4 74OQrmC2nTqvrnDAyHKEAlctfqxtCTcB7sFt/rOdpp/Xpu2q1+5OwDk8E0D1Q1Bq CwD8gdzzmOnDV+5fMxuWTNMx/FYNUYbOBEsJcx7+zF4JxvQApkKHHEm5Pfw4L8X7 SY6ANUMRCa7vxC8JfmRTm56UX42u9e9Z0rEopUSLyVMKrzfOb+l2oIeGphABvYhq IINuUeAb8IN7nw8e =DWSB -----END PGP SIGNATURE----- --=-=-=-- --===============0257170980075192923== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============0257170980075192923==--