--- orig-OPS Mon Jun 3 15:14:54 2002 +++ OPS Mon Jun 3 15:20:20 2002 @@ -67,10 +67,11 @@ OP_EDITOR_EOL "jump to the end of the line" OP_EDITOR_FORWARD_CHAR "move the cursor one character to the right" OP_EDITOR_FORWARD_WORD "move the cursor to the end of the word" OP_EDITOR_HISTORY_DOWN "scroll down through the history list" OP_EDITOR_HISTORY_UP "scroll up through the history list" +OP_EDITOR_KILL_BOL "delete chars from cursor to beginning of line" OP_EDITOR_KILL_EOL "delete chars from cursor to end of line" OP_EDITOR_KILL_EOW "delete chars from the cursor to the end of the word" OP_EDITOR_KILL_LINE "delete all chars on the line" OP_EDITOR_KILL_WORD "delete the word in front of the cursor" OP_EDITOR_QUOTE_CHAR "quote the next typed key" --- orig-OPS.PGP Tue Feb 13 07:01:57 2001 +++ OPS.PGP Mon Jun 3 15:14:54 2002 @@ -1,7 +1,9 @@ OP_COMPOSE_ATTACH_KEY "attach a PGP public key" OP_COMPOSE_PGP_MENU "show PGP options" +OP_COMPOSE_TOGGLE_SIGN "sign/don't sign current message" +OP_COMPOSE_TOGGLE_ENCRYPT "encrypt/don't encrypt current message" OP_EXTRACT_KEYS "extract PGP public keys" OP_FORGET_PASSPHRASE "wipe PGP passphrase from memory" OP_MAIL_KEY "mail a PGP public key" OP_VERIFY_KEY "verify a PGP public key" OP_VIEW_ID "view the key's user id" --- orig-browser.c Tue Mar 19 01:54:00 2002 +++ browser.c Mon Jun 3 16:48:32 2002 @@ -37,10 +37,11 @@ #include static struct mapping_t FolderHelp[] = { { N_("Exit"), OP_EXIT }, { N_("Chdir"), OP_CHANGE_DIRECTORY }, + { N_("Newdir"), OP_CHOOSE_DIRECTORY }, { N_("Mask"), OP_ENTER_MASK }, { N_("Help"), OP_HELP }, { NULL } }; @@ -175,11 +176,12 @@ #endif strfcpy (fn, folder->ff->name, sizeof(fn)); if (folder->ff->st != NULL) { strcat (fn, S_ISLNK (folder->ff->st->st_mode) ? "@" : /* __STRCAT_CHECKED__ */ - (S_ISDIR (folder->ff->st->st_mode) ? "/" : + (S_ISDIR (folder->ff->st->st_mode) ? + (fn[strlen(fn)-1]=='/'?"":"/") : ((folder->ff->st->st_mode & S_IXUSR) != 0 ? "*" : ""))); } mutt_format_s (dest, destlen, fmt, fn); break; @@ -532,11 +534,11 @@ char helpstr[SHORT_STRING]; char title[STRING]; struct browser_state state; MUTTMENU *menu; struct stat st; - int i, killPrefix = 0; + int i, killPrefix = 0, len; int multiple = (flags & M_SEL_MULTI) ? 1 : 0; int folder = (flags & M_SEL_FOLDER) ? 1 : 0; int buffy = (flags & M_SEL_BUFFY) ? 1 : 0; buffy = buffy && folder; @@ -640,10 +642,12 @@ FOREVER { switch (i = mutt_menuLoop (menu)) { + case OP_CHANGE_DIRECTORY: + /* Fall through to OP_GENERIC_SELECT_ENTRY */ case OP_GENERIC_SELECT_ENTRY: if (!state.entrylen) { mutt_error _("No files match the file mask"); @@ -668,15 +672,20 @@ else if (state.imap_browse) { strfcpy (buf, state.entry[menu->current].name, sizeof (buf)); } #endif - else - snprintf (buf, sizeof (buf), "%s/%s", LastDir, + else { + /* Pretend a trailing '/' in LastDir doesn't exist */ + len = mutt_strlen (LastDir); + if (len>1 && LastDir[len-1]=='/') + len--; + snprintf (buf, sizeof (buf), "%.*s/%s", len, LastDir, state.entry[menu->current].name); + } - if ((mx_get_magic (buf) <= 0) + if ((i == OP_CHANGE_DIRECTORY) || (mx_get_magic (buf) <= 0) #ifdef USE_IMAP || state.entry[menu->current].inferiors #endif ) { @@ -685,25 +694,21 @@ /* save the old directory */ strfcpy (OldLastDir, LastDir, sizeof (OldLastDir)); if (mutt_strcmp (state.entry[menu->current].name, "..") == 0) { - if (mutt_strcmp ("..", LastDir + mutt_strlen (LastDir) - 2) == 0) - strcat (LastDir, "/.."); /* __STRCAT_CHECKED__ */ - else - { - char *p = strrchr (LastDir + 1, '/'); - - if (p) - *p = 0; - else - { - if (LastDir[0] == '/') - LastDir[1] = 0; - else - strcat (LastDir, "/.."); /* __STRCAT_CHECKED__ */ - } + char *p; + len = mutt_strlen (LastDir); + if (len > 1 && LastDir[len-1] == '/') + LastDir[--len] = 0; + + p = strrchr (LastDir + 1, '/'); + if (p) + *++p = 0; + else { + LastDir[0] = '/'; + LastDir[1] = 0; } } else if (buffy) { strfcpy (LastDir, state.entry[menu->current].name, sizeof (LastDir)); @@ -732,11 +737,14 @@ } #endif else { char tmp[_POSIX_PATH_MAX]; - snprintf (tmp, sizeof (tmp), "%s/%s", LastDir, state.entry[menu->current].name); + len = mutt_strlen (LastDir); + if (len>1 && LastDir[len-1]=='/') + LastDir[--len] = 0; + snprintf (tmp, sizeof (tmp), "%s/%s/", LastDir, state.entry[menu->current].name); strfcpy (LastDir, tmp, sizeof (LastDir)); } destroy_state (&state); if (killPrefix) @@ -904,11 +912,11 @@ FREE (&mx.mbox); } break; #endif - case OP_CHANGE_DIRECTORY: + case OP_CHOOSE_DIRECTORY: strfcpy (buf, LastDir, sizeof (buf)); #ifdef USE_IMAP if (!state.imap_browse) #endif @@ -921,10 +929,34 @@ if (mutt_get_field (_("Chdir to: "), buf, sizeof (buf), M_FILE) == 0 && buf[0]) { buffy = 0; +#ifdef USE_IMAP + if (!state.imap_browse) +#endif + { + /* add '/' at the end of the directory name */ + len = mutt_strlen (buf); + if (sizeof (buf) > len+1 && buf[len-1] != '/') { + buf[len] = '/'; + buf[++len] = 0; + } + /* manually take care of trailing ".." */ + if (len>3 && 0 == mutt_strcmp (&buf[len-4], "/../")) { + char *p; + buf[len-4] = 0; + p = strrchr (buf, '/'); + if (p) + len = p - buf + 1; + else { + buf[0] = '/'; + len = 1; + } + buf[len] = 0; + } + } mutt_expand_path (buf, sizeof (buf)); #ifdef USE_IMAP if (mx_is_imap (buf)) { strfcpy (LastDir, buf, sizeof (LastDir)); --- orig-compose.c Thu Oct 11 13:08:31 2001 +++ compose.c Mon Jun 3 15:14:54 2002 @@ -1191,10 +1191,22 @@ case OP_COMPOSE_PGP_MENU: msg->pgp = pgp_send_menu (msg->pgp, &menu->redraw); break; + case OP_COMPOSE_TOGGLE_SIGN: + + msg->pgp ^= PGPSIGN; + redraw_pgp_lines (msg->pgp); + break; + + case OP_COMPOSE_TOGGLE_ENCRYPT: + + msg->pgp ^= PGPENCRYPT; + redraw_pgp_lines (msg->pgp); + break; + case OP_FORGET_PASSPHRASE: mutt_forget_passphrase (); break; --- orig-copy.c Wed Sep 26 03:33:09 2001 +++ copy.c Mon Jun 3 15:38:37 2002 @@ -28,11 +28,11 @@ #endif #include #include #include -#include /* needed for SEEK_SET under SunOS 4.1.4 */ +#include static int copy_delete_attach (BODY *b, FILE *fpin, FILE *fpout, char *date); /* Ok, the only reason for not merging this with mutt_copy_header() * below is to avoid creating a HEADER structure in message_handler(). @@ -483,11 +483,12 @@ if (fail) { mutt_error ("The length calculation was wrong by %ld bytes", fail); new_length += fail; - mutt_sleep (1); + if (ErrorDelay) + mutt_sleep (1000UL * ErrorDelay); } } #endif /* Update original message if we are sync'ing a mailfolder */ --- orig-enter.c Tue Oct 2 15:20:03 2001 +++ enter.c Mon Jun 3 15:46:40 2002 @@ -308,10 +308,21 @@ case OP_EDITOR_KILL_LINE: state->curpos = state->lastchar = 0; break; + case OP_EDITOR_KILL_BOL: + /* delete to begining of line */ + if (state->curpos != 0) + { + memmove (state->wbuf, state->wbuf + state->curpos, + (state->lastchar - state->curpos) * sizeof (wchar_t)); + state->lastchar -= state->curpos; + state->curpos = 0; + } + break; + case OP_EDITOR_KILL_EOL: state->lastchar = state->curpos; break; case OP_EDITOR_BACKWARD_CHAR: --- orig-functions.h Tue Sep 11 04:20:34 2001 +++ functions.h Mon Jun 3 15:56:09 2002 @@ -46,22 +46,22 @@ { "first-entry", OP_FIRST_ENTRY, "=" }, { "enter-command", OP_ENTER_COMMAND, ":" }, { "next-line", OP_NEXT_LINE, ">" }, { "previous-line", OP_PREV_LINE, "<" }, { "half-up", OP_HALF_UP, "[" }, - { "half-down", OP_HALF_DOWN, "]" }, + { "half-down", OP_HALF_DOWN, "]" }, { "help", OP_HELP, "?" }, { "tag-prefix", OP_TAG_PREFIX, ";" }, { "shell-escape", OP_SHELL_ESCAPE, "!" }, { "select-entry", OP_GENERIC_SELECT_ENTRY,M_ENTER_S }, { "search", OP_SEARCH, "/" }, { "search-reverse", OP_SEARCH_REVERSE, "\033/" }, { "search-opposite", OP_SEARCH_OPPOSITE, NULL }, { "jump", OP_JUMP, NULL }, - { "current-top", OP_CURRENT_TOP, NULL }, - { "current-middle", OP_CURRENT_MIDDLE, NULL }, - { "current-bottom", OP_CURRENT_BOTTOM, NULL }, + { "current-top", OP_CURRENT_TOP, NULL }, + { "current-middle", OP_CURRENT_MIDDLE, NULL }, + { "current-bottom", OP_CURRENT_BOTTOM, NULL }, { NULL, 0, NULL } }; struct binding_t OpMain[] = { { "create-alias", OP_CREATE_ALIAS, "a" }, @@ -86,11 +86,11 @@ { "fetch-mail", OP_MAIN_FETCH_MAIL, "G" }, #endif #ifdef USE_IMAP { "imap-fetch-mail", OP_MAIN_IMAP_FETCH, NULL }, #endif - { "display-toggle-weed", OP_DISPLAY_HEADERS, "h" }, + { "display-toggle-weed", OP_DISPLAY_HEADERS, "h" }, { "next-undeleted", OP_MAIN_NEXT_UNDELETED, "j" }, { "previous-undeleted", OP_MAIN_PREV_UNDELETED, "k" }, { "limit", OP_MAIN_LIMIT, "l" }, { "list-reply", OP_LIST_REPLY, "L" }, { "mail", OP_MAIL, "m" }, @@ -115,11 +115,11 @@ { "tag-pattern", OP_MAIN_TAG_PATTERN, "T" }, { "tag-subthread", OP_TAG_SUBTHREAD, NULL }, { "tag-thread", OP_TAG_THREAD, "\033t" }, { "untag-pattern", OP_MAIN_UNTAG_PATTERN, "\024" }, { "undelete-message", OP_UNDELETE, "u" }, - { "undelete-pattern", OP_MAIN_UNDELETE_PATTERN, "U"}, + { "undelete-pattern", OP_MAIN_UNDELETE_PATTERN, "U" }, { "undelete-subthread", OP_UNDELETE_SUBTHREAD, "\033u" }, { "undelete-thread", OP_UNDELETE_THREAD, "\025" }, { "view-attachments", OP_VIEW_ATTACHMENTS, "v" }, { "show-version", OP_VERSION, "V" }, { "set-flag", OP_MAIN_SET_FLAG, "w" }, @@ -131,23 +131,18 @@ { "next-new", OP_MAIN_NEXT_NEW, "\t" }, { "previous-new", OP_MAIN_PREV_NEW, "\033\t" }, { "next-unread", OP_MAIN_NEXT_UNREAD, NULL }, { "previous-unread", OP_MAIN_PREV_UNREAD, NULL }, { "parent-message", OP_MAIN_PARENT_MESSAGE, "P" }, - - #ifdef HAVE_PGP { "check-traditional-pgp", OP_CHECK_TRADITIONAL, "\033P" }, { "extract-keys", OP_EXTRACT_KEYS, "\013" }, { "forget-passphrase", OP_FORGET_PASSPHRASE, "\006" }, { "mail-key", OP_MAIL_KEY, "\033k" }, { "decrypt-copy", OP_DECRYPT_COPY, NULL }, { "decrypt-save", OP_DECRYPT_SAVE, NULL }, #endif - - - { NULL, 0, NULL } }; struct binding_t OpPager[] = { { "create-alias", OP_CREATE_ALIAS, "a" }, @@ -165,11 +160,11 @@ { "flag-message", OP_FLAG_MESSAGE, "F" }, { "group-reply", OP_GROUP_REPLY, "g" }, #ifdef USE_IMAP { "imap-fetch-mail", OP_MAIN_IMAP_FETCH, NULL }, #endif - { "display-toggle-weed", OP_DISPLAY_HEADERS, "h" }, + { "display-toggle-weed",OP_DISPLAY_HEADERS, "h" }, { "next-undeleted", OP_MAIN_NEXT_UNDELETED, "j" }, { "next-entry", OP_NEXT_ENTRY, "J" }, { "previous-undeleted",OP_MAIN_PREV_UNDELETED, "k" }, { "previous-entry", OP_PREV_ENTRY, "K" }, { "list-reply", OP_LIST_REPLY, "L" }, @@ -221,32 +216,24 @@ { "half-up", OP_HALF_UP, NULL }, { "half-down", OP_HALF_DOWN, NULL }, { "previous-line", OP_PREV_LINE, NULL }, { "bottom", OP_PAGER_BOTTOM, NULL }, { "parent-message", OP_MAIN_PARENT_MESSAGE, "P" }, - - - - #ifdef HAVE_PGP - { "check-traditional-pgp", OP_CHECK_TRADITIONAL, "\033P" }, + { "check-traditional-pgp",OP_CHECK_TRADITIONAL, "\033P" }, { "extract-keys", OP_EXTRACT_KEYS, "\013" }, { "forget-passphrase",OP_FORGET_PASSPHRASE, "\006" }, { "mail-key", OP_MAIL_KEY, "\033k" }, - { "decrypt-copy", OP_DECRYPT_COPY, NULL }, - { "decrypt-save", OP_DECRYPT_SAVE, NULL }, + { "decrypt-copy", OP_DECRYPT_COPY, NULL }, + { "decrypt-save", OP_DECRYPT_SAVE, NULL }, #endif - - - - { NULL, 0, NULL } }; struct binding_t OpAttach[] = { { "bounce-message", OP_BOUNCE_MESSAGE, "b" }, - { "display-toggle-weed", OP_DISPLAY_HEADERS, "h" }, + { "display-toggle-weed",OP_DISPLAY_HEADERS, "h" }, { "edit-type", OP_EDIT_TYPE, "\005" }, { "print-entry", OP_PRINT, "p" }, { "save-entry", OP_SAVE, "s" }, { "pipe-entry", OP_PIPE, "|" }, { "view-mailcap", OP_ATTACH_VIEW_MAILCAP, "m" }, @@ -258,20 +245,15 @@ { "view-text", OP_ATTACH_VIEW_TEXT, "T" }, { "view-attach", OP_VIEW_ATTACH, M_ENTER_S }, { "delete-entry", OP_DELETE, "d" }, { "undelete-entry", OP_UNDELETE, "u" }, { "collapse-parts", OP_ATTACH_COLLAPSE, "v" }, - - #ifdef HAVE_PGP - { "check-traditional-pgp", OP_CHECK_TRADITIONAL, "\033P" }, - { "extract-keys", OP_EXTRACT_KEYS, "\013" }, - { "forget-passphrase", OP_FORGET_PASSPHRASE, "\006" }, + { "check-traditional-pgp",OP_CHECK_TRADITIONAL, "\033P" }, + { "extract-keys", OP_EXTRACT_KEYS, "\013" }, + { "forget-passphrase",OP_FORGET_PASSPHRASE, "\006" }, #endif - - - { NULL, 0, NULL } }; struct binding_t OpCompose[] = { { "attach-file", OP_COMPOSE_ATTACH_FILE, "a" }, @@ -288,11 +270,11 @@ { "edit-encoding", OP_COMPOSE_EDIT_ENCODING, "\005" }, { "edit-from", OP_COMPOSE_EDIT_FROM, "\033f" }, { "edit-fcc", OP_COMPOSE_EDIT_FCC, "f" }, { "filter-entry", OP_FILTER, "F" }, { "get-attachment", OP_COMPOSE_GET_ATTACHMENT, "G" }, - { "display-toggle-weed", OP_DISPLAY_HEADERS, "h" }, + { "display-toggle-weed",OP_DISPLAY_HEADERS, "h" }, { "ispell", OP_COMPOSE_ISPELL, "i" }, { "print-entry", OP_PRINT, "l" }, { "edit-mime", OP_COMPOSE_EDIT_MIME, "m" }, { "new-mime", OP_COMPOSE_NEW_MIME, "n" }, { "postpone-message", OP_COMPOSE_POSTPONE_MESSAGE, "P" }, @@ -306,21 +288,20 @@ { "toggle-recode", OP_COMPOSE_TOGGLE_RECODE, NULL }, { "update-encoding", OP_COMPOSE_UPDATE_ENCODING, "U" }, { "view-attach", OP_VIEW_ATTACH, M_ENTER_S }, { "send-message", OP_COMPOSE_SEND_MESSAGE, "y" }, { "pipe-entry", OP_PIPE, "|" }, - #ifdef HAVE_PGP { "attach-key", OP_COMPOSE_ATTACH_KEY, "\033k" }, { "forget-passphrase",OP_FORGET_PASSPHRASE, "\006" }, { "pgp-menu", OP_COMPOSE_PGP_MENU, "p" }, + { "toggle-sign", OP_COMPOSE_TOGGLE_SIGN, "[" }, + { "toggle-encrypt", OP_COMPOSE_TOGGLE_ENCRYPT, "]" }, #endif - #ifdef MIXMASTER { "mix", OP_COMPOSE_MIX, "M" }, #endif - { NULL, 0, NULL } }; struct binding_t OpPost[] = { { "delete-entry", OP_DELETE, "d" }, @@ -331,17 +312,17 @@ struct binding_t OpAlias[] = { { "delete-entry", OP_DELETE, "d" }, { "undelete-entry", OP_UNDELETE, "u" }, { NULL, 0, NULL } }; - /* The file browser */ struct binding_t OpBrowser[] = { { "change-dir", OP_CHANGE_DIRECTORY, "c" }, { "display-filename", OP_BROWSER_TELL, "@" }, { "enter-mask", OP_ENTER_MASK, "m" }, + { "choose-dir", OP_CHOOSE_DIRECTORY, "C" }, { "sort", OP_SORT, "o" }, { "sort-reverse", OP_SORT_REVERSE, "O" }, { "select-new", OP_BROWSER_NEW_FILE, "N" }, { "check-new", OP_CHECK_NEW, NULL }, { "toggle-mailboxes", OP_TOGGLE_MAILBOXES, "\t" }, @@ -375,11 +356,12 @@ { "delete-char", OP_EDITOR_DELETE_CHAR, "\004" }, { "eol", OP_EDITOR_EOL, "\005" }, { "forward-char", OP_EDITOR_FORWARD_CHAR, "\006" }, { "forward-word", OP_EDITOR_FORWARD_WORD, "\033f"}, { "backspace", OP_EDITOR_BACKSPACE, "\010" }, - { "kill-eol", OP_EDITOR_KILL_EOL, "\013" }, + { "kill-bol", OP_EDITOR_KILL_BOL, "\013" }, + { "kill-eol", OP_EDITOR_KILL_EOL, NULL }, { "kill-eow", OP_EDITOR_KILL_EOW, "\033d"}, { "kill-line", OP_EDITOR_KILL_LINE, "\025" }, { "quote-char", OP_EDITOR_QUOTE_CHAR, "\026" }, { "kill-word", OP_EDITOR_KILL_WORD, "\027" }, { "complete", OP_EDITOR_COMPLETE, "\t" }, @@ -389,27 +371,24 @@ { "history-down", OP_EDITOR_HISTORY_DOWN, NULL }, { "transpose-chars", OP_EDITOR_TRANSPOSE_CHARS, NULL }, { NULL, 0, NULL } }; - - #ifdef HAVE_PGP struct binding_t OpPgp[] = { { "verify-key", OP_VERIFY_KEY, "c" }, { "view-name", OP_VIEW_ID, "%" }, - { NULL, 0, NULL } + { NULL, 0, NULL } }; #endif /* HAVE_PGP */ - #ifdef MIXMASTER struct binding_t OpMix[] = { - { "accept", OP_MIX_USE, M_ENTER_S }, - { "append", OP_MIX_APPEND, "a" }, - { "insert", OP_MIX_INSERT, "i" }, - { "delete", OP_MIX_DELETE, "d" }, - { "chain-prev", OP_MIX_CHAIN_PREV, "" }, - { "chain-next", OP_MIX_CHAIN_NEXT, "" }, - { NULL, 0, NULL } + { "accept", OP_MIX_USE, M_ENTER_S }, + { "append", OP_MIX_APPEND, "a" }, + { "insert", OP_MIX_INSERT, "i" }, + { "delete", OP_MIX_DELETE, "d" }, + { "chain-prev", OP_MIX_CHAIN_PREV, "" }, + { "chain-next", OP_MIX_CHAIN_NEXT, "" }, + { NULL, 0, NULL } }; #endif /* MIXMASTER */ --- orig-globals.h Thu Jan 3 12:57:19 2002 +++ globals.h Mon Jun 3 15:56:52 2002 @@ -139,10 +139,13 @@ #else extern unsigned char QuadOptions[]; #endif WHERE unsigned short Counter INITVAL (0); +WHERE unsigned short InfoDelay INITVAL (1000); +WHERE unsigned short WarnDelay INITVAL (2000); +WHERE unsigned short ErrorDelay INITVAL (5000); WHERE short ConnectTimeout; WHERE short HistSize; WHERE short PagerContext; WHERE short PagerIndexLines; --- orig-hdrline.c Mon Mar 25 03:28:58 2002 +++ hdrline.c Mon Jun 3 15:14:54 2002 @@ -363,11 +363,12 @@ len -= 2; } else break; /* not enough space */ } - cp++; + if(*cp) + cp++; } else { *p++ = *cp++; len--; --- orig-hook.c Fri Jun 29 03:06:14 2001 +++ hook.c Mon Jun 3 16:02:22 2002 @@ -287,11 +287,12 @@ { if (mutt_parse_rc_line (tmp->command, &token, &err) == -1) { mutt_error ("%s", err.data); FREE (&token.data); - mutt_sleep (1); /* pause a moment to let the user see the error */ + if (WarnDelay) + usleep (1000UL * WarnDelay); /* pause a moment to let the user see the error */ current_hook_type = 0; return; } } } @@ -334,11 +335,12 @@ if ((mutt_pattern_exec (hook->pattern, 0, ctx, hdr) > 0) ^ hook->rx.not) if (mutt_parse_rc_line (hook->command, &token, &err) != 0) { FREE (&token.data); mutt_error ("%s", err.data); - mutt_sleep (1); + if (WarnDelay) + usleep (1000UL * WarnDelay); current_hook_type = 0; return; } } FREE (&token.data); @@ -469,11 +471,12 @@ { if (mutt_parse_rc_line (hook->command, &token, &err) == -1) { FREE (&token.data); mutt_error ("%s", err.data); - mutt_sleep (1); + if (WarnDelay) + usleep (1000UL * WarnDelay); return; } } } --- orig-init.c Mon Feb 11 01:58:54 2002 +++ init.c Mon Jun 3 15:17:01 2002 @@ -1250,10 +1250,12 @@ while ((linebuf = mutt_read_line (linebuf, &buflen, f, &line)) != NULL) { if (mutt_parse_rc_line (linebuf, &token, err) == -1) { mutt_error (_("Error in %s, line %d: %s"), rcfile, line, err->data); + if (InfoDelay) + usleep (1000UL * InfoDelay); if (--rc < -MAXERRS) break; } else if (rc < 0) @@ -1267,10 +1269,12 @@ if (rc) { /* the muttrc source keyword */ snprintf (err->data, err->dsize, rc >= -MAXERRS ? _("source: errors in %s") : _("source: reading aborted due too many errors in %s"), rcfile); + if (WarnDelay) + usleep (1000UL * WarnDelay); rc = -1; } return (rc); } --- orig-init.h Thu Apr 25 06:26:37 2002 +++ init.h Mon Jun 3 15:15:07 2002 @@ -478,10 +478,19 @@ ** to sendmail command using the "-f" command line switch, so don't set this ** option if you are using that switch in $$sendmail yourself, ** or if the sendmail on your machine doesn't support that command ** line switch. */ + { "error_delay", DT_NUM, R_NONE, UL &ErrorDelay, 5000 }, + /* + ** .pp + ** If set to a value greater than 0, Mutt will sleep for that many + ** thousandths of a second after showing an error message. If set + ** to 0, Mutt is allowed to optimize the error message away entirely. + ** .pp + ** Also see the ``$$info_delay'' and ``$$warn_delay'' variables. + */ { "escape", DT_STR, R_NONE, UL &EscChar, UL "~" }, /* ** .pp ** Escape character to use for functions in the builtin editor. */ @@ -905,10 +914,20 @@ ** .dt %|X .dd pad to the end of the line with character "X" ** .de ** .pp ** See also: ``$$to_chars''. */ + { "info_delay", DT_NUM, R_NONE, UL &InfoDelay, 1000 }, + /* + ** .pp + ** If set to a value greater than 0, Mutt will sleep for that many + ** thousandths of a second after showing an informational message. + ** If set to 0, Mutt is allowed to optimize the informational message + ** away entirely. + ** .pp + ** Also see the ``$$error_delay'' and ``$$warn_delay'' variables. + */ { "ispell", DT_PATH, R_NONE, UL &Ispell, UL ISPELL }, /* ** .pp ** How to invoke ispell (GNU's spell-checking software). */ @@ -2328,10 +2347,19 @@ ** that the corresponding mailcap entry has a \fIneedsterminal\fP flag, ** and the external program is interactive. ** .pp ** When set, Mutt will always ask for a key. When unset, Mutt will wait ** for a key only if the external command returned a non-zero status. + */ + { "warn_delay", DT_NUM, R_NONE, UL &WarnDelay, 2000 }, + /* + ** .pp + ** If set to a value greater than 0, Mutt will sleep for that many + ** thousandths of a second after showing a warning message. If set + ** to 0, Mutt is allowed to optimize the warning message away entirely. + ** .pp + ** Also see the ``$$error_delay'' and ``$$info_delay'' variables. */ { "weed", DT_BOOL, R_NONE, OPTWEED, 1 }, /* ** .pp ** When set, mutt will weed headers when when displaying, forwarding, --- orig-keymap.c Tue Oct 16 07:29:27 2001 +++ keymap.c Mon Jun 3 16:09:55 2002 @@ -516,49 +516,46 @@ } void km_init (void) { memset (Keymaps, 0, sizeof (struct keymap_t *) * MENU_MAX); +} +void km_init_bind (void) +{ + /* basic bindings for each menu */ create_bindings (OpAttach, MENU_ATTACH); create_bindings (OpBrowser, MENU_FOLDER); create_bindings (OpCompose, MENU_COMPOSE); create_bindings (OpMain, MENU_MAIN); create_bindings (OpPager, MENU_PAGER); create_bindings (OpPost, MENU_POST); create_bindings (OpQuery, MENU_QUERY); create_bindings (OpAlias, MENU_ALIAS); - - #ifdef HAVE_PGP create_bindings (OpPgp, MENU_PGP); #endif - #ifdef MIXMASTER create_bindings (OpMix, MENU_MIX); - km_bindkey ("", MENU_MIX, OP_GENERIC_SELECT_ENTRY); km_bindkey ("h", MENU_MIX, OP_MIX_CHAIN_PREV); km_bindkey ("l", MENU_MIX, OP_MIX_CHAIN_NEXT); #endif - /* bindings for the line editor */ create_bindings (OpEditor, MENU_EDITOR); - km_bindkey ("", MENU_EDITOR, OP_EDITOR_HISTORY_UP); km_bindkey ("", MENU_EDITOR, OP_EDITOR_HISTORY_DOWN); km_bindkey ("", MENU_EDITOR, OP_EDITOR_BACKWARD_CHAR); km_bindkey ("", MENU_EDITOR, OP_EDITOR_FORWARD_CHAR); km_bindkey ("", MENU_EDITOR, OP_EDITOR_BOL); km_bindkey ("", MENU_EDITOR, OP_EDITOR_EOL); km_bindkey ("", MENU_EDITOR, OP_EDITOR_BACKSPACE); km_bindkey ("", MENU_EDITOR, OP_EDITOR_BACKSPACE); km_bindkey ("\177", MENU_EDITOR, OP_EDITOR_BACKSPACE); - + /* generic menu keymap */ create_bindings (OpGeneric, MENU_GENERIC); - km_bindkey ("", MENU_GENERIC, OP_FIRST_ENTRY); km_bindkey ("", MENU_GENERIC, OP_LAST_ENTRY); km_bindkey ("", MENU_GENERIC, OP_NEXT_PAGE); km_bindkey ("", MENU_GENERIC, OP_PREV_PAGE); km_bindkey ("", MENU_GENERIC, OP_NEXT_PAGE); @@ -572,24 +569,22 @@ km_bindkey ("5", MENU_GENERIC, OP_JUMP); km_bindkey ("6", MENU_GENERIC, OP_JUMP); km_bindkey ("7", MENU_GENERIC, OP_JUMP); km_bindkey ("8", MENU_GENERIC, OP_JUMP); km_bindkey ("9", MENU_GENERIC, OP_JUMP); - km_bindkey ("", MENU_GENERIC, OP_GENERIC_SELECT_ENTRY); - /* Miscellaneous extra bindings */ - + /* index menu keymap */ km_bindkey (" ", MENU_MAIN, OP_DISPLAY_MESSAGE); km_bindkey ("", MENU_MAIN, OP_MAIN_PREV_UNDELETED); km_bindkey ("", MENU_MAIN, OP_MAIN_NEXT_UNDELETED); km_bindkey ("J", MENU_MAIN, OP_NEXT_ENTRY); km_bindkey ("K", MENU_MAIN, OP_PREV_ENTRY); km_bindkey ("x", MENU_MAIN, OP_EXIT); - km_bindkey ("", MENU_MAIN, OP_DISPLAY_MESSAGE); + /* pager menu keymap */ km_bindkey ("x", MENU_PAGER, OP_EXIT); km_bindkey ("i", MENU_PAGER, OP_EXIT); km_bindkey ("", MENU_PAGER, OP_PREV_LINE); km_bindkey ("", MENU_PAGER, OP_NEXT_PAGE); km_bindkey ("", MENU_PAGER, OP_PREV_PAGE); @@ -606,20 +601,22 @@ km_bindkey ("5", MENU_PAGER, OP_JUMP); km_bindkey ("6", MENU_PAGER, OP_JUMP); km_bindkey ("7", MENU_PAGER, OP_JUMP); km_bindkey ("8", MENU_PAGER, OP_JUMP); km_bindkey ("9", MENU_PAGER, OP_JUMP); - km_bindkey ("", MENU_PAGER, OP_NEXT_LINE); + /* alias menu keymap */ km_bindkey ("", MENU_ALIAS, OP_GENERIC_SELECT_ENTRY); km_bindkey ("", MENU_ALIAS, OP_GENERIC_SELECT_ENTRY); km_bindkey ("", MENU_ALIAS, OP_TAG); + /* attach menu keymap */ km_bindkey ("", MENU_ATTACH, OP_VIEW_ATTACH); - km_bindkey ("", MENU_COMPOSE, OP_VIEW_ATTACH); + /* compose menu keymap */ + km_bindkey ("", MENU_COMPOSE, OP_VIEW_ATTACH); /* edit-to (default "t") hides generic tag-entry in Compose menu This will bind tag-entry to "T" in the Compose menu */ km_bindkey ("T", MENU_COMPOSE, OP_TAG); } --- orig-keymap.h Tue Sep 11 04:20:34 2001 +++ keymap.h Mon Jun 3 15:15:07 2002 @@ -43,10 +43,11 @@ char *km_keyname (int); int km_expand_key (char *, size_t, struct keymap_t *); struct keymap_t *km_find_func (int, int); void km_init (void); +void km_init_bind (void); void km_error_key (int); enum { MENU_ALIAS, --- orig-lib.c Mon Apr 29 10:12:12 2002 +++ lib.c Mon Jun 3 15:15:07 2002 @@ -349,11 +349,12 @@ int safe_open (const char *path, int flags) { struct stat osb, nsb; int fd; - if ((fd = open (path, flags, 0600)) < 0) +/* This should differentiate between temporary files and truly-saved files, and be 0600 in the first case and 0666 in the latter */ + if ((fd = open (path, flags, 0666)) < 0) return fd; /* make sure the file is not symlink */ if (lstat (path, &osb) < 0 || fstat (fd, &nsb) < 0 || compare_stat(&osb, &nsb) == -1) --- orig-main.c Wed Nov 7 02:51:29 2001 +++ main.c Mon Jun 3 16:16:16 2002 @@ -83,13 +83,13 @@ static void mutt_usage (void) { puts (mutt_make_version ()); puts _( -"usage: mutt [ -nRyzZ ] [ -e ] [ -F ] [ -m ] [ -f ]\n\ - mutt [ -nx ] [ -e ] [ -a ] [ -F ] [ -H ] [ -i ] [ -s ] [ -b ] [ -c ] [ ... ]\n\ - mutt [ -n ] [ -e ] [ -F ] -p\n\ +"usage: mutt [ -nNRyzZ ] [ -e ] [ -F ] [ -m ] [ -f ]\n\ + mutt [ -nNx ] [ -e ] [ -a ] [ -F ] [ -H ] [ -i ] [ -s ] [ -b ] [ -c ] [ ... ]\n\ + mutt [ -nN ] [ -e ] [ -F ] -p\n\ mutt -v[v]\n\ \n\ options:\n\ -a \tattach a file to the message\n\ -b
\tspecify a blind carbon-copy (BCC) address\n\ @@ -99,10 +99,11 @@ -F \tspecify an alternate muttrc file\n\ -H \tspecify a draft file to read header from\n\ -i \tspecify a file which Mutt should include in the reply\n\ -m \tspecify a default mailbox type\n\ -n\t\tcauses Mutt not to read the system Muttrc\n\ + -N\t\tcauses Mutt not to apply the standard keybindings\n\ -p\t\trecall a postponed message\n\ -R\t\topen mailbox in read-only mode\n\ -s \tspecify a subject (must be in quotes if it has spaces)\n\ -v\t\tshow version and compile-time definitions\n\ -x\t\tsimulate the mailx send mode\n\ @@ -150,15 +151,12 @@ #ifdef DEBUG puts ("+DEBUG"); #else puts ("-DEBUG"); #endif - - puts ( - #ifdef HOMESPOOL "+HOMESPOOL " #else "-HOMESPOOL " #endif @@ -237,13 +235,12 @@ #ifdef USE_GNU_REGEX "+USE_GNU_REGEX " #else "-USE_GNU_REGEX " #endif - - "\n" - + ); + puts ( #ifdef HAVE_COLOR "+HAVE_COLOR " #else "-HAVE_COLOR " #endif @@ -283,28 +280,26 @@ #ifdef HAVE_RESIZETERM "+HAVE_RESIZETERM " #else "-HAVE_RESIZETERM " #endif - - ); - puts ( - + #ifdef HAVE_PGP "+HAVE_PGP " #else "-HAVE_PGP " #endif #ifdef BUFFY_SIZE - "+BUFFY_SIZE " + "+BUFFY_SIZE " #else - "-BUFFY_SIZE " + "-BUFFY_SIZE " #endif + #ifdef EXACT_ADDRESS "+EXACT_ADDRESS " #else "-EXACT_ADDRESS " #endif @@ -400,12 +395,10 @@ exit (0); } static void start_curses (void) { - km_init (); /* must come before mutt_init */ - #ifdef USE_SLANG_CURSES SLtt_Ignore_Beep = 1; /* don't do that #*$@^! annoying visual beep! */ SLsmg_Display_Eight_Bit = 128; /* characters above this are printable */ #else /* should come before initscr() so that ncurses 4.2 doesn't try to install @@ -436,10 +429,11 @@ #define M_IGNORE (1<<0) /* -z */ #define M_BUFFY (1<<1) /* -Z */ #define M_NOSYSRC (1<<2) /* -n */ #define M_RO (1<<3) /* -R */ #define M_SELECT (1<<4) /* -y */ +#define M_NOBIND (1<<5) /* -N */ int main (int argc, char **argv) { char folder[_POSIX_PATH_MAX] = ""; char *subject = NULL; @@ -476,31 +470,21 @@ setlocale (LC_CTYPE, ""); mutt_error = mutt_nocurses_error; mutt_message = mutt_nocurses_error; SRAND (time (NULL)); - umask (077); memset (Options, 0, sizeof (Options)); memset (QuadOptions, 0, sizeof (QuadOptions)); - while ((i = getopt (argc, argv, "a:b:F:f:c:d:e:H:s:i:hm:npRvxyzZ")) != EOF) + while ((i = getopt (argc, argv, "a:b:F:f:c:d:e:H:s:i:hm:nNpRvxyzZ")) != EOF) switch (i) { case 'a': attach = mutt_add_list (attach, optarg); break; - case 'F': - mutt_str_replace (&Muttrc, optarg); - break; - - case 'f': - strfcpy (folder, optarg, sizeof (folder)); - explicit_folder = 1; - break; - case 'b': case 'c': if (!msg) msg = mutt_new_header (); if (!msg->env) @@ -522,10 +506,19 @@ case 'e': commands = mutt_add_list (commands, optarg); break; + case 'f': + strfcpy (folder, optarg, sizeof (folder)); + explicit_folder = 1; + break; + + case 'F': + mutt_str_replace (&Muttrc, optarg); + break; + case 'H': draftFile = optarg; break; case 'i': @@ -539,10 +532,14 @@ case 'n': flags |= M_NOSYSRC; break; + case 'N': + flags |= M_NOBIND; + break; + case 'p': sendflags |= SENDPOSTPONED; break; case 'R': @@ -599,11 +596,16 @@ } /* This must come before mutt_init() because curses needs to be started before calling the init_pair() function to set the color scheme. */ if (!option (OPTNOCURSES)) + { + km_init (); + if (!(flags & M_NOBIND)) + km_init_bind (); start_curses (); + } /* set defaults and read init files */ mutt_init (flags & M_NOSYSRC, commands); mutt_free_list (&commands); @@ -839,11 +841,13 @@ || !explicit_folder) { mutt_index_menu (); if (Context) safe_free ((void **)&Context); + mutt_endwin (NULL); } - mutt_endwin (Errorbuf); + else + mutt_endwin (Errorbuf); } exit (0); } --- orig-mbox.c Wed Feb 27 23:58:47 2002 +++ mbox.c Mon Jun 3 16:22:22 2002 @@ -735,12 +735,15 @@ if (-1 != i) { close (i); unlink (tempfile); } - mutt_error _("Could not create temporary file!"); - mutt_sleep (5); + if (ErrorDelay) + { + mutt_error _("Could not create temporary file!"); + usleep (1000UL * ErrorDelay); + } goto bail; } /* find the first deleted/changed message. we save a lot of time by only * rewriting the mailbox from the point where it has actually changed. @@ -752,12 +755,15 @@ { /* this means ctx->changed or ctx->deleted was set, but no * messages were found to be changed or deleted. This should * never happen, is we presume it is a bug in mutt. */ - mutt_error _("sync: mbox modified, but no modified messages! (report this bug)"); - mutt_sleep(5); /* the mutt_error /will/ get cleared! */ + if (ErrorDelay) + { + mutt_error _("sync: mbox modified, but no modified messages! (report this bug)"); + usleep(1000UL * ErrorDelay); /* the mutt_error /will/ get cleared! */ + } dprint(1, (debugfile, "mbox_sync_mailbox(): no modified messages.\n")); unlink (tempfile); goto bail; } @@ -801,22 +807,24 @@ if (ctx->magic == M_MMDF) { if (fputs (MMDF_SEP, fp) == EOF) { mutt_perror (tempfile); - mutt_sleep (5); + if (ErrorDelay) + usleep (1000UL * ErrorDelay); unlink (tempfile); goto bail; } } else if (ctx->magic == M_KENDRA) { if (fputs (KENDRA_SEP, fp) == EOF) { mutt_perror (tempfile); - mutt_sleep (5); + if (ErrorDelay) + usleep (1000UL * ErrorDelay); unlink (tempfile); goto bail; } } @@ -827,11 +835,12 @@ newOffset[i - first].hdr = ftell (fp) + offset; if (mutt_copy_message (fp, ctx, ctx->hdrs[i], M_CM_UPDATE, CH_FROM | CH_UPDATE | CH_UPDATE_LEN) == -1) { mutt_perror (tempfile); - mutt_sleep (5); + if (ErrorDelay) + usleep (1000UL * ErrorDelay); unlink (tempfile); goto bail; } /* Since messages could have been deleted, the offsets stored in memory @@ -847,29 +856,32 @@ { case M_MMDF: if(fputs(MMDF_SEP, fp) == EOF) { mutt_perror (tempfile); - mutt_sleep (5); + if (ErrorDelay) + usleep (1000UL * ErrorDelay); unlink (tempfile); goto bail; } break; case M_KENDRA: if(fputs(KENDRA_SEP, fp) == EOF) { mutt_perror (tempfile); - mutt_sleep (5); + if (ErrorDelay) + usleep (1000UL * ErrorDelay); unlink (tempfile); goto bail; } break; default: if(fputs("\n", fp) == EOF) { mutt_perror (tempfile); - mutt_sleep (5); + if (ErrorDelay) + usleep (1000UL * ErrorDelay); unlink (tempfile); goto bail; } } } @@ -879,31 +891,34 @@ { fp = NULL; dprint(1, (debugfile, "mbox_sync_mailbox: fclose() returned non-zero.\n")); unlink (tempfile); mutt_perror (tempfile); - mutt_sleep (5); + if (ErrorDelay) + usleep (1000UL * ErrorDelay); goto bail; } fp = NULL; /* Save the state of this folder. */ if (stat (ctx->path, &statbuf) == -1) { mutt_perror (ctx->path); - mutt_sleep (5); + if (ErrorDelay) + usleep (1000UL * ErrorDelay); unlink (tempfile); goto bail; } if ((fp = fopen (tempfile, "r")) == NULL) { mutt_unblock_signals (); mx_fastclose_mailbox (ctx); dprint (1, (debugfile, "mbox_sync_mailbox: unable to reopen temp copy of mailbox!\n")); mutt_perror (tempfile); - mutt_sleep (5); + if (ErrorDelay) + usleep (1000UL * ErrorDelay); return (-1); } if (fseek (ctx->fp, offset, SEEK_SET) != 0 || /* seek the append location */ /* do a sanity check to make sure the mailbox looks ok */ @@ -957,12 +972,15 @@ NONULL (Tempdir), NONULL(Username), NONULL(Hostname), getpid ()); rename (tempfile, savefile); mutt_unblock_signals (); mx_fastclose_mailbox (ctx); mutt_pretty_mailbox (savefile); - mutt_error (_("Write failed! Saved partial mailbox to %s"), savefile); - mutt_sleep (5); + if (ErrorDelay) + { + mutt_error (_("Write failed! Saved partial mailbox to %s"), savefile); + usleep (1000UL * ErrorDelay); + } return (-1); } /* Restore the previous access/modification times */ utimebuf.actime = statbuf.st_atime; --- orig-menu.c Mon Jan 28 02:18:17 2002 +++ menu.c Mon Jun 3 16:23:51 2002 @@ -25,10 +25,11 @@ #include "imap.h" #endif #include #include +#include extern int Charset_is_utf8; /* FIXME: bad modularisation */ static void print_enriched_string (int attr, unsigned char *s, int do_color) { @@ -360,11 +361,12 @@ { if (menu->dialog) { if (option (OPTMSGERR)) { - mutt_sleep (1); + if (ErrorDelay) + usleep (1000UL * ErrorDelay); unset_option (OPTMSGERR); } if (*Errorbuf) mutt_clear_error (); --- orig-mx.c Wed Mar 20 01:53:34 2002 +++ mx.c Mon Jun 3 15:15:07 2002 @@ -189,12 +189,15 @@ return (-1); } prev_sb = sb; - mutt_message (_("Waiting for fcntl lock... %d"), ++attempt); - sleep (1); + if (InfoDelay) + { + mutt_message (_("Waiting for fcntl lock... %d"), ++attempt); + usleep (1000UL * InfoDelay); + } } #endif /* USE_FCNTL */ #ifdef USE_FLOCK count = 0; @@ -224,12 +227,15 @@ break; } prev_sb = sb; - mutt_message (_("Waiting for flock attempt... %d"), ++attempt); - sleep (1); + if (InfoDelay) + { + mutt_message (_("Waiting for flock attempt... %d"), ++attempt); + usleep (1000UL * InfoDelay); + } } #endif /* USE_FLOCK */ #ifdef USE_DOTLOCK if (r == 0 && dot) --- orig-pager.c Sun Jan 13 00:52:15 2002 +++ pager.c Mon Jun 3 16:26:52 2002 @@ -742,11 +742,13 @@ lineInfo[n].type = MT_COLOR_ATTACHMENT; #else else if (check_attachment_marker ((char *) raw) == 0) lineInfo[n].type = MT_COLOR_ATTACHMENT; #endif - else if (mutt_strcmp ("-- \n", buf) == 0 || mutt_strcmp ("-- \r\n", buf) == 0) + else if (mutt_strcmp ("-- \n", buf) == 0 || mutt_strcmp ("-- \r\n", buf) == 0 + || mutt_strncmp ("----------------------------------------", buf, 40) == 0 + || mutt_strncmp ("________________________________________", buf, 40) == 0) { i = n + 1; lineInfo[n].type = MT_COLOR_SIGNATURE; while (i < last && check_sig (buf, lineInfo, i - 1) == 0 && --- orig-pgpkey.c Tue Jan 15 01:04:28 2002 +++ pgpkey.c Mon Jun 3 15:15:07 2002 @@ -678,10 +678,12 @@ FOREVER { resp[0] = 0; if (mutt_get_field (tag, resp, sizeof (resp), M_CLEAR) != 0) return NULL; + if (!*resp) + return NULL; if (whatfor) { if (l) mutt_str_replace (&l->dflt, resp); --- orig-send.c Wed Jan 30 14:50:40 2002 +++ send.c Mon Jun 3 15:15:07 2002 @@ -1194,11 +1194,12 @@ if (option (OPTHDRS)) process_user_recips (msg->env); if (! (flags & SENDMAILX) && - ! (option (OPTAUTOEDIT) && option (OPTEDITHDRS)) && + ! (option (OPTAUTOEDIT)) && + ! (option (OPTEDITHDRS)) && ! ((flags & SENDREPLY) && option (OPTFASTREPLY))) { if (edit_envelope (msg->env) == -1) goto cleanup; } --- orig-sendlib.c Sat Apr 20 00:25:49 2002 +++ sendlib.c Mon Jun 3 15:15:07 2002 @@ -2352,11 +2352,12 @@ /* (postponment) save the Fcc: using a special X-Mutt- header so that * it can be picked up when the message is recalled */ if (post && fcc) fprintf (msg->fp, "X-Mutt-Fcc: %s\n", fcc); - fprintf (msg->fp, "Status: RO\n"); + if (f.magic != M_MAILDIR) + fprintf (msg->fp, "Status: RO\n"); #ifdef HAVE_PGP /* (postponment) if the mail is to be signed or encrypted, save this info */ --- orig-sort.c Thu Dec 13 04:10:59 2001 +++ sort.c Mon Jun 3 16:27:43 2002 @@ -234,12 +234,15 @@ mutt_sort_threads (ctx, init); } else if ((sortfunc = mutt_get_sort_func (Sort)) == NULL || (AuxSort = mutt_get_sort_func (SortAux)) == NULL) { - mutt_error _("Could not find sorting function! [report this bug]"); - mutt_sleep (1); + if (ErrorDelay) + { + mutt_error _("Could not find sorting function! [report this bug]"); + usleep (1000UL * ErrorDelay); + } return; } else qsort ((void *) ctx->hdrs, ctx->msgcount, sizeof (HEADER *), sortfunc);