return (0);
}
- mutt_message_hook (cur, M_DISPLAYHOOK);
+ mutt_message_hook (cur, M_MESSAGEHOOK);
if (DisplayFilter && *DisplayFilter)
{
subject, don't have any effect on the current message when executed
from a send-hook.
-<sect1>Change settings before wieving a message<label id="display-hook">
+<sect1>Change settings before formatting a message<label id="message-hook">
<p>
Usage: <tt/display-hook/ [!]<em/pattern/ <em/command/
This command can be used to execute arbitrary configuration commands
-before viewing a message based upon information about the message.
+before viewing or formatting a message based upon information about the message.
<em/command/ is executed if the <em/pattern/ matches the message to be
displayed. When multiple matches occur, commands are executed in the order
they are specified in the muttrc.
to properly display messages which are tagged with a character set
name not known to mutt.
.TP
-\fBdisplay-hook\fP [\fB!\fP]\fIpattern\fP \fIcommand\fP
-Before mutt displays a message which matches the given \fIpattern\fP
-(or, when it is preceded by an exclamation mark, does not match the
-\fIpattern\fP), the given \fIcommand\fP is executed. When multiple
+\fBmessage-hook\fP [\fB!\fP]\fIpattern\fP \fIcommand\fP
+Before mutt displays (or formats for replying or forwarding) a
+message which matches the given \fIpattern\fP (or, when it is
+preceded by an exclamation mark, does not match the \fIpattern\fP),
+the given \fIcommand\fP is executed. When multiple
\fBdisplay-hook\fPs match, they are executed in the order in
which they occur in the configuration file.
.TP
ptr->rx.not == not &&
!mutt_strcmp (pattern.data, ptr->rx.pattern))
{
- if (data & (M_FOLDERHOOK | M_SENDHOOK | M_DISPLAYHOOK))
+ if (data & (M_FOLDERHOOK | M_SENDHOOK | M_MESSAGEHOOK))
{
/* these hooks allow multiple commands with the same
* pattern, so if we've already seen this pattern/command pair, just
break;
}
- if (data & (M_SENDHOOK | M_SAVEHOOK | M_FCCHOOK | M_DISPLAYHOOK))
+ if (data & (M_SENDHOOK | M_SAVEHOOK | M_FCCHOOK | M_MESSAGEHOOK))
{
if ((pat = mutt_pattern_comp (pattern.data,
- (data & (M_SENDHOOK | M_FCCHOOK | M_DISPLAYHOOK)) ? 0 : M_FULL_MSG,
+ (data & (M_SENDHOOK | M_FCCHOOK | M_MESSAGEHOOK)) ? 0 : M_FULL_MSG,
err)) == NULL)
goto error;
}
{ "default_hook", DT_STR, R_NONE, UL &DefaultHook, UL "~f %s !~P | (~P ~C %s)" },
/*
** .pp
- ** This variable controls how send-hooks, display-hooks, save-hooks,
+ ** This variable controls how send-hooks, message-hooks, save-hooks,
** and fcc-hooks will
** be interpreted if they are specified with only a simple regexp,
** instead of a matching pattern. The hooks are expanded when they are
{ "color", mutt_parse_color, 0 },
{ "uncolor", mutt_parse_uncolor, 0 },
#endif
- { "display-hook", mutt_parse_hook, M_DISPLAYHOOK },
{ "exec", mutt_parse_exec, 0 },
{ "fcc-hook", mutt_parse_hook, M_FCCHOOK },
{ "fcc-save-hook", mutt_parse_hook, M_FCCHOOK | M_SAVEHOOK },
{ "lists", parse_list, UL &MailLists },
{ "macro", mutt_parse_macro, 0 },
{ "mailboxes", mutt_parse_mailboxes, 0 },
+ { "message-hook", mutt_parse_hook, M_MESSAGEHOOK },
{ "mbox-hook", mutt_parse_hook, M_MBOXHOOK },
{ "mono", mutt_parse_mono, 0 },
{ "my_hdr", parse_my_hdr, 0 },
#define M_FCCHOOK (1<<3)
#define M_SAVEHOOK (1<<4)
#define M_CHARSETHOOK (1<<5)
-#define M_DISPLAYHOOK (1<<6)
+#define M_MESSAGEHOOK (1<<6)
#ifdef HAVE_PGP
#define M_PGPHOOK (1<<7)
#endif
if (cur)
{
+ mutt_message_hook (cur->hdr, M_MESSAGEHOOK);
mutt_forward_intro (tmpfp, cur->hdr);
_mutt_copy_message (tmpfp, fp, cur->hdr, cur->hdr->content, cmflags, chflags);
mutt_forward_trailer (tmpfp);
{
if (idx[i]->content->tagged)
{
+ mutt_message_hook (idx[i]->content->hdr, M_MESSAGEHOOK);
mutt_forward_intro (tmpfp, idx[i]->content->hdr);
_mutt_copy_message (tmpfp, fp, idx[i]->content->hdr,
idx[i]->content->hdr->content, cmflags, chflags);
int cmflags = M_CM_PREFIX | M_CM_DECODE | M_CM_CHARCONV;
int chflags = CH_DECODE;
+ mutt_message_hook (cur, M_MESSAGEHOOK);
+
mutt_make_attribution (Context, cur, tmpfp);
if (!option (OPTHEADER))
{
int chflags = CH_DECODE, cmflags = 0;
+ mutt_message_hook (cur, M_MESSAGEHOOK);
#ifdef HAVE_PGP
if ((cur->pgp & PGPENCRYPT) && option (OPTFORWDECODE))
}
#endif /* HAVE_PGP */
+ mutt_message_hook (cur, M_MESSAGEHOOK);
+
mutt_make_attribution (ctx, cur, out);
if (!option (OPTHEADER))