mutt_message ("Executing command on matching messages...");
mutt_message _("Executing command on matching messages...");
int mutt_pattern_func (int op, char *prompt){  pattern_t *pat;  char buf[LONG_STRING] = "", *simple, error[STRING];  BUFFER err;  int i;  if (mutt_get_field (prompt, buf, sizeof (buf), M_PATTERN) != 0 || !buf[0])    return (-1);  mutt_message ("Compiling search pattern...");    simple = safe_strdup (buf);  mutt_check_simple (buf, sizeof (buf), NONULL (SimpleSearch));  err.data = error;  err.dsize = sizeof (error);  if ((pat = mutt_pattern_comp (buf, M_FULL_MSG, &err)) == NULL)  {    FREE (&simple);    mutt_error ("%s", err.data);    return (-1);  }  mutt_message ("Executing command on matching messages...");  if (op == M_LIMIT)  {    for (i = 0; i < Context->msgcount; i++)    {      Context->hdrs[i]->virtual = -1;      Context->hdrs[i]->limited = 0;      Context->hdrs[i]->collapsed = 0;      Context->hdrs[i]->num_hidden = 0;    }    Context->vcount = 0;    Context->vsize = 0;    Context->collapsed = 0;  }#define THIS_BODY Context->hdrs[i]->content  for (i = 0; i < Context->msgcount; i++)    if (mutt_pattern_exec (pat, M_MATCH_FULL_ADDRESS, Context, Context->hdrs[i]))    {      switch (op)      {	case M_DELETE:	  mutt_set_flag (Context, Context->hdrs[i], M_DELETE, 1);	  break;	case M_UNDELETE:	  mutt_set_flag (Context, Context->hdrs[i], M_DELETE, 0);	  break;	case M_TAG:	  mutt_set_flag (Context, Context->hdrs[i], M_TAG, 1);	  break;	case M_UNTAG:	  mutt_set_flag (Context, Context->hdrs[i], M_TAG, 0);	  break;	case M_LIMIT:	  Context->hdrs[i]->virtual = Context->vcount;	  Context->hdrs[i]->limited = 1;	  Context->v2r[Context->vcount] = i;	  Context->vcount++;	  Context->vsize+=THIS_BODY->length + THIS_BODY->offset -	                  THIS_BODY->hdr_offset;	  break;      }    }#undef THIS_BODY  mutt_clear_error ();  if (op == M_LIMIT)  {    Context->collapsed = 0;    safe_free ((void **) &Context->pattern);    if (Context->limit_pattern)       mutt_pattern_free (&Context->limit_pattern);    if (!Context->vcount)    {      mutt_error ("No messages matched criteria.");      /* restore full display */      for (i = 0; i < Context->msgcount; i++)      {	Context->hdrs[i]->virtual = i;	Context->hdrs[i]->limited = 0;	Context->hdrs[i]->num_hidden = 0;	Context->hdrs[i]->collapsed = 0;	Context->v2r[i] = i;      }      Context->vcount = Context->msgcount;    }    else if (strncmp (buf, "~A", 2) != 0)    {      Context->pattern = simple;      simple = NULL; /* don't clobber it */      Context->limit_pattern = mutt_pattern_comp (buf, M_FULL_MSG, &err);    }  }  FREE (&simple);  mutt_pattern_free (&pat);  return 0;}