This new command removes virtual mailboxes (notmuch queries).
Closes: karelzak/mutt-kz#76
Closes: karelzak/mutt-kz#144
if (!*tmp)
*tmp = buffy_new (buf);
+ (*tmp)->magic = MUTT_NOTMUCH;
(*tmp)->new = 0;
(*tmp)->notified = 1;
(*tmp)->newly_created = 0;
(*tmp)->size = 0;
(*tmp)->desc = desc;
+#ifdef USE_SIDEBAR
+ mutt_sb_notify_mailbox (*tmp, 1);
+#endif
+ }
+#ifdef USE_SIDEBAR
+ mutt_sb_draw();
+#endif
+ return 0;
+}
+
+int mutt_parse_unvirtual_mailboxes (BUFFER *path, BUFFER *s, unsigned long data, BUFFER *err)
+{
+ BUFFY **tmp, *tmp1;
+
+ while (MoreArgs (s))
+ {
+ mutt_extract_token (path, s, 0);
+
+ if (mutt_strcmp (path->data, "*") == 0)
+ {
+ for (tmp = &VirtIncoming; *tmp;)
+ {
+ tmp1 = (*tmp)->next;
+#ifdef USE_SIDEBAR
+ mutt_sb_notify_mailbox (*tmp, 0);
+#endif
+ buffy_free (tmp);
+ *tmp = tmp1;
+ }
+#ifdef USE_SIDEBAR
+ mutt_sb_draw();
+#endif
+ return 0;
+ }
+
+ for (tmp = &VirtIncoming; *tmp; tmp = &((*tmp)->next))
+ {
+ if ((mutt_strcasecmp (path->data, (*tmp)->path) == 0) ||
+ (mutt_strcasecmp (path->data, (*tmp)->desc) == 0))
+ {
+ tmp1 = (*tmp)->next;
+#ifdef USE_SIDEBAR
+ mutt_sb_notify_mailbox (*tmp, 0);
+#endif
+ buffy_free (tmp);
+ *tmp = tmp1;
+ break;
+ }
+ }
}
+
+#ifdef USE_SIDEBAR
+ mutt_sb_draw();
+#endif
return 0;
}
#endif
</arg>
</group>
+ <command>unvirtual-mailboxes</command>
+ <group choice="req">
+ <arg choice="plain">
+ <replaceable class="parameter">*</replaceable>
+ </arg>
+ <arg choice="plain" rep="repeat">
+ <replaceable class="parameter">mailbox</replaceable>
+ </arg>
+ </group>
+
<command>tag-transforms</command>
<arg choice="plain">
<replaceable class="parameter">tag</replaceable>
# virtual-mailboxes description notmuch-URI { description notmuch-URI ...}
# virtual-mailboxes "Climbing" "notmuch://?query=climbing"
+# unvirtual-mailboxes { * | mailbox ...}
+
# Replace some tags with icons
# tag-transforms tag transformed-string { tag transformed-string ...}
# tag-transforms "inbox" "i" \
{ "unmailboxes", mutt_parse_mailboxes, MUTT_UNMAILBOXES },
#ifdef USE_NOTMUCH
{ "virtual-mailboxes",mutt_parse_virtual_mailboxes, 0 },
+ { "unvirtual-mailboxes",mutt_parse_unvirtual_mailboxes, 0 },
{ "tag-transforms", parse_tag_transforms, 0 },
{ "tag-formats", parse_tag_formats, 0 },
#endif
#ifdef USE_NOTMUCH
int mutt_parse_virtual_mailboxes (BUFFER *path, BUFFER *s, unsigned long data, BUFFER *err);
+int mutt_parse_unvirtual_mailboxes (BUFFER *path, BUFFER *s, unsigned long data, BUFFER *err);
#endif
FILE *mutt_open_read (const char *, pid_t *);