+static int parse_attachments (BUFFER *buf, BUFFER *s,
+ unsigned long data __attribute__ ((unused)),
+ BUFFER *err) {
+ char op, *category;
+ string_list_t **listp;
+
+ mutt_extract_token(buf, s, 0);
+ if (!buf->data || *buf->data == '\0') {
+ m_strcpy(err->data, err->dsize, _("attachments: no disposition"));
+ return -1;
+ }
+
+ category = buf->data;
+ op = *category++;
+
+ if (op == '?') {
+ mutt_endwin (NULL);
+ fflush (stdout);
+ printf("\nCurrent attachments settings:\n\n");
+ print_attach_list(AttachAllow, '+', "A");
+ print_attach_list(AttachExclude, '-', "A");
+ print_attach_list(InlineAllow, '+', "I");
+ print_attach_list(InlineExclude, '-', "I");
+ set_option (OPTFORCEREDRAWINDEX);
+ set_option (OPTFORCEREDRAWPAGER);
+ mutt_any_key_to_continue (NULL);
+ return 0;
+ }
+
+ if (op != '+' && op != '-') {
+ op = '+';
+ category--;
+ }
+ if (!m_strncasecmp(category, "attachment", strlen(category))) {
+ if (op == '+')
+ listp = &AttachAllow;
+ else
+ listp = &AttachExclude;
+ }
+ else if (!m_strncasecmp(category, "inline", strlen(category))) {
+ if (op == '+')
+ listp = &InlineAllow;
+ else
+ listp = &InlineExclude;
+ } else {
+ m_strcpy(err->data, err->dsize, _("attachments: invalid disposition"));
+ return -1;
+ }
+
+ return parse_attach_list(buf, s, listp, err);
+}
+
+static int parse_unattachments (BUFFER *buf, BUFFER *s, unsigned long data __attribute__ ((unused)), BUFFER *err) {
+ char op, *p;
+ string_list_t **listp;
+
+ mutt_extract_token(buf, s, 0);
+ if (!buf->data || *buf->data == '\0') {
+ m_strcpy(err->data, err->dsize, _("unattachments: no disposition"));
+ return -1;
+ }
+
+ p = buf->data;
+ op = *p++;
+ if (op != '+' && op != '-') {
+ op = '+';
+ p--;
+ }
+ if (!m_strncasecmp(p, "attachment", strlen(p))) {
+ if (op == '+')
+ listp = &AttachAllow;
+ else
+ listp = &AttachExclude;
+ }
+ else if (!m_strncasecmp(p, "inline", strlen(p))) {
+ if (op == '+')
+ listp = &InlineAllow;
+ else
+ listp = &InlineExclude;
+ }
+ else {
+ m_strcpy(err->data, err->dsize, _("unattachments: invalid disposition"));
+ return -1;
+ }
+
+ return parse_unattach_list(buf, s, listp, err);
+}
+
+static int parse_unlists (BUFFER * buf, BUFFER * s,
+ unsigned long data __attribute__ ((unused)),
+ BUFFER * err __attribute__ ((unused)))