<<< Date Index >>>     <<< Thread Index >>>

Re: mutt: 5 new changesets



Hi,

* Kyle Wheeler wrote:

> What about instituting something similar to the existing format
> markers? Just as mutt indicates in the compose menu that the text
> attachment will be encoded as quoted-printable, how about a similar
> (toggle-able) marker to tell the user whether or not f=f will be used
> and/or enforced?

See the attached patch. It adds %p to $attach_format to print out the
parameters for for Content-Type. Use it as:

    set attach_format="...%.7m/%.7M%p"

because it starts every entry with ";". For readability of the output,
the "charset" and "boundary" params are excluded. I think I like the
patch enough to commit it (though we're in feature freeze).

Because $attach_format is also used in the attachment menu, I see this
as a win because you can e.g. check for format=flowed messages simply
hitting 'v' and not either toggling header weeding and look for
Content-Type, or even unignore Content-Type. The same counts for
attachment description vs. attachment filename.

Comments?

Rocco
diff --git a/recvattach.c b/recvattach.c
--- a/recvattach.c
+++ b/recvattach.c
@@ -167,6 +167,7 @@ ATTACHPTR **mutt_gen_attach_list (BODY *
  * %m = major MIME type
  * %M = MIME subtype
  * %n = attachment number
+ * %p = MIME Content-Type parameters
  * %s = size
  * %u = unlink 
  */
@@ -297,6 +298,22 @@ const char *mutt_attach_fmt (char *dest,
        snprintf (dest, destlen, fmt, aptr->num + 1);
       }
       break;
+    case 'p':
+      if (!optional)
+      {
+       BUFFER *tmp = mutt_buffer_init(NULL);
+       PARAMETER *p = aptr->content ? aptr->content->parameter : NULL;
+       while (p)
+       {
+         if (ascii_strcasecmp (p->attribute, "boundary") != 0 &&
+             ascii_strcasecmp (p->attribute, "charset") != 0)
+           mutt_buffer_printf (tmp, "; %s=%s", p->attribute, p->value);
+         p = p->next;
+       }
+       snprintf (dest, destlen, "%s", NONULL(tmp->data));
+       mutt_buffer_free (&tmp);
+      }
+      break;
     case 'Q':
       if (optional)
         optional = aptr->content->attach_qualifies;