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 mHt5LB2n+F/FdQAA0tVLHw (envelope-from ) for ; Fri, 08 Jan 2021 18:40:29 +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 EFNWKB2n+F8sKQAAB5/wlQ (envelope-from ) for ; Fri, 08 Jan 2021 18:40:29 +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 72BD8940597 for ; Fri, 8 Jan 2021 18:40:29 +0000 (UTC) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 0A99529DDF; Fri, 8 Jan 2021 13:40:14 -0500 (EST) Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by mail.notmuchmail.org (Postfix) with ESMTPS id F289629D85 for ; Fri, 8 Jan 2021 13:40:07 -0500 (EST) Received: by mail-wr1-x42d.google.com with SMTP id c5so9917933wrp.6 for ; Fri, 08 Jan 2021 10:40:07 -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=OcBzfuvnx65DdBbPyVB6AzaAL8JS7vbQH/DRJOH9PT0=; b=jlAv5Z7TvWyqnBfsaUhrsehZtQ556eCY48SSvoEOUANRK6qoqcwiMxWi0VQHiS2q1I sM5RrNR+AlsimuonZOjKkyu76LMDsxjVaBE/Mhdm1N/e/Mn0R3iLka0IdASmlQkB96Hf bGeBgjLydz+iF6Fe7eYHpfDr1xhBkCPuBfDWuNgCc19o8UZod1SIrWGos2olpNhPg3vi BkjdsPYdZJQL2zhhzRMH/lfyQrnLezFEKwjnToNuTBEKjmG6YwZoDIqJrygg0OZ78rl0 OomCx7AENeCCWLkE6hpuCAT2qy+qNbv/eK1Y1tgo0AqtXWKNNwGga8buDu0LjlB2VeLA I1YQ== 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=OcBzfuvnx65DdBbPyVB6AzaAL8JS7vbQH/DRJOH9PT0=; b=jIJLP2nP47pkQnTpP1pM/D6hkUNbKEOyhl+8fbolEIYkEFav8LA3ojxU/ehGmpybtE MjR4TiYekQSICqPLY8ypsZKrPwVKZ+NigGOPOdiOo9dOaOetiRKP3BDYsTNsfI7gntYn 18MVz4cfbvnrkdp6P+oVYFhxTkr2O2ZsyxCGMRdoQ1q69Y0ZRGwfVaTvXkWHUOFg/q+U 3tF8bNbY5IJQkQW0f2DFGk1/Z8xhmNF9UayLyj4aFMm4WVx4lqzW9kvHCamre2e753mv FzKQIybum2TkR4fOTHM7y8fCxNMlluulwVQnZGEz8qMzwJmkE7FahcW2oKJoifcQiWa4 //og== X-Gm-Message-State: AOAM5339iA+0QXjJFlPM5iPJSRiHj2TWP64xFBAR8J+CJAHkghiTaRTK MNUB0/nNwDQk7ED5PcxcUUDlUqowIG3nNgQ9 X-Google-Smtp-Source: ABdhPJweuumse9iKuI8M5D3tcqPulDi4VvVt2LBUy95oVL30b8b0o8+pojbSibUEI2MhXjkVA0RMHw== X-Received: by 2002:adf:f48c:: with SMTP id l12mr4879395wro.280.1610131206876; Fri, 08 Jan 2021 10:40:06 -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 y68sm14497884wmc.0.2021.01.08.10.40.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Jan 2021 10:40:06 -0800 (PST) Received: from localhost (disaster-area.hh.sledj.net [local]) by disaster-area.hh.sledj.net (OpenSMTPD) with ESMTPA id ef4cc683; Fri, 8 Jan 2021 18:40:04 +0000 (UTC) From: David Edmondson To: notmuch@notmuchmail.org Subject: [PATCH 2/2] emacs: Add notmuch-show-insert-msg-hook Date: Fri, 8 Jan 2021 18:40:04 +0000 Message-Id: <20210108184004.781702-3-dme@dme.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210108184004.781702-1-dme@dme.org> References: <20210108184004.781702-1-dme@dme.org> MIME-Version: 1.0 Message-ID-Hash: H6Q623KNEFJT3VYY3K4CV6DKKTM5AOZ3 X-Message-ID-Hash: H6Q623KNEFJT3VYY3K4CV6DKKTM5AOZ3 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: -0.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=jlAv5Z7T; 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: 72BD8940597 X-Spam-Score: -0.07 X-Migadu-Scanner: scn0.migadu.com X-TUID: 6NoOLkLJXG70 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 222c9dae..292677bc 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -111,6 +111,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. @@ -1104,7 +1110,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))) (defun notmuch-show-toggle-process-crypto () "Toggle the processing of cryptographic MIME parts." -- 2.29.2