From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id +ysHCZB6MmARVgAA0tVLHw (envelope-from ) for ; Sun, 21 Feb 2021 15:21:52 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id eI5KBJB6MmAPKAAAB5/wlQ (envelope-from ) for ; Sun, 21 Feb 2021 15:21:52 +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) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D3B64B519 for ; Sun, 21 Feb 2021 16:21:50 +0100 (CET) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 8D5EF26BE9; Sun, 21 Feb 2021 10:21:44 -0500 (EST) Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by mail.notmuchmail.org (Postfix) with ESMTPS id C75A426ACB for ; Sun, 21 Feb 2021 10:21:41 -0500 (EST) Received: by mail-wm1-x32f.google.com with SMTP id a132so11305153wmc.0 for ; Sun, 21 Feb 2021 07:21:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dme-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=C0ZZrQg5CpYs99pWcrHGXae8Dx6FKhQQH5ka/GvuBz8=; b=Yz0J9nxSAw07qgHIzrAWBArY/OW9cfD9UWezB/cokGJ09qNlKrSuLpGG5AG8KEVSGU iyi40G81N2AyONR0jRT6kolYug8TY/yLNe351u5N03vvd4KaSloiQLiXnSTL5JtyzAd6 yCW2lB7upzSTqQwfsKKnu7A8YHWgtLso7DqWC5vhYBHIJT0nFgIaOHcU/RfSsRAtoI1f 3Hk2BL2Uxy64hdJyZJ4KxsVhTP3QIpONfMR0UvJWzHaOHH+sW9Q9R6EMDXZxuC0xeqhX bVJtoUS/Y1/Nrc6hs+7y9HKamTt8bP4/AxiBasqLUh9rV51g4NbMxx5KBZCZNPLteI05 im8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=C0ZZrQg5CpYs99pWcrHGXae8Dx6FKhQQH5ka/GvuBz8=; b=nbKurRBRwnvPPhBzroQctO53/wB+zCizY8j2yeGmHfDsEbpTJACzXSnZoRT+BqQlxm uegaRf6rqh10dXRtJ8Zo9ngakGCDqBzH9IS1xmidTyFyUK8a6CBSOeIhCK00HAveUXIA jQVThAVnva4lA5cJ0eJ3LDEvWwP0PKP3V4UufeaPz8q03/v9LUfaiD+vqfK39fVMZVpg IJwTvF/x48hdLpJBEBlK+QtC0WM5uk3QBDyd2MK2FR/e19HsqZ9oAbGco2HLV7lYNxI3 Duy2WtzUWlDD2kezGvqbAi0+U6PNdMkyUQz25CdQ66BkxgEHXBVwPn5hvjFxZ/TE5bJz zryA== X-Gm-Message-State: AOAM532r6qx3aDAz8184zr9vsoHVbkaoNaaq0h43fQwZZgrUaXIb6gk8 ZMeN8FRYAMZ/mStj3naB6+k4daO1fNSz/Yt1 X-Google-Smtp-Source: ABdhPJyPelsF+ZuGCq531/OCmJSwH5nW3A+z3AROeH1omu+34DHItEtz7GzkwXXXST4T60liv8C0/g== X-Received: by 2002:a1c:2094:: with SMTP id g142mr16739832wmg.101.1613920894300; Sun, 21 Feb 2021 07:21:34 -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 s23sm21753150wmc.35.2021.02.21.07.21.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Feb 2021 07:21:34 -0800 (PST) Received: from localhost (disaster-area.hh.sledj.net [local]) by disaster-area.hh.sledj.net (OpenSMTPD) with ESMTPA id cb02e346; Sun, 21 Feb 2021 15:21:32 +0000 (UTC) From: David Edmondson To: notmuch@notmuchmail.org Subject: [PATCH v2 2/2] emacs: Add notmuch-show-insert-msg-hook Date: Sun, 21 Feb 2021 15:21:32 +0000 Message-Id: <20210221152132.2302112-3-dme@dme.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210221152132.2302112-1-dme@dme.org> References: <20210221152132.2302112-1-dme@dme.org> MIME-Version: 1.0 Message-ID-Hash: 3SO6WIILOA7U4YBIKMZRDK7EH6AM7EC2 X-Message-ID-Hash: 3SO6WIILOA7U4YBIKMZRDK7EH6AM7EC2 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 CC: David Edmondson 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.56 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=dme-org.20150623.gappssmtp.com header.s=20150623 header.b=Yz0J9nxS; dmarc=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: D3B64B519 X-Spam-Score: 1.56 X-Migadu-Scanner: scn0.migadu.com X-TUID: hTmcm653c59j Add a hook called after inserting each message into the buffer showing messages. --- emacs/notmuch-show.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 761be252..cda0bfe0 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -113,6 +113,12 @@ visible for any given message." :group 'notmuch-show :group 'notmuch-hooks) +(defcustom notmuch-show-insert-msg-hook nil + "Functions called after inserting a message." + :type 'hook + :group 'notmuch-show + :group 'notmuch-hooks) + (defcustom notmuch-show-max-text-part-size 100000 "Maximum size of a text part to be shown by default in characters. @@ -1112,7 +1118,9 @@ is t, hide the part initially and show the button." ;; Message visibility depends on whether it matched the search ;; criteria. (notmuch-show-message-visible msg (and (plist-get msg :match) - (not (plist-get msg :excluded)))))) + (not (plist-get msg :excluded)))) + + (run-hooks 'notmuch-show-insert-msg-hook))) ;;; Toggle commands -- 2.30.0