From: markus schnalke Date: Wed, 4 Jan 2012 17:29:23 +0000 (+0100) Subject: Renamed all standard sequences (e.g. cur->c) and made them globally changeable X-Git-Tag: mmh-thesis-end~428 X-Git-Url: http://git.marmaro.de/?p=mmh;a=commitdiff_plain;h=3cc8ed080f6e741b8df04a3ebe764c659e75cb38 Renamed all standard sequences (e.g. cur->c) and made them globally changeable The full list: cur -> c first -> f last -> l next -> n prev -> p all -> a new -> b (mnemonic: one beyond the last) They are globally changeable in config/config.c Could be that I'll add the old names again, as convenience aliases. --- diff --git a/config/config.c b/config/config.c index 6a1e0b1..294352a 100644 --- a/config/config.c +++ b/config/config.c @@ -77,9 +77,7 @@ char *draftfolder = "+drafts"; char *inbox = "Inbox"; /* profile entry name to specify the default folder */ char *curfolder = "Current-Folder"; -/* name of current message "sequence" */ -char *current = "cur"; - +/* predefined sequences */ char *seq_all = "a"; char *seq_beyond = "b"; /* the previous `new' sequence */ char *seq_cur = "c"; diff --git a/h/mh.h b/h/mh.h index 5d72178..b8896d1 100644 --- a/h/mh.h +++ b/h/mh.h @@ -177,8 +177,7 @@ struct msgs { #define set_selected(mp,msgnum) ((mp)->msgstats[(msgnum) - mp->lowoff] |= SELECTED) #define is_select_empty(mp,msgnum) ((mp)->msgstats[(msgnum) - mp->lowoff] & SELECT_EMPTY) -#define set_select_empty(mp,msgnum) \ - ((mp)->msgstats[(msgnum) - mp->lowoff] |= SELECT_EMPTY) +#define set_select_empty(mp,msgnum) ((mp)->msgstats[(msgnum) - mp->lowoff] |= SELECT_EMPTY) #define is_unseen(mp,msgnum) ((mp)->msgstats[(msgnum) - mp->lowoff] & SELECT_UNSEEN) #define unset_unseen(mp,msgnum) ((mp)->msgstats[(msgnum) - mp->lowoff] &= ~SELECT_UNSEEN) @@ -302,7 +301,6 @@ extern char *catproc; extern char *components; extern char *context; extern char *curfolder; -extern char *current; extern char *defaulteditor; extern char *defaultfolder; extern char *digestcomps; diff --git a/sbr/folder_pack.c b/sbr/folder_pack.c index cd588e4..c2b5911 100644 --- a/sbr/folder_pack.c +++ b/sbr/folder_pack.c @@ -95,8 +95,7 @@ folder_pack(struct msgs **mpp, int verbose) mp->lowmsg = 1; mp->hghmsg = hole - 1; - /* update the "cur" sequence */ - if (newcurrent != 0) + if (newcurrent) seq_setcur(mp, newcurrent); return 0; diff --git a/sbr/m_convert.c b/sbr/m_convert.c index 3065941..6e6acd7 100644 --- a/sbr/m_convert.c +++ b/sbr/m_convert.c @@ -21,10 +21,10 @@ #define FIRST 1 #define LAST 2 -#define getnew(mp) (mp->hghmsg + 1) +#define getnew(mp) ((mp)->hghmsg + 1) -static int convdir; /* convert direction */ -static char *delimp; +static int convdir; /* convert direction */ +static char *delimp; /* delimiter pointer */ /* ** static prototypes @@ -56,18 +56,18 @@ m_convert(struct msgs *mp, char *name) found = 0; /* - ** Check for special "new" sequence, which + ** Check for special beyond sequence, which ** is valid only if ALLOW_NEW is set. */ - if ((mp->msgflags & ALLOW_NEW) && !strcmp(cp, "new")) { + if ((mp->msgflags & ALLOW_NEW) && !strcmp(cp, seq_beyond)) { if ((err = first = getnew(mp)) <= 0) goto badmsg; else goto single; } - if (!strcmp(cp, "all")) - cp = "first-last"; + if (!strcmp(cp, seq_all)) + cp = concat(seq_first, "-", seq_last, NULL); if ((err = first = m_conv(mp, cp, FIRST)) <= 0) goto badmsg; @@ -181,16 +181,14 @@ single: */ if (mp->msgflags & ALLOW_NEW) { set_select_empty(mp, first); - } else { - if (first > mp->hghmsg - || first < mp->lowmsg - || !(does_exist(mp, first))) { - if (!strcmp(name, "cur")) - advise(NULL, "no %s message", name); - else - advise(NULL, "message %d doesn't exist", first); - return 0; - } + } else if (first > mp->hghmsg || first < mp->lowmsg + || !does_exist(mp, first)) { + if (!strcmp(name, seq_cur)) + advise(NULL, "no %s message", name); + else + advise(NULL, "message %d doesn't exist", + first); + return 0; } last = first; /* range of 1 */ } @@ -224,8 +222,9 @@ single: /* ** Convert the various message names to ** their numeric values. +** (`42' being an arbitrary number) ** -** n (integer) +** 42 ** prev ** next ** first @@ -269,19 +268,19 @@ m_conv(struct msgs *mp, char *str, int call) *bp++ = '\0'; delimp = cp; - if (!strcmp(buf, "first")) + if (!strcmp(buf, seq_first)) return (mp->hghmsg || !(mp->msgflags & ALLOW_NEW) ? mp->lowmsg : BADMSG); - if (!strcmp(buf, "last")) { + if (!strcmp(buf, seq_last)) { convdir = -1; return (mp->hghmsg || !(mp->msgflags & ALLOW_NEW) ? mp->hghmsg : BADMSG); } - if (!strcmp(buf, "cur")) + if (!strcmp(buf, seq_cur)) return (mp->curmsg > 0 ? mp->curmsg : BADMSG); - if (!strcmp(buf, "prev")) { + if (!strcmp(buf, seq_prev)) { convdir = -1; for (i = (mp->curmsg <= mp->hghmsg) ? mp->curmsg - 1 : mp->hghmsg; i >= mp->lowmsg; i--) { @@ -291,7 +290,7 @@ m_conv(struct msgs *mp, char *str, int call) return BADMSG; } - if (!strcmp(buf, "next")) { + if (!strcmp(buf, seq_next)) { for (i = (mp->curmsg >= mp->lowmsg) ? mp->curmsg + 1 : mp->lowmsg; i <= mp->hghmsg; i++) { if (does_exist(mp, i)) @@ -306,17 +305,17 @@ m_conv(struct msgs *mp, char *str, int call) /* ** Handle user defined sequences. ** They can take the following forms: +** (`42' being an arbitrary number) ** ** seq ** seq:prev ** seq:next ** seq:first ** seq:last -** seq:+n -** seq:-n -** seq:n +** seq:+42 +** seq:-42 +** seq:42 */ - static int attr(struct msgs *mp, char *cp) { @@ -328,11 +327,14 @@ attr(struct msgs *mp, char *cp) int range = 0; /* no range */ int first = 0; - /* hack for "cur-name", "cur-n", etc. */ - if (!strcmp(cp, "cur")) + /* hack for "c-name", "c-42", etc. */ + if (!strcmp(cp, seq_cur)) return 0; - if (isprefix("cur:", cp)) /* this code need to be rewritten... */ + /* "c:..." -- this code need to be rewritten... */ + if (strncmp(seq_cur, cp, strlen(seq_cur))==0 && + cp[strlen(seq_cur)] == ':') { return 0; + } /* Check for sequence negation */ if (!(dp = context_find(nsequence))) { @@ -359,25 +361,25 @@ attr(struct msgs *mp, char *cp) ** seq:last */ if (isalpha(*dp)) { - if (!strcmp(dp, "prev")) { + if (!strcmp(dp, seq_prev)) { convdir = -1; first = (mp->curmsg > 0) && (mp->curmsg <= mp->hghmsg) ? mp->curmsg - 1 : mp->hghmsg; - } else if (!strcmp(dp, "next")) { + } else if (!strcmp(dp, seq_next)) { convdir = 1; first = (mp->curmsg >= mp->lowmsg) ? mp->curmsg + 1 : mp->lowmsg; - } else if (!strcmp(dp, "first")) { + } else if (!strcmp(dp, seq_first)) { convdir = 1; - } else if (!strcmp(dp, "last")) { + } else if (!strcmp(dp, seq_last)) { convdir = -1; } else return BADLST; } else { /* - ** seq:n (or) - ** seq:+n (or) - ** seq:-n + ** seq:42 (or) + ** seq:+42 (or) + ** seq:-42 */ if (*dp == '+') dp++; diff --git a/sbr/m_draft.c b/sbr/m_draft.c index 77ea394..8492dd9 100644 --- a/sbr/m_draft.c +++ b/sbr/m_draft.c @@ -12,8 +12,8 @@ /* -** `which' should either be "cur" to use the current draft -** or "new" to start with a new draft. +** `which' should either be the cur sequence to use the current draft +** or the beyond sequence to start with a new draft. */ char * m_draft(char *which) @@ -30,7 +30,7 @@ m_draft(char *which) /* ** Make sure we have enough message status space for all - ** the message numbers from 1 to "new", since we might + ** the message numbers from 1 to one beyond last, since we might ** select an empty slot. If we add more space at the ** end, go ahead and add 10 additional slots. */ @@ -46,7 +46,7 @@ m_draft(char *which) /* ** The draft message name to return is defined by `which'. - ** Usually it is "cur" (for the current draft) or "new" + ** Usually it is seq_cur (for the current draft) or seq_beyond ** (to start a new draft). */ if (!m_convert(mp, which)) diff --git a/sbr/seq_add.c b/sbr/seq_add.c index d8f019a..38bbdcf 100644 --- a/sbr/seq_add.c +++ b/sbr/seq_add.c @@ -30,10 +30,10 @@ seq_addsel(struct msgs *mp, char *cp, int public, int zero) return 0; /* - ** We keep mp->curmsg and "cur" sequence in sync. + ** We keep mp->curmsg and cur sequence in sync. ** See seq_list() and seq_init(). */ - if (!strcmp(current,cp)) + if (!strcmp(seq_cur, cp)) mp->curmsg = mp->hghsel; /* @@ -122,9 +122,9 @@ seq_addmsg(struct msgs *mp, char *cp, int msgnum, int public, int zero) return 0; /* - ** keep mp->curmsg and msgattrs["cur"] in sync - see seq_list() + ** keep mp->curmsg and msgattrs[] of seq_cur in sync - see seq_list() */ - if (!strcmp(current,cp)) + if (!strcmp(seq_cur, cp)) mp->curmsg = msgnum; /* diff --git a/sbr/seq_list.c b/sbr/seq_list.c index 1e2e606..a6cdbda 100644 --- a/sbr/seq_list.c +++ b/sbr/seq_list.c @@ -31,12 +31,12 @@ seq_list(struct msgs *mp, char *seqname) } /* - ** Special processing for "cur" sequence. We assume that the - ** "cur" sequence and mp->curmsg are in sync (see seq_add.c). + ** Special processing for the cur sequence. We assume that the + ** cur sequence and mp->curmsg are in sync (see seq_add.c). ** This is returned, even if message doesn't exist or the ** folder is empty. */ - if (!strcmp(current, seqname)) { + if (!strcmp(seq_cur, seqname)) { if (mp->curmsg) { sprintf(buffer, "%s", m_name(mp->curmsg)); return (buffer); diff --git a/sbr/seq_nameok.c b/sbr/seq_nameok.c index f9ed1b0..a61dd9c 100644 --- a/sbr/seq_nameok.c +++ b/sbr/seq_nameok.c @@ -1,5 +1,5 @@ /* -** seq_nameok.c -- check if a sequence name is ok +** seq_nameok.c -- check if a name is ok for a user-defined sequence ** ** This code is Copyright (c) 2002, by the authors of nmh. See the ** COPYRIGHT file in the root directory of the nmh distribution for @@ -9,6 +9,9 @@ #include +/* +** returns true if it is a valid name for a user-defined sequence +*/ int seq_nameok(unsigned char *s) { @@ -22,14 +25,12 @@ seq_nameok(unsigned char *s) /* ** Make sure sequence name doesn't clash with one ** of the `reserved' sequence names. + ** Note: Accept `cur' here! But why is it treated special? --meillo */ - if (!(strcmp(s, "new") && - strcmp(s, "all") && - strcmp(s, "first") && - strcmp(s, "last") && - strcmp(s, "prev") && - strcmp(s, "next"))) { - advise(NULL, "illegal sequence name: %s", s); + if (strcmp(s, seq_first)==0 || strcmp(s, seq_last)==0 || + strcmp(s, seq_prev)==0 || strcmp(s, seq_next)==0 || + strcmp(s, seq_all)==0 || strcmp(s, seq_beyond)==0) { + advise(NULL, "collision with reserved sequence name: `%s'", s); return 0; } @@ -38,18 +39,20 @@ seq_nameok(unsigned char *s) ** an alphabetic character ... */ if (!isalpha(*s)) { - advise(NULL, "illegal sequence name: %s", s); + advise(NULL, "sequence name must start with a letter: %s", s); return 0; } /* ** and can be followed by zero or more alphanumeric characters */ - for (pp = s + 1; *pp; pp++) + for (pp = s+1; *pp; pp++) { if (!isalnum(*pp)) { - advise(NULL, "illegal sequence name: %s", s); + advise(NULL, "sequence name must only contain " + "letters and digits: %s", s); return 0; } + } return 1; } diff --git a/sbr/seq_read.c b/sbr/seq_read.c index 26337c0..c1ac9fa 100644 --- a/sbr/seq_read.c +++ b/sbr/seq_read.c @@ -29,9 +29,9 @@ seq_read(struct msgs *mp) { /* ** Initialize the list of sequence names. Go ahead and - ** add the "cur" sequence to the list of sequences. + ** add the cur sequence to the list of sequences. */ - mp->msgattrs[0] = getcpy(current); + mp->msgattrs[0] = getcpy(seq_cur); mp->msgattrs[1] = NULL; make_all_public(mp); /* initially, make all public */ @@ -163,10 +163,10 @@ seq_init(struct msgs *mp, char *name, char *field) char *cp, **ap; /* - ** Check if this is "cur" sequence, + ** Check if this is the cur sequence, ** so we can do some special things. */ - is_current = !strcmp(current, name); + is_current = !strcmp(seq_cur, name); /* ** Search for this sequence name to see if we've seen @@ -210,7 +210,7 @@ seq_init(struct msgs *mp, char *name, char *field) k = cp ? m_atoi(cp) : j; /* - ** Keep mp->curmsg and "cur" sequence in synch. Unlike + ** Keep mp->curmsg and cur sequence in sync. Unlike ** other sequences, this message doesn't need to exist. ** Think about the series of command (rmm; next) to ** understand why this can be the case. But if it does diff --git a/sbr/seq_setcur.c b/sbr/seq_setcur.c index 0de8b97..f8668b0 100644 --- a/sbr/seq_setcur.c +++ b/sbr/seq_setcur.c @@ -1,5 +1,5 @@ /* -** seq_setcur.c -- set the current message ("cur" sequence) for a folder +** seq_setcur.c -- set the current message (cur sequence) for a folder ** ** This code is Copyright (c) 2002, by the authors of nmh. See the ** COPYRIGHT file in the root directory of the nmh distribution for @@ -12,9 +12,6 @@ void seq_setcur(struct msgs *mp, int msgnum) { - /* - ** Just call seq_addmsg() to update the - ** "cur" sequence. - */ - seq_addmsg(mp, current, msgnum, -1, 1); + /* Just call seq_addmsg() to update the cur sequence. */ + seq_addmsg(mp, seq_cur, msgnum, -1, 1); } diff --git a/uip/anno.c b/uip/anno.c index 5de385f..7de8600 100644 --- a/uip/anno.c +++ b/uip/anno.c @@ -212,7 +212,7 @@ main(int argc, char **argv) #endif /* UCI */ if (!msgs.size) - app_msgarg(&msgs, "cur"); + app_msgarg(&msgs, seq_cur); if (!folder) folder = getcurfol(); maildir = toabsdir(folder); diff --git a/uip/burst.c b/uip/burst.c index 66831c1..4c50485 100644 --- a/uip/burst.c +++ b/uip/burst.c @@ -114,7 +114,7 @@ main(int argc, char **argv) } if (!msgp) - msgs[msgp++] = "cur"; + msgs[msgp++] = seq_cur; if (!folder) folder = getcurfol(); maildir = toabsdir(folder); diff --git a/uip/comp.c b/uip/comp.c index 5b9a9f1..7eee3f7 100644 --- a/uip/comp.c +++ b/uip/comp.c @@ -143,7 +143,7 @@ main(int argc, char **argv) ** Take a message as the "form" for the new message. */ if (!msg) - msg = "cur"; + msg = seq_cur; if (!folder) folder = getcurfol(); maildir = toabsdir(folder); @@ -174,7 +174,8 @@ main(int argc, char **argv) in = open_form(&form, components); try_it_again: - strncpy(drft, m_draft(use ? (msg?msg:"cur") : "new"), sizeof(drft)); + strncpy(drft, m_draft(use ? (msg?msg:seq_cur) : seq_beyond), + sizeof(drft)); /* ** Check if we have an existing draft diff --git a/uip/dist.c b/uip/dist.c index 9ecfea1..5739376 100644 --- a/uip/dist.c +++ b/uip/dist.c @@ -147,7 +147,7 @@ main(int argc, char **argv) in = open_form(&form, distcomps); - strncpy(drft, m_draft("new"), sizeof(drft)); + strncpy(drft, m_draft(seq_beyond), sizeof(drft)); if ((out = creat(drft, m_gmprot())) == NOTOK) adios(drft, "unable to create"); @@ -166,7 +166,7 @@ main(int argc, char **argv) ** Dist a message */ if (!msg) - msg = "cur"; + msg = seq_cur; if (!folder) folder = getcurfol(); maildir = toabsdir(folder); diff --git a/uip/flist.c b/uip/flist.c index 31d01c1..847bb36 100644 --- a/uip/flist.c +++ b/uip/flist.c @@ -683,7 +683,7 @@ do_readonly_folders(void) char atrcur[BUFSIZ]; register struct node *np; - snprintf(atrcur, sizeof(atrcur), "atr-%s-", current); + snprintf(atrcur, sizeof(atrcur), "atr-%s-", seq_cur); atrlen = strlen(atrcur); for (np = m_defs; np; np = np->n_next) diff --git a/uip/folder.c b/uip/folder.c index 7f829f0..224bb03 100644 --- a/uip/folder.c +++ b/uip/folder.c @@ -652,7 +652,7 @@ readonly_folders(void) char atrcur[BUFSIZ]; register struct node *np; - snprintf(atrcur, sizeof(atrcur), "atr-%s-", current); + snprintf(atrcur, sizeof(atrcur), "atr-%s-", seq_cur); atrlen = strlen(atrcur); for (np = m_defs; np; np = np->n_next) diff --git a/uip/forw.c b/uip/forw.c index d51c57c..8dc26b7 100644 --- a/uip/forw.c +++ b/uip/forw.c @@ -257,9 +257,9 @@ main(int argc, char **argv) #ifdef MHE strncpy(drft, buildsw ? toabsdir("draft") - : m_draft("new"), sizeof(drft)); + : m_draft(seq_beyond), sizeof(drft)); #else - strncpy(drft, m_draft("new"), sizeof(drft)); + strncpy(drft, m_draft(seq_beyond), sizeof(drft)); #endif /* MHE */ if (file) { @@ -272,7 +272,7 @@ main(int argc, char **argv) ** Forwarding a message. */ if (!msgp) - msgs[msgp++] = "cur"; + msgs[msgp++] = seq_cur; if (!folder) folder = getcurfol(); maildir = toabsdir(folder); diff --git a/uip/mark.c b/uip/mark.c index 2914a44..79763ff 100644 --- a/uip/mark.c +++ b/uip/mark.c @@ -152,7 +152,7 @@ main(int argc, char **argv) } if (!msgs.size) - app_msgarg(&msgs, listsw ? "all" :"cur"); + app_msgarg(&msgs, listsw ? seq_all : seq_cur); if (!folder) folder = getcurfol(); maildir = toabsdir(folder); diff --git a/uip/mhbuildsbr.c b/uip/mhbuildsbr.c index 05f1b35..ab8d99c 100644 --- a/uip/mhbuildsbr.c +++ b/uip/mhbuildsbr.c @@ -703,7 +703,7 @@ use_forw: ap = brkstring(ci->ci_magic, " ", "\n"); copyip(ap, arguments, MAXARGS); } else { - arguments[0] = "cur"; + arguments[0] = seq_cur; arguments[1] = NULL; } folder = NULL; diff --git a/uip/mhlist.c b/uip/mhlist.c index c12a6b9..12480cf 100644 --- a/uip/mhlist.c +++ b/uip/mhlist.c @@ -287,7 +287,7 @@ do_cache: ** message(s) are coming from a folder */ if (!msgs.size) - app_msgarg(&msgs, "cur"); + app_msgarg(&msgs, seq_cur); if (!folder) folder = getcurfol(); maildir = toabsdir(folder); diff --git a/uip/mhpath.c b/uip/mhpath.c index 73d5e13..e1cf0ff 100644 --- a/uip/mhpath.c +++ b/uip/mhpath.c @@ -87,7 +87,7 @@ main(int argc, char **argv) /* ** We need to make sure there is message status space - ** for all the message numbers from 1 to "new" since + ** for all the message numbers from 1 to one beyond last since ** mhpath can select empty slots. If we are adding ** space at the end, we go ahead and add 10 slots. */ diff --git a/uip/mhshow.c b/uip/mhshow.c index a090e2e..5d5ac3e 100644 --- a/uip/mhshow.c +++ b/uip/mhshow.c @@ -358,7 +358,7 @@ do_cache: ** message(s) are coming from a folder */ if (!msgs.size) - app_msgarg(&msgs, "cur"); + app_msgarg(&msgs, seq_cur); if (!folder) folder = getcurfol(); maildir = toabsdir(folder); diff --git a/uip/mhstore.c b/uip/mhstore.c index 8ce7d62..2167a3f 100644 --- a/uip/mhstore.c +++ b/uip/mhstore.c @@ -301,7 +301,7 @@ do_cache: ** message(s) are coming from a folder */ if (!msgs.size) - app_msgarg(&msgs, "cur"); + app_msgarg(&msgs, seq_cur); if (!folder) folder = getcurfol(); maildir = toabsdir(folder); diff --git a/uip/mhtest.c b/uip/mhtest.c index 1f6846b..0cfce9f 100644 --- a/uip/mhtest.c +++ b/uip/mhtest.c @@ -279,7 +279,7 @@ do_cache: ** message(s) are coming from a folder */ if (!msgs.size) - app_msgarg(&msgs, "cur"); + app_msgarg(&msgs, seq_cur); if (!folder) folder = getcurfol(); maildir = toabsdir(folder); diff --git a/uip/packf.c b/uip/packf.c index a7b35ba..faf199c 100644 --- a/uip/packf.c +++ b/uip/packf.c @@ -123,7 +123,7 @@ main(int argc, char **argv) /* default is to pack whole folder */ if (!msgs.size) - app_msgarg(&msgs, "all"); + app_msgarg(&msgs, seq_all); if (!folder) folder = getcurfol(); diff --git a/uip/pick.c b/uip/pick.c index e8720df..e4d1370 100644 --- a/uip/pick.c +++ b/uip/pick.c @@ -193,7 +193,7 @@ main(int argc, char **argv) ** then search the whole folder. */ if (!msgs.size) - app_msgarg(&msgs, "all"); + app_msgarg(&msgs, seq_all); if (!folder) folder = getcurfol(); diff --git a/uip/refile.c b/uip/refile.c index b85186a..e699a14 100644 --- a/uip/refile.c +++ b/uip/refile.c @@ -184,7 +184,7 @@ main(int argc, char **argv) } if (!msgs.size) - app_msgarg(&msgs, "cur"); + app_msgarg(&msgs, seq_cur); if (!folder) folder = getcurfol(); strncpy(maildir, toabsdir(folder), sizeof(maildir)); diff --git a/uip/repl.c b/uip/repl.c index 95b4f69..3b49004 100644 --- a/uip/repl.c +++ b/uip/repl.c @@ -300,9 +300,9 @@ main(int argc, char **argv) #ifdef MHE strncpy(drft, buildsw ? toabsdir("reply") - : m_draft("new"), sizeof(drft)); + : m_draft(seq_beyond), sizeof(drft)); #else - strncpy(drft, m_draft("new"), sizeof(drft)); + strncpy(drft, m_draft(seq_beyond), sizeof(drft)); #endif /* MHE */ if (file) { @@ -315,7 +315,7 @@ main(int argc, char **argv) ** We are replying to a message. */ if (!msg) - msg = "cur"; + msg = seq_cur; if (!folder) folder = getcurfol(); maildir = toabsdir(folder); diff --git a/uip/rmf.c b/uip/rmf.c index f214f59..923f23a 100644 --- a/uip/rmf.c +++ b/uip/rmf.c @@ -139,8 +139,8 @@ rmf(char *folder) break; /* fall otherwise */ case NOTOK: - snprintf(cur, sizeof(cur), "atr-%s-%s", - current, toabsdir(folder)); + snprintf(cur, sizeof(cur), "atr-%s-%s", seq_cur, + toabsdir(folder)); if (!context_del(cur)) { printf("[+%s de-referenced]\n", folder); return OK; diff --git a/uip/rmm.c b/uip/rmm.c index c1b1608..35983bd 100644 --- a/uip/rmm.c +++ b/uip/rmm.c @@ -79,7 +79,7 @@ main(int argc, char **argv) } if (!msgs.size) - app_msgarg(&msgs, "cur"); + app_msgarg(&msgs, seq_cur); if (!folder) folder = getcurfol(); maildir = toabsdir(folder); diff --git a/uip/scan.c b/uip/scan.c index ea05cd2..478e4a6 100644 --- a/uip/scan.c +++ b/uip/scan.c @@ -204,7 +204,7 @@ main(int argc, char **argv) */ if (!msgs.size) - app_msgarg(&msgs, "all"); + app_msgarg(&msgs, seq_all); if (!folder) folder = getcurfol(); maildir = toabsdir(folder); diff --git a/uip/send.c b/uip/send.c index 2847add..eb67824 100644 --- a/uip/send.c +++ b/uip/send.c @@ -258,7 +258,7 @@ main(int argc, char **argv) } if (!msgp) - msgs[msgp++] = "cur"; + msgs[msgp++] = seq_cur; maildir = toabsdir(draftfolder); if (chdir(maildir) == NOTOK) diff --git a/uip/show.c b/uip/show.c index f279cde..671a441 100644 --- a/uip/show.c +++ b/uip/show.c @@ -196,13 +196,13 @@ usage: if (!msgp) { switch (mode) { case NEXT: - msgs[msgp++] = "next"; + msgs[msgp++] = seq_next; break; case PREV: - msgs[msgp++] = "prev"; + msgs[msgp++] = seq_prev; break; default: - msgs[msgp++] = "cur"; + msgs[msgp++] = seq_cur; break; } } diff --git a/uip/sortm.c b/uip/sortm.c index 59247c2..125991c 100644 --- a/uip/sortm.c +++ b/uip/sortm.c @@ -165,7 +165,7 @@ main(int argc, char **argv) } if (!msgs.size) - app_msgarg(&msgs, "all"); + app_msgarg(&msgs, seq_all); if (!datesw) datesw = "date"; if (!folder) diff --git a/uip/whatnowsbr.c b/uip/whatnowsbr.c index ed5647e..0699fce 100644 --- a/uip/whatnowsbr.c +++ b/uip/whatnowsbr.c @@ -203,7 +203,7 @@ WhatNow(int argc, char **argv) } if ((drft == NULL && (drft = getenv("mhdraft")) == NULL) || *drft == 0) - drft = getcpy(m_draft("cur")); + drft = getcpy(m_draft(seq_cur)); msgnam = (cp = getenv("mhaltmsg")) && *cp ? getcpy(cp) : NULL;