From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 8B+5NlQn9F9JQQAA0tVLHw (envelope-from ) for ; Tue, 05 Jan 2021 08:46:12 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id IEuKMlQn9F8BYwAA1q6Kng (envelope-from ) for ; Tue, 05 Jan 2021 08:46:12 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 9570B9404C4 for ; Tue, 5 Jan 2021 08:46:12 +0000 (UTC) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 44F5E29ACA; Tue, 5 Jan 2021 03:46:04 -0500 (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 519E127C7D for ; Tue, 5 Jan 2021 03:46:01 -0500 (EST) From: yoctocell DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1609836353; bh=V7n79dd8nE1/CZ3iTtyd7lMvXJDKEYSkU7zXj9VFA5c=; h=From:To:Subject:Date; b=A7vNj3YBjZVD1Etjiy5jNArCIrf9Tl7JeyaMXLImowCHvdS0XVA7V7blbuu3HHP4o 4doay9FyZf2XxWHLxYj24VYVUvMCTrl75xrYX2SGvq+QK5L/CYgiS59WQnEFV2A9TF ild0+xlXuALV2PJX+OFuR10VktTbFvGRsoX1+/lg= To: notmuch@notmuchmail.org Subject: emacs-notmuch: notmuch-show-hook runs too early Date: Tue, 05 Jan 2021 09:45:52 +0100 Message-ID: <875z4bvkjj.fsf@yoctocell.xyz> MIME-Version: 1.0 Message-ID-Hash: MBVS4UFMVKWUCHDH52CAB6GZGHSN37KF X-Message-ID-Hash: MBVS4UFMVKWUCHDH52CAB6GZGHSN37KF X-MailFrom: public@yoctocell.xyz 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; suspicious-header 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="===============4702959908440699266==" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.39 Authentication-Results: aspmx1.migadu.com; dkim=fail (body hash did not verify) header.d=yoctocell.xyz header.s=mail header.b=A7vNj3YB; 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 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 9570B9404C4 X-Spam-Score: -1.39 X-Migadu-Scanner: scn1.migadu.com X-TUID: JTXDbxEQl3cq --===============4702959908440699266== 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)) [0]: https://github.com/velkyel/gnus-article-treat-patch =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/0J0AVHHB1YmxpY0B5 b2N0b2NlbGwueHl6AAoJEKz1CZmi+1x5xp0QAKi45/PfqqobO47Lp21nIWG3E2rl ViU9eYmLwheyJS1Y/NJgos+0swO+6GDNNAnjkimA0zy3OPpyafw+JWAYgAbQyN9O OQSMUCtiOhWM7dq+AVyy6Ow4v5rCZ7WnRxB2VKGx9eK9T8oE79GYPR1H74xGTWpp jUSyPyU8m++kTs73dnYLwS8pZIyqrQMObG1KEUPhxafsnE1tby7/NSH/WAiZ8Rx7 DmChDsN7U0e74SccSCaDQCjxVFDA8l036Rig3kEVu7Vti/UQnahVUK6duqk1T6dW mt7mWMR/SY1XvgfJxXJm0a4UHKP5djqJPrPycI4uPoa65OpWtXbELspm3aH0zQIg ob52JsIWafNpLiCQlyrgl8/D43vVQdQQHJT7O7QjgUakNmiYRVP5wtzWZ/2kS/Gs 911h/dosE1YrUh6s9eAS+5rO63nuOwSkQgOE+RfG2DY5Qfe45f/Ksn8PsKorDpyO H/6nDI6HkiT5U1oHk9hJZNNhsoe53+VHPBPARrLBfITxo7yHPS+v5+vd6dit0MlS 5pu5m3TODaD1ypYjSMth/RbBW/Shwje+KJxBflZVNrHqmWfyHxgVVfxnsItP1Yz/ hnQuiAPWmWBudvcDo2GO8ITBUyZSqoyFhNp4LVmLqoc8+P8wQUZwwNcLjn2C+swy ngh12K7TcV4x92u8 =Puv+ -----END PGP SIGNATURE----- --=-=-=-- --===============4702959908440699266== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============4702959908440699266==--