From 4b37b03aded863e1db637fac990f45f758fb9b74 Mon Sep 17 00:00:00 2001 From: "Steffen \"Daode\" Nurpmeso" Date: Tue, 14 Jan 2014 14:14:05 +0100 Subject: [PATCH] command(), evaluate(): s-it-mode, tweaks, obsolete *autoinc* --- extern.h | 16 +- imap.c | 4 +- lex.c | 648 ++++++++++++++++++++++++++++++--------------------------------- nail.1 | 7 +- 4 files changed, 322 insertions(+), 353 deletions(-) diff --git a/extern.h b/extern.h index 3c4add8a..72f516c7 100644 --- a/extern.h +++ b/extern.h @@ -90,7 +90,7 @@ FL int c_define(void *v); FL int c_undef(void *v); FL int c_call(void *v); -FL int callhook(char const *name, int newmail); +FL int callhook(char const *name, int nmail); /* List all macros */ FL int c_defines(void *v); @@ -609,7 +609,7 @@ FL char const * imap_fileof(char const *xcp); FL enum okay imap_noop(void); FL enum okay imap_select(struct mailbox *mp, off_t *size, int *count, const char *mbx); -FL int imap_setfile(const char *xserver, int newmail, int isedit); +FL int imap_setfile(const char *xserver, int nmail, int isedit); FL enum okay imap_header(struct message *m); FL enum okay imap_body(struct message *m); FL void imap_getheaders(int bot, int top); @@ -617,7 +617,7 @@ FL void imap_quit(void); FL enum okay imap_undelete(struct message *m, int n); FL enum okay imap_unread(struct message *m, int n); FL int imap_imap(void *vp); -FL int imap_newmail(int autoinc); +FL int imap_newmail(int nmail); FL enum okay imap_append(const char *xserver, FILE *fp); FL void imap_folders(const char *name, int strip); FL enum okay imap_copy(struct message *m, int n, const char *name); @@ -649,8 +649,10 @@ FL char * imap_unquotestr(const char *s); FL enum okay imap_search(const char *spec, int f); /* lex.c */ -FL int setfile(char const *name, int newmail); +FL int setfile(char const *name, int nmail); FL int newmailinfo(int omsgCount); + +/* Interpret user commands. If standard input is not a tty, print no prompt */ FL void commands(void); /* Evaluate a single command. @@ -665,7 +667,7 @@ FL void setmsize(int sz); FL void onintr(int s); FL void announce(int printheaders); FL int newfileinfo(void); -FL int getmdot(int newmail); +FL int getmdot(int nmail); FL void initbox(const char *name); /* Print the docstring of `comm', which may be an abbreviation. @@ -690,7 +692,7 @@ FL void * zalloc(FILE *fp); #endif /* HAVE_IMAP */ /* maildir.c */ -FL int maildir_setfile(const char *name, int newmail, int isedit); +FL int maildir_setfile(const char *name, int nmail, int isedit); FL void maildir_quit(void); FL enum okay maildir_append(const char *name, FILE *fp); FL enum okay maildir_remove(const char *name); @@ -866,7 +868,7 @@ FL enum okay smime_certsave(struct message *m, int n, FILE *op); /* pop3.c */ #ifdef HAVE_POP3 FL enum okay pop3_noop(void); -FL int pop3_setfile(const char *server, int newmail, int isedit); +FL int pop3_setfile(const char *server, int nmail, int isedit); FL enum okay pop3_header(struct message *m); FL enum okay pop3_body(struct message *m); FL void pop3_quit(void); diff --git a/imap.c b/imap.c index bd52d1f9..4a5bec8c 100644 --- a/imap.c +++ b/imap.c @@ -2063,9 +2063,9 @@ out: safe_signal(SIGINT, saveint); } FL int -imap_newmail(int autoinc) +imap_newmail(int nmail) { - if (autoinc && had_exists < 0 && had_expunge < 0) { + if (nmail && had_exists < 0 && had_expunge < 0) { imaplock = 1; imap_noop(); imaplock = 0; diff --git a/lex.c b/lex.c index 237ed5ea..29c20960 100644 --- a/lex.c +++ b/lex.c @@ -608,141 +608,117 @@ newmailinfo(int omsgCount) return mdot; } -/* - * Interpret user commands one by one. If standard input is not a tty, - * print no prompt. - */ FL void commands(void) { - int eofloop = 0, n; - char *linebuf = NULL, *av, *nv; - size_t linesize = 0; -#ifdef HAVE_IMAP - int x; -#endif + struct eval_ctx ev = {{NULL, 0}, FAL0}; + int n; + + if (!sourcing) { + if (safe_signal(SIGINT, SIG_IGN) != SIG_IGN) + safe_signal(SIGINT, onintr); + if (safe_signal(SIGHUP, SIG_IGN) != SIG_IGN) + safe_signal(SIGHUP, hangup); + /* TODO We do a lot of redundant signal handling, especially + * TODO with the command line editor(s); try to merge this */ + safe_signal(SIGTSTP, stop); + safe_signal(SIGTTOU, stop); + safe_signal(SIGTTIN, stop); + } + _oldpipe = safe_signal(SIGPIPE, SIG_IGN); + safe_signal(SIGPIPE, _oldpipe); - if (!sourcing) { - if (safe_signal(SIGINT, SIG_IGN) != SIG_IGN) - safe_signal(SIGINT, onintr); - if (safe_signal(SIGHUP, SIG_IGN) != SIG_IGN) - safe_signal(SIGHUP, hangup); - /* TODO We do a lot of redundant signal handling, especially - * TODO with the command line editor(s); try to merge this */ - safe_signal(SIGTSTP, stop); - safe_signal(SIGTTOU, stop); - safe_signal(SIGTTIN, stop); - } - _oldpipe = safe_signal(SIGPIPE, SIG_IGN); - safe_signal(SIGPIPE, _oldpipe); - setexit(); - - for (;;) { - interrupts = 0; - handlerstacktop = NULL; - /* - * Print the prompt, if needed. Clear out - * string space, and flush the output. - */ - if (!sourcing && (options & OPT_INTERACTIVE)) { - if ((av = ok_vlook(autoinc)) != NULL) - av = savestr(av); - if ((nv = ok_vlook(newmail)) != NULL) - nv = savestr(nv); - if ((options & OPT_TTYIN) && - (av != NULL || nv != NULL || mb.mb_type == MB_IMAP)) { - struct stat st; - - n = (av && strcmp(av, "noimap") && strcmp(av, "nopoll")) | - (nv && strcmp(nv, "noimap") && strcmp(nv, "nopoll")); -#ifdef HAVE_IMAP - x = !(av || nv); -#endif - if ((mb.mb_type == MB_FILE && - stat(mailname, &st) == 0 && - st.st_size > mailsize) || + setexit(); + for (;;) { + interrupts = 0; + handlerstacktop = NULL; + + if (!sourcing && (options & OPT_INTERACTIVE)) { + char *cp; + + if ((cp = ok_vlook(newmail)) == NULL) + cp = ok_vlook(autoinc); /* TODO legacy */ + if ((options & OPT_TTYIN) && (cp != NULL || mb.mb_type == MB_IMAP)) { + struct stat st; + + n = (cp != NULL && strcmp(cp, "noimap") && strcmp(cp, "nopoll")); + if ((mb.mb_type == MB_FILE && stat(mailname, &st) == 0 && + st.st_size > mailsize) || #ifdef HAVE_IMAP - (mb.mb_type == MB_IMAP && - imap_newmail(n) > x) || + (mb.mb_type == MB_IMAP && imap_newmail(n) > (cp == NULL)) || #endif - (mb.mb_type == MB_MAILDIR && - n != 0)) { - int odot = dot - &message[0]; - bool_t odid = did_print_dot; - - setfile(mailname, 1); - if (mb.mb_type != MB_IMAP) { - dot = &message[odot]; - did_print_dot = odid; - } - } - } - _reset_on_stop = 1; - exit_status = 0; - } + (mb.mb_type == MB_MAILDIR && n != 0)) { + size_t odot = PTR2SIZE(dot - message); + bool_t odid = did_print_dot; + + setfile(mailname, 1); + if (mb.mb_type != MB_IMAP) { + dot = message + odot; + did_print_dot = odid; + } + } + } + _reset_on_stop = 1; + exit_status = 0; + } #ifdef HAVE_COLOUR colour_table = NULL; /* XXX intermediate hack */ #endif - sreset(sourcing); - if (!sourcing) { - /* TODO Note: this buffer may contain a password - * TODO We should redefine the code flow which has - * TODO to do that */ - if ((nv = termios_state.ts_linebuf) != NULL) { - termios_state.ts_linebuf = NULL; - termios_state.ts_linesize = 0; - free(nv); /* TODO pool give-back */ - } - /* TODO Due to expand-on-tab of our line editor the - * TODO buffer may grow */ - if (linesize > LINESIZE * 3) { - free(linebuf); /* TODO pool! but what? */ - linebuf = NULL; - linesize = 0; - } - } + sreset(sourcing); + if (!sourcing) { + char *cp; + + /* TODO Note: this buffer may contain a password. We should redefine + * TODO the code flow which has to do that */ + if ((cp = termios_state.ts_linebuf) != NULL) { + termios_state.ts_linebuf = NULL; + termios_state.ts_linesize = 0; + free(cp); /* TODO pool give-back */ + } + /* TODO Due to expand-on-tab of NCL the buffer may grow */ + if (ev.ev_line.l > LINESIZE * 3) { + free(ev.ev_line.s); /* TODO pool! but what? */ + ev.ev_line.s = NULL; + ev.ev_line.l = 0; + } + } - /* - * Read a line of commands from the current input - * and handle end of file specially. - */ - n = readline_input(LNED_LF_ESC | LNED_HIST_ADD, NULL, - &linebuf, &linesize, NULL); - _reset_on_stop = 0; - if (n < 0) { - /* eof */ - if (loading) - break; - if (sourcing) { - unstack(); - continue; - } - if ((options & OPT_INTERACTIVE) && - ok_blook(ignoreeof) && ++eofloop < 25) { - printf(tr(89, "Use `quit' to quit.\n")); - continue; - } - break; - } + /* Read a line of commands and handle end of file specially */ + n = readline_input(LNED_LF_ESC | LNED_HIST_ADD, NULL, + &ev.ev_line.s, &ev.ev_line.l, NULL); + _reset_on_stop = 0; + if (n < 0) { + /* EOF */ + if (loading) + break; + if (sourcing) { + unstack(); + continue; + } + if ((options & OPT_INTERACTIVE) && ok_blook(ignoreeof)) { + printf(tr(89, "Use `quit' to quit.\n")); + continue; + } + break; + } - eofloop = 0; - inhook = 0; - if (execute(linebuf, 0, n)) - break; - if (exit_status != EXIT_OK && (options & OPT_BATCH_FLAG) && - ok_blook(batch_exit_on_error)) - break; - } + inhook = 0; + if (evaluate(&ev)) + break; + if (exit_status != EXIT_OK && (options & OPT_BATCH_FLAG) && + ok_blook(batch_exit_on_error)) + break; + } - if (linebuf != NULL) - free(linebuf); - if (sourcing) - sreset(FAL0); + if (ev.ev_line.s != NULL) + free(ev.ev_line.s); + if (sourcing) + sreset(FAL0); } FL int -execute(char *linebuf, int contxt, size_t linesize) +execute(char *linebuf, int contxt, size_t linesize) /* XXX LEGACY */ { struct eval_ctx ev; #ifdef HAVE_COLOUR @@ -774,257 +750,251 @@ execute(char *linebuf, int contxt, size_t linesize) FL int evaluate(struct eval_ctx *evp) { - char _wordbuf[2], *arglist[MAXARGC], *cp, *word; - struct cmd_ghost *cg = NULL; - struct cmd const *com = NULL; - int muvec[2], c, e = 1; + struct str line; + char _wordbuf[2], *arglist[MAXARGC], *cp, *word; + struct cmd_ghost *cg = NULL; + struct cmd const *com = NULL; + int muvec[2], c, e = 1; + + line = evp->ev_line; /* XXX don't change original */ - /* Command ghosts that refer to shell commands or macro expansion restart */ + /* Command ghosts that refer to shell commands or macro expansion restart */ jrestart: - /* Strip the white space away from the beginning of the command */ - for (cp = evp->ev_line.s; whitechar(*cp); ++cp) - ; - evp->ev_line.l -= PTR2SIZE(cp - evp->ev_line.s); + /* Strip the white space away from the beginning of the command */ + for (cp = line.s; whitechar(*cp); ++cp) + ; + line.l -= PTR2SIZE(cp - line.s); - /* Ignore comments */ - if (*cp == '#') - goto jleave0; + /* Ignore comments */ + if (*cp == '#') + goto jleave0; - /* Handle ! differently to get the correct lexical conventions */ - if (*cp == '!') { - if (sourcing) { - fprintf(stderr, tr(90, "Can't `!' while sourcing\n")); - goto jleave; - } - shell(++cp); - goto jleave0; - } + /* Handle ! differently to get the correct lexical conventions */ + if (*cp == '!') { + if (sourcing) { + fprintf(stderr, tr(90, "Can't `!' while sourcing\n")); + goto jleave; + } + shell(++cp); + goto jleave0; + } - /* Isolate the actual command; since it may not necessarily be - * separated from the arguments (as in `p1') we need to duplicate it to - * be able to create a NUL terminated version. - * We must be aware of several special one letter commands here */ - arglist[0] = cp; - switch (*cp) { - case '|': - case '~': - case '?': - ++cp; - /* FALLTHRU */ - case '\0': - break; - default: - cp = _lex_isolate(cp); - break; - } - c = (int)PTR2SIZE(cp - arglist[0]); - evp->ev_line.l -= c; - word = (c < (int)sizeof _wordbuf) ? _wordbuf : salloc(c + 1); - memcpy(word, arglist[0], c); - word[c] = '\0'; - - /* Look up the command; if not found, bitch. - * Normally, a blank command would map to the first command in the - * table; while sourcing, however, we ignore blank lines to eliminate - * confusion; act just the same for ghosts */ + /* Isolate the actual command; since it may not necessarily be + * separated from the arguments (as in `p1') we need to duplicate it to + * be able to create a NUL terminated version. + * We must be aware of several special one letter commands here */ + arglist[0] = cp; + switch (*cp) { + case '|': + case '~': + case '?': + ++cp; + /* FALLTHRU */ + case '\0': + break; + default: + cp = _lex_isolate(cp); + break; + } + c = (int)PTR2SIZE(cp - arglist[0]); + line.l -= c; + word = (c < (int)sizeof _wordbuf) ? _wordbuf : salloc(c + 1); + memcpy(word, arglist[0], c); + word[c] = '\0'; + + /* Look up the command; if not found, bitch. + * Normally, a blank command would map to the first command in the + * table; while sourcing, however, we ignore blank lines to eliminate + * confusion; act just the same for ghosts */ if (*word == '\0') { - if (sourcing || cg != NULL) - goto jleave0; + if (sourcing || cg != NULL) + goto jleave0; com = _cmd_tab + 0; goto jexec; } - /* If this is the first evaluation, check command ghosts */ - if (cg == NULL) { + /* If this is the first evaluation, check command ghosts */ + if (cg == NULL) { /* TODO relink list head, so it's sorted on usage over time? * TODO in fact, there should be one hashmap over all commands and ghosts * TODO so that the lookup could be made much more efficient than it is * TODO now (two adjacent list searches! */ - for (cg = _cmd_ghosts; cg != NULL; cg = cg->next) - if (strcmp(word, cg->name) == 0) { - if (evp->ev_line.l > 0) { - size_t i = cg->cmd.l; - evp->ev_line.s = salloc(i + 1 + evp->ev_line.l +1); - memcpy(evp->ev_line.s, cg->cmd.s, i); - evp->ev_line.s[i++] = ' '; - memcpy(evp->ev_line.s + i, cp, evp->ev_line.l); - evp->ev_line.s[i += evp->ev_line.l] = '\0'; - evp->ev_line.l = i; - } else { - evp->ev_line.s = cg->cmd.s; - evp->ev_line.l = cg->cmd.l; - } - goto jrestart; - } - } + for (cg = _cmd_ghosts; cg != NULL; cg = cg->next) + if (strcmp(word, cg->name) == 0) { + if (line.l > 0) { + size_t i = cg->cmd.l; + line.s = salloc(i + 1 + line.l +1); + memcpy(line.s, cg->cmd.s, i); + line.s[i++] = ' '; + memcpy(line.s + i, cp, line.l); + line.s[i += line.l] = '\0'; + line.l = i; + } else { + line.s = cg->cmd.s; + line.l = cg->cmd.l; + } + goto jrestart; + } + } if ((com = _lex(word)) == NULL || com->func == &ccmdnotsupp) { - fprintf(stderr, tr(91, "Unknown command: `%s'\n"), word); - if (com != NULL) { - ccmdnotsupp(NULL); - com = NULL; - } - goto jleave; - } + fprintf(stderr, tr(91, "Unknown command: `%s'\n"), word); + if (com != NULL) { + ccmdnotsupp(NULL); + com = NULL; + } + goto jleave; + } - /* See if we should execute the command -- if a conditional we always - * execute it, otherwise, check the state of cond */ + /* See if we should execute the command -- if a conditional we always + * execute it, otherwise, check the state of cond */ jexec: - if (!(com->argtype & ARG_F)) { - switch (cond_state) { - case COND_RCV: - if (options & OPT_SENDMODE) - goto jleave0; - break; - case COND_SEND: - if (!(options & OPT_SENDMODE)) - goto jleave0; - break; - case COND_TERM: - if (!(options & OPT_TTYIN)) - goto jleave0; - break; - case COND_NOTERM: - if (options & OPT_TTYIN) - goto jleave0; - break; - case COND_ANY: - case COND_EXEC: - break; - case COND_NOEXEC: - goto jleave0; - } - } + if (!(com->argtype & ARG_F)) { + switch (cond_state) { + case COND_RCV: + if (options & OPT_SENDMODE) + goto jleave0; + break; + case COND_SEND: + if (!(options & OPT_SENDMODE)) + goto jleave0; + break; + case COND_TERM: + if (!(options & OPT_TTYIN)) + goto jleave0; + break; + case COND_NOTERM: + if (options & OPT_TTYIN) + goto jleave0; + break; + case COND_ANY: + case COND_EXEC: + break; + case COND_NOEXEC: + goto jleave0; + } + } - /* Process the arguments to the command, depending on the type he expects. - * Default to an error. - * If we are sourcing an interactive command, it's an error */ - if ((options & OPT_SENDMODE) && !(com->argtype & ARG_M)) { - fprintf(stderr, tr(92, - "May not execute `%s' while sending\n"), - com->name); - goto jleave; - } - if (sourcing && (com->argtype & ARG_I)) { - fprintf(stderr, tr(93, - "May not execute `%s' while sourcing\n"), - com->name); - goto jleave; - } - if (!(mb.mb_perm & MB_DELE) && (com->argtype & ARG_W)) { - fprintf(stderr, tr(94, "May not execute `%s' -- " - "message file is read only\n"), - com->name); - goto jleave; - } - if (evp->ev_is_recursive && (com->argtype & ARG_R)) { - fprintf(stderr, tr(95, - "Cannot recursively invoke `%s'\n"), com->name); - goto jleave; - } - if (mb.mb_type == MB_VOID && (com->argtype & ARG_A)) { - fprintf(stderr, tr(257, - "Cannot execute `%s' without active mailbox\n"), - com->name); - goto jleave; - } + /* Process the arguments to the command, depending on the type he expects. + * Default to an error. + * If we are sourcing an interactive command, it's an error */ + if ((options & OPT_SENDMODE) && !(com->argtype & ARG_M)) { + fprintf(stderr, tr(92, "May not execute `%s' while sending\n"), + com->name); + goto jleave; + } + if (sourcing && (com->argtype & ARG_I)) { + fprintf(stderr, tr(93, "May not execute `%s' while sourcing\n"), + com->name); + goto jleave; + } + if (!(mb.mb_perm & MB_DELE) && (com->argtype & ARG_W)) { + fprintf(stderr, tr(94, "May not execute `%s' -- " + "message file is read only\n"), com->name); + goto jleave; + } + if (evp->ev_is_recursive && (com->argtype & ARG_R)) { + fprintf(stderr, tr(95, "Cannot recursively invoke `%s'\n"), com->name); + goto jleave; + } + if (mb.mb_type == MB_VOID && (com->argtype & ARG_A)) { + fprintf(stderr, tr(257, "Cannot execute `%s' without active mailbox\n"), + com->name); + goto jleave; + } - switch (com->argtype & ARG_ARGMASK) { - case ARG_MSGLIST: - /* Message list defaulting to nearest forward legal message */ - if (_msgvec == 0) - goto je96; - if ((c = getmsglist(cp, _msgvec, com->msgflag)) < 0) - break; - if (c == 0) { - *_msgvec = first(com->msgflag, com->msgmask); - if (*_msgvec != 0) - _msgvec[1] = 0; - } - if (*_msgvec == 0) { - if (! inhook) - printf(tr(97, "No applicable messages\n")); - break; - } - e = (*com->func)(_msgvec); - break; + switch (com->argtype & ARG_ARGMASK) { + case ARG_MSGLIST: + /* Message list defaulting to nearest forward legal message */ + if (_msgvec == 0) + goto je96; + if ((c = getmsglist(cp, _msgvec, com->msgflag)) < 0) + break; + if (c == 0) { + *_msgvec = first(com->msgflag, com->msgmask); + if (*_msgvec != 0) + _msgvec[1] = 0; + } + if (*_msgvec == 0) { + if (! inhook) + printf(tr(97, "No applicable messages\n")); + break; + } + e = (*com->func)(_msgvec); + break; - case ARG_NDMLIST: - /* Message list with no defaults, but no error if none exist */ - if (_msgvec == 0) { + case ARG_NDMLIST: + /* Message list with no defaults, but no error if none exist */ + if (_msgvec == 0) { je96: - fprintf(stderr, tr(96, - "Illegal use of `message list'\n")); - break; - } - if ((c = getmsglist(cp, _msgvec, com->msgflag)) < 0) - break; - e = (*com->func)(_msgvec); - break; + fprintf(stderr, tr(96, "Illegal use of `message list'\n")); + break; + } + if ((c = getmsglist(cp, _msgvec, com->msgflag)) < 0) + break; + e = (*com->func)(_msgvec); + break; - case ARG_STRLIST: - /* Just the straight string, with leading blanks removed */ - while (whitechar(*cp)) - cp++; - e = (*com->func)(cp); - break; + case ARG_STRLIST: + /* Just the straight string, with leading blanks removed */ + while (whitechar(*cp)) + cp++; + e = (*com->func)(cp); + break; - case ARG_RAWLIST: - case ARG_ECHOLIST: - /* A vector of strings, in shell style */ - if ((c = getrawlist(cp, evp->ev_line.l, arglist, - sizeof arglist / sizeof *arglist, - ((com->argtype & ARG_ARGMASK) == ARG_ECHOLIST))) < 0) - break; - if (c < com->minargs) { - fprintf(stderr, tr(99, - "`%s' requires at least %d arg(s)\n"), - com->name, com->minargs); - break; - } - if (c > com->maxargs) { - fprintf(stderr, tr(100, - "`%s' takes no more than %d arg(s)\n"), - com->name, com->maxargs); - break; - } - e = (*com->func)(arglist); - break; + case ARG_RAWLIST: + case ARG_ECHOLIST: + /* A vector of strings, in shell style */ + if ((c = getrawlist(cp, line.l, arglist, NELEM(arglist), + ((com->argtype & ARG_ARGMASK) == ARG_ECHOLIST))) < 0) + break; + if (c < com->minargs) { + fprintf(stderr, tr(99, "`%s' requires at least %d arg(s)\n"), + com->name, com->minargs); + break; + } + if (c > com->maxargs) { + fprintf(stderr, tr(100, "`%s' takes no more than %d arg(s)\n"), + com->name, com->maxargs); + break; + } + e = (*com->func)(arglist); + break; - case ARG_NOLIST: - /* Just the constant zero, for exiting, eg. */ - e = (*com->func)(0); - break; + case ARG_NOLIST: + /* Just the constant zero, for exiting, eg. */ + e = (*com->func)(0); + break; - default: - panic(tr(101, "Unknown argument type")); - } + default: + panic(tr(101, "Unknown argument type")); + } jleave: - /* Exit the current source file on error */ - if ((exec_last_comm_error = (e != 0))) { - if (e < 0) - return 1; - if (loading) - return 1; - if (sourcing) - unstack(); - return 0; - } - if (com == NULL) - return 0; - if ((com->argtype & ARG_P) && ok_blook(autoprint)) - if (visible(dot)) { - muvec[0] = dot - &message[0] + 1; - muvec[1] = 0; - type(muvec); - } - if (!sourcing && !inhook && (com->argtype & ARG_T) == 0) - sawcom = TRU1; + /* Exit the current source file on error */ + if ((exec_last_comm_error = (e != 0))) { + if (e < 0) + return 1; + if (loading) + return 1; + if (sourcing) + unstack(); + return 0; + } + if (com == NULL) + return 0; + if ((com->argtype & ARG_P) && ok_blook(autoprint)) + if (visible(dot)) { + muvec[0] = (int)PTR2SIZE(dot - message + 1); + muvec[1] = 0; + type(muvec); + } + if (!sourcing && !inhook && (com->argtype & ARG_T) == 0) + sawcom = TRU1; jleave0: exec_last_comm_error = 0; - return 0; + return 0; } /* diff --git a/nail.1 b/nail.1 index 70e4ea02..1d4314c0 100644 --- a/nail.1 +++ b/nail.1 @@ -2779,9 +2779,6 @@ outgoing message will be sent automatically. .It Va autocc Specifies a list of recipients to which a carbon copy of each outgoing message will be sent automatically. -.It Va autoinc -Same as -.Va newmail . .It Va autosort Causes sorted mode (see the .Ic sort @@ -4503,8 +4500,8 @@ use of the command instead of .Ic quit will not cause it to be reset, and if the -.Va autoinc Ns / Ns Va newmail -variables are unset, messages that arrived during a session will not be +.Va newmail +variable is unset, messages that arrived during a session will not be in state `new' anymore when the folder is opened again. Also if commands queued in disconnected mode are committed, the IMAP server will delete the `new' flag for all messages in the -- 2.11.4.GIT