bruijn" <geerd.debruijn@nl.thalesgroup.com>.
/* remove any aliases marked for deletion */
a_list = NULL;
- for (a_cur = Aliases; a_cur; a_cur = a_cur->next)
+ for (a_cur = Aliases; a_cur;)
{
if (a_cur->del)
{
a_cur = Aliases;
}
else
+ {
a_list = a_cur;
+ a_cur = a_cur->next;
+ }
}
return 0;
<bf/Note:/ if you want to create an alias for a group (by specifying more than
one address), you <bf/must/ separate the addresses with a comma (``,'').
-To remove an alias or aliases:
+To remove an alias or aliases (``*'' means all aliases):
-<tt/unalias/ <em/key/ [ <em/key/ <em/.../ ]
+<tt/unalias/ [ * | <em/key/ <em/.../ ]
<tscreen><verb>
alias muttdude me@cs.hmc.edu (Michael Elkins)
<item>
<tt><ref id="alias" name="alias"></tt> <em/key/ <em/address/ [ , <em/address/, ... ]
<item>
-<tt><ref id="alias" name="unalias"></tt> <em/key/ [ <em/key/ ... ]
+<tt><ref id="alias" name="unalias"></tt> [ * | <em/key/ ... ]
<item>
<tt><ref id="alternative_order" name="alternative_order"></tt> <em/mimetype/ [ <em/mimetype/ ... ]
<item>
.PP
.nf
\fBalias\fP \fIkey\fP \fIaddress\fP [\fB,\fP \fIaddress\fP [ ... ]]
-\fBunalias\fP \fIkey\fP
+\fBunalias\fP [\fB * \fP | \fIkey\fP ]
.fi
.IP
\fBalias\fP defines an alias \fIkey\fP for the given addresses.
-\fBunalias\fP removes the alias corresponding to the given \fIkey\fP.
+\fBunalias\fP removes the alias corresponding to the given \fIkey\fP or
+all aliases when \(lq\fB*\fP\(rq is used as an argument.
.TP
\fBalternative_order\fP \fItype\fP[\fB/\fP\fIsubtype\fP] [ ... ]
This command permits you to define an order of preference which is
{
mutt_extract_token (buf, s, 0);
- for (tmp = Aliases; tmp; tmp = tmp->next)
+ if (mutt_strcmp ("*", buf->data) == 0)
{
- if (mutt_strcasecmp (buf->data, tmp->name) == 0)
+ if (CurrentMenu == MENU_ALIAS)
{
- if (CurrentMenu == MENU_ALIAS)
- {
+ for (tmp = Aliases; tmp ; tmp = tmp->next)
tmp->del = 1;
- set_option (OPTFORCEREDRAWINDEX);
+ set_option (OPTFORCEREDRAWINDEX);
+ }
+ else
+ mutt_free_alias (&Aliases);
+ break;
+ }
+ else
+ for (tmp = Aliases; tmp; tmp = tmp->next)
+ {
+ if (mutt_strcasecmp (buf->data, tmp->name) == 0)
+ {
+ if (CurrentMenu == MENU_ALIAS)
+ {
+ tmp->del = 1;
+ set_option (OPTFORCEREDRAWINDEX);
+ break;
+ }
+
+ if (last)
+ last->next = tmp->next;
+ else
+ Aliases = tmp->next;
+ tmp->next = NULL;
+ mutt_free_alias (&tmp);
break;
}
-
- if (last)
- last->next = tmp->next;
- else
- Aliases = tmp->next;
- tmp->next = NULL;
- mutt_free_alias (&tmp);
- break;
+ last = tmp;
}
- last = tmp;
- }
}
while (MoreArgs (s));
return 0;