From: David Edmondson <dme@dme.org>
To: notmuch@notmuchmail.org
Cc: David Edmondson <dme@dme.org>
Subject: [PATCH v2 2/2] emacs: Add notmuch-show-insert-msg-hook
Date: Sun, 21 Feb 2021 15:21:32 +0000 [thread overview]
Message-ID: <20210221152132.2302112-3-dme@dme.org> (raw)
In-Reply-To: <20210221152132.2302112-1-dme@dme.org>
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
next prev parent reply other threads:[~2021-02-21 15:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-21 15:21 [PATCH v2 0/2] scaffolding for autocrypt support David Edmondson
2021-02-21 15:21 ` [PATCH v2 1/2] emacs: with-current-notmuch-show-message should return the result of body David Edmondson
2021-02-21 15:21 ` David Edmondson [this message]
2021-02-23 2:02 ` [PATCH v2 0/2] scaffolding for autocrypt support Daniel Kahn Gillmor
2021-04-16 12:05 ` David Bremner
2021-04-19 8:53 ` David Edmondson
2021-07-07 11:02 ` Philip Kaludercic
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210221152132.2302112-3-dme@dme.org \
--to=dme@dme.org \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).