From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id UN72NHPD+F/VIQAA0tVLHw (envelope-from ) for ; Fri, 08 Jan 2021 20:41:23 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id aKLEMHPD+F/wDQAAbx9fmQ (envelope-from ) for ; Fri, 08 Jan 2021 20:41:23 +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) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id CAD3B94051B for ; Fri, 8 Jan 2021 20:41:22 +0000 (UTC) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 6FEAB29DA9; Fri, 8 Jan 2021 15:41:17 -0500 (EST) Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by mail.notmuchmail.org (Postfix) with ESMTPS id 09ECE29D6E for ; Fri, 8 Jan 2021 15:41:15 -0500 (EST) Received: by mail-wr1-x429.google.com with SMTP id a12so10170156wrv.8 for ; Fri, 08 Jan 2021 12:41:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dme-org.20150623.gappssmtp.com; s=20150623; h=to:subject:in-reply-to:references:autocrypt:from:date:message-id :mime-version; bh=+lMbanOrVjxub0XWCFn3DbkKW+ro29c5EUagBM2v7PQ=; b=KfYhaAHOxY2+KIyIn/djibk/2skIdCjYZKV4dohPysh0PRdSwdwyo/bMZxIkUFos3U +zHREfOyk9piHY7ubldQvEDGCKbFBM3Xv65lAuhtqB4nQqU9k9dmb7m4ABsqCZSH3sME PzWVxoOWo4lGXeU8Usx+Loqc8oDwYNXpZsqkcT2ik4x4BwNthBrGhmIHONQ14ltYSCgG GHbGywTLPzkEL/Vhg3B3alh1mtf2mBDi0m2JfZzkoK5uViRf1pcXAU4xkBPYskNp5XFZ kXtQoaCVXPLYiT7Hrrdphm8purFp1slA98G5raV8R2K6DpFb0DeDmed9NsOrC2ETnC7+ ad7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:subject:in-reply-to:references:autocrypt:from :date:message-id:mime-version; bh=+lMbanOrVjxub0XWCFn3DbkKW+ro29c5EUagBM2v7PQ=; b=pWPXJwI5Sfh9ItRncYTT3wzdujO2HP6XLkN8jk7y6r/lTiOFbmRhBFcul6QKb72CTQ vDZVVBY/zABT3YtZGnyOyHcHHmfbcBwaiVFCygw8dDGSnu4x+xk2RexB8RLi+b1diGZ2 ErQIh5EkhZSooYfpPn1V1TITzVrzpCCljJkE1vN4WDKB7EgybJ/9TTr3zy95hAXvHoMG 6wGnnoZSk0fVkKDY2H1yfnRuzbVvxDGF8qLIE/+Uh4KtQcllNIDRhd18INuuxizal9GG kl6fKuZsc1/UdjZZ12AbAUFSct4nJGL8b3Sd0NeQrLiibbYQU9pPHm0Mn+dEWZGMaIxO I5TQ== X-Gm-Message-State: AOAM5336r4dO1VtlojNoXoaNPxvMzDj3SvbG8xzbWnsU1NXvJJuFj4gI ZAZNBSf18vQEsrJSn0pyCEn5+RMsGzv4kScl X-Google-Smtp-Source: ABdhPJxjYKaQOu2lIZGn+1xeSKa+YSlPsfK6l+cNNm2fEFPNKYKOVhvUWiFjgy0Ryo8snnivSCN6UQ== X-Received: by 2002:a5d:67c3:: with SMTP id n3mr5247359wrw.297.1610138473531; Fri, 08 Jan 2021 12:41:13 -0800 (PST) Received: from disaster-area.hh.sledj.net (disaster-area.hh.sledj.net. [2001:8b0:bb71:7140:64::1]) by smtp.gmail.com with ESMTPSA id h5sm15141720wrp.56.2021.01.08.12.41.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Jan 2021 12:41:13 -0800 (PST) Received: from localhost (disaster-area.hh.sledj.net [local]) by disaster-area.hh.sledj.net (OpenSMTPD) with ESMTPA id f42f57ef; Fri, 8 Jan 2021 20:41:12 +0000 (UTC) To: yoctocell , notmuch@notmuchmail.org Subject: Re: emacs-notmuch: notmuch-show-hook runs too early In-Reply-To: <875z4bvkjj.fsf@yoctocell.xyz> References: <875z4bvkjj.fsf@yoctocell.xyz> Autocrypt: addr=dme@dme.org; prefer-encrypt=mutual; keydata= mDMEX/iblRYJKwYBBAHaRw8BAQdAN8kTGqe1m4yPnGfbMcMUuQ3ojKS4JH+NYYquU4Di1w+0OURh dmlkIEVkbW9uZHNvbiAoZ2VuZXJhdGVkIGJ5IGF1dG9jcnlwdC5lbCkgPGRtZUBkbWUub3JnPoiW BBMWCAA+FiEE/ICtsJrVpkoid7YyZErRBLpKfqYFAl/4m5UCGwMFCQANLwAFCwkIBwMFFQoJCAsF FgMCAQACHgECF4AACgkQZErRBLpKfqbluwEAxmeza7JY/cTofEjd2zWqb69uN3tnEXNRSqmuuNtX lbIBAKtIUYKqyVErYZZn5hKKUe72fo8HWLbORwXAXrn7R1IAuDgEX/iblRIKKwYBBAGXVQEFAQEH QNNAESX+zTWoXEyWt8VzVqx3+ols+i8hYF00O9aAFxp3AwEIB4h+BBgWCAAmFiEE/ICtsJrVpkoi d7YyZErRBLpKfqYFAl/4m5UCGwwFCQANLwAACgkQZErRBLpKfqYJVwD/ZYIr8aXYXqzSdMGPSXbS 8lSGcrShPWDx3utynYsH7G8BALJ2xrukjg3bnazBQRZnC7KpwDS65GY6sfx+jKvXFvMI X-HGTTG: zarquon From: David Edmondson Date: Fri, 08 Jan 2021 20:41:12 +0000 Message-ID: MIME-Version: 1.0 Message-ID-Hash: AAXKKHPAF2L7MGQTV3YRV4TJUX2VKQ7F X-Message-ID-Hash: AAXKKHPAF2L7MGQTV3YRV4TJUX2VKQ7F X-MailFrom: dme@dme.org 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 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: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.07 Authentication-Results: aspmx1.migadu.com; dkim=fail (body hash did not verify) header.d=dme-org.20150623.gappssmtp.com header.s=20150623 header.b=KfYhaAHO; dmarc=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: CAD3B94051B X-Spam-Score: -1.07 X-Migadu-Scanner: scn0.migadu.com X-TUID: MZh5ekN+lDBb On Tuesday, 2021-01-05 at 09:45:52 +01, yoctocell wrote: > 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. Is there a reason not to use notmuch-wash-convert-inline-patch-to-part? It doesn't do quite as much (nothing for the header), but the patch should be appropriately rendered. > (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 > --- 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))))) > - (run-hooks 'notmuch-show-hook) > (if state > (notmuch-show-apply-state state) > ;; With no state to apply, just go to the first message. > - (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 > > -- > yoctocell > 8B88 2502 31D7 03B1 68BC 2691 3851 020D 7E61 BBC2 > _______________________________________________ > notmuch mailing list -- notmuch@notmuchmail.org > To unsubscribe send an email to notmuch-leave@notmuchmail.org dme. -- He caught a fleeting glimpse of a man, moving uphill pursued by a bus.