]> git.marmaro.de Git - mmh/commitdiff
Renamed all standard sequences (e.g. cur->c) and made them globally changeable
authormarkus schnalke <meillo@marmaro.de>
Wed, 4 Jan 2012 17:29:23 +0000 (18:29 +0100)
committermarkus schnalke <meillo@marmaro.de>
Wed, 4 Jan 2012 17:29:23 +0000 (18:29 +0100)
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.

35 files changed:
config/config.c
h/mh.h
sbr/folder_pack.c
sbr/m_convert.c
sbr/m_draft.c
sbr/seq_add.c
sbr/seq_list.c
sbr/seq_nameok.c
sbr/seq_read.c
sbr/seq_setcur.c
uip/anno.c
uip/burst.c
uip/comp.c
uip/dist.c
uip/flist.c
uip/folder.c
uip/forw.c
uip/mark.c
uip/mhbuildsbr.c
uip/mhlist.c
uip/mhpath.c
uip/mhshow.c
uip/mhstore.c
uip/mhtest.c
uip/packf.c
uip/pick.c
uip/refile.c
uip/repl.c
uip/rmf.c
uip/rmm.c
uip/scan.c
uip/send.c
uip/show.c
uip/sortm.c
uip/whatnowsbr.c

index 6a1e0b1d3b0e514b03dfbbce1ba677e887507840..294352aeec5ef1fcab08c462bf4596ff5f5244fb 100644 (file)
@@ -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 5d72178b4591b2abc448c129cbbea7f7894eb916..b8896d1afc5d4c065eaece397aeeaaca9c2ebc5e 100644 (file)
--- 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;
index cd588e4c9e349d41ff9aed2e37609a2d768216d0..c2b59116fcfacc2dc7f4130422b1d69713300a7f 100644 (file)
@@ -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;
index 3065941ab76d24088911559d990961b07158b0be..6e6acd7e8ce9bf27dd17381f7fc741c9d6ae4de3 100644 (file)
 #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++;
index 77ea394ae4856d9268776fb52e65b81d32d0b00a..8492dd914e0dd5a46271ea34cde377e6f9efadb6 100644 (file)
@@ -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))
index d8f019ab6f65e26653d7e136afeeb863b61f4ee8..38bbdcf69a2ccdd534c6a40a5ea60f4d75d40ab9 100644 (file)
@@ -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;
 
        /*
index 1e2e606a6b418a92c84c62dd767f50c6fbc10f85..a6cdbdaa677fbd2ba17fea9747d603d3cd8bdd2f 100644 (file)
@@ -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);
index f9ed1b0e4cbcde0bace709252e0df4632dad9ce0..a61dd9c0d771f4b0d03e1a32dd1cba64f0ebaf36 100644 (file)
@@ -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 <h/mh.h>
 
 
+/*
+** 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;
 }
index 26337c03729ed80190d22a30266ce0264c6dd655..c1ac9fa72ad593e54e19f74df16a633f3ec8622f 100644 (file)
@@ -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
index 0de8b9709a735c038116461754af292c43b436cd..f8668b0cfdc9e6de705051d5b49a2098afd8d46d 100644 (file)
@@ -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);
 }
index 5de385f02a8265b356b2c5f95904f07f99289d93..7de86005fb31c49aace0964c011c9f90361c44e7 100644 (file)
@@ -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);
index 66831c1b6ae0b758584cc0b0f9d929db31fa51b3..4c5048594895943998ddf0d12b98262c33d58934 100644 (file)
@@ -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);
index 5b9a9f14934bf0ece41c3eb991008cad6a253b9b..7eee3f7e9f8c19ac57b7588902e58b4b39a8dda1 100644 (file)
@@ -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
index 9ecfea17e0e5246c1a8658e7330204babae086ef..57393769386e0576ccdb912cad80f67c0b1febcb 100644 (file)
@@ -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);
index 31d01c1ac2dbb8f20487790a3f5172a426156d10..847bb3652d20d7dcd3ef9422e8a75af319ed1478 100644 (file)
@@ -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)
index 7f829f095538762b53a34669dbc487add44fdfe0..224bb03479a53681ac3e2517ca3e07b995be55e1 100644 (file)
@@ -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)
index d51c57c70312000ed8e42ddbb0baf8510aa24b10..8dc26b792f0df28df8862340b4ae9a10be8cfad6 100644 (file)
@@ -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);
index 2914a44f960adabf86ccc169fa2eb7b1c98ae8f7..79763ff232235ac3da672790fa43a0f19a621823 100644 (file)
@@ -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);
index 05f1b35cdea1332df983d782e0e27ac17ab709e9..ab8d99c1b1504140b2b6d022c0032d2f0da6d694 100644 (file)
@@ -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;
index c12a6b98c9569ccecc291a32df01e24a32011e59..12480cf745d43a73a978a962267b053269bb48fb 100644 (file)
@@ -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);
index 73d5e13352929df12b9d3aaf83bc24ff01548146..e1cf0ff927327988df3811f2cd909fe34b361eb9 100644 (file)
@@ -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.
        */
index a090e2e08d64a7ea40ddb4489c6bc69af5f5067a..5d5ac3e4a24b894349a2b4a4846068c7e0917523 100644 (file)
@@ -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);
index 8ce7d6200f71b15d764db23ff66cdc2ffae6168c..2167a3feb821713410e9ae9001dc03d4a8beda80 100644 (file)
@@ -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);
index 1f6846bc29f4e585b5a6979e6c8f4fe2285840d1..0cfce9f873f2a90f286c4c25b60be1e6fe373381 100644 (file)
@@ -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);
index a7b35ba145a85c949188f9afe6b0a0a0ad7ca439..faf199c01fe8628c38c5a8bacc38c57e56548d56 100644 (file)
@@ -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();
index e8720df50b20a56392d1ef8826dd381ee05ebe0c..e4d1370440d089a26b6f4b2810b551c749d85d02 100644 (file)
@@ -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();
index b85186a3b06d0d460c61e4e2c8a3f5d927fc8fd3..e699a1440c06563a03b76480167bdaeb08df1a8f 100644 (file)
@@ -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));
index 95b4f698929a493db3d642d9d0fe70a478193a14..3b490045e1f3967e1f26f49f965de1fac66d5ab3 100644 (file)
@@ -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);
index f214f59a8e12baa3ed46e178e267dede1a742587..923f23aed377c6887da6f151efe83719e86d45ba 100644 (file)
--- 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;
index c1b1608c2ea931d4b5aec8f0e132f843bc908dc7..35983bd67c3bfa63378498fc392f137bbdfaa49a 100644 (file)
--- 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);
index ea05cd2b930f31e445994952cd19b9f799536d38..478e4a6965bae6d0504ee61d4f8e2b35eab666ad 100644 (file)
@@ -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);
index 2847add268a5015b0da1b48349859804e54c2b65..eb678245a85ffa92995c3ed51d62c42ffd926a12 100644 (file)
@@ -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)
index f279cdedf675a1da8c49c04c893cafb1d1ad7116..671a4419eccd3d4a73fb7a69550bf730f61191d5 100644 (file)
@@ -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;
                }
        }
index 59247c2b360c5f2c62b3398c2f91dc134ff3fc17..125991cc112b1ce7dfd3c4ae2e81bdfedfaeba18 100644 (file)
@@ -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)
index ed5647efecc34ad55b5b3f491ae1c7a8c52c5bcb..0699fcee70abf22881d2c11b6b0299bc3097fbc2 100644 (file)
@@ -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;