Index: mutt-1.5.17+20080114/OPS =================================================================== --- mutt-1.5.17+20080114.orig/OPS 2008-01-14 22:24:10.000000000 +0000 +++ mutt-1.5.17+20080114/OPS 2008-03-01 23:30:05.000000000 +0000 @@ -56,6 +56,7 @@ OP_DISPLAY_ADDRESS "display full address of sender" OP_DISPLAY_HEADERS "display message and toggle header weeding" OP_DISPLAY_MESSAGE "display a message" +OP_EDIT_INPLACE_MESSAGE "edit the raw message" OP_EDIT_MESSAGE "edit the raw message" OP_EDITOR_BACKSPACE "delete the char in front of the cursor" OP_EDITOR_BACKWARD_CHAR "move the cursor one character to the left" Index: mutt-1.5.17+20080114/curs_main.c =================================================================== --- mutt-1.5.17+20080114.orig/curs_main.c 2008-01-14 22:24:10.000000000 +0000 +++ mutt-1.5.17+20080114/curs_main.c 2008-03-01 23:30:05.000000000 +0000 @@ -1880,6 +1880,21 @@ unset_option (OPTFORCEREDRAWPAGER); break; + case OP_EDIT_INPLACE_MESSAGE: + + CHECK_MSGCOUNT; + CHECK_VISIBLE; + CHECK_READONLY; + CHECK_ATTACH; + CHECK_ACL(M_ACL_INSERT, _("edit message")); + + if (option (OPTPGPAUTODEC) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) + mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw); + mutt_edit_message_inplace (Context, tag ? NULL : CURHDR); + menu->redraw = REDRAW_FULL; + + break; + case OP_EDIT_MESSAGE: CHECK_MSGCOUNT; Index: mutt-1.5.17+20080114/editmsg.c =================================================================== --- mutt-1.5.17+20080114.orig/editmsg.c 2008-01-14 21:58:32.000000000 +0000 +++ mutt-1.5.17+20080114/editmsg.c 2008-03-01 23:38:12.000000000 +0000 @@ -211,6 +211,33 @@ return rc; } +int mutt_edit_message_inplace (CONTEXT *ctx, HEADER *hdr) +{ + char buf[ 1024]; + memset( buf, '\0', sizeof(buf)); + + if ( NULL == getenv( "EDITINPLACE" ) ) + return 1; + + + + + + + if ( NULL == hdr->file_path ) + { + printf( "hdr->file_path is NULL" ); + return 1; + } + + snprintf(buf, sizeof(buf)-1, "%s %s", + getenv( "EDITINPLACE" ), hdr->file_path ); + mutt_endwin(NULL); + system( buf ); + return 0; +} + + int mutt_edit_message (CONTEXT *ctx, HEADER *hdr) { int i, j; Index: mutt-1.5.17+20080114/functions.h =================================================================== --- mutt-1.5.17+20080114.orig/functions.h 2008-01-14 22:24:10.000000000 +0000 +++ mutt-1.5.17+20080114/functions.h 2008-03-01 23:30:05.000000000 +0000 @@ -98,6 +98,7 @@ { "delete-pattern", OP_MAIN_DELETE_PATTERN, "D" }, { "delete-thread", OP_DELETE_THREAD, "\004" }, { "delete-subthread", OP_DELETE_SUBTHREAD, "\033d" }, + { "edit-inplace", OP_EDIT_INPLACE_MESSAGE, "E" }, { "edit", OP_EDIT_MESSAGE, "e" }, { "edit-type", OP_EDIT_TYPE, "\005" }, { "forward-message", OP_FORWARD_MESSAGE, "f" }, @@ -183,6 +184,7 @@ { "delete-message", OP_DELETE, "d" }, { "delete-thread", OP_DELETE_THREAD, "\004" }, { "delete-subthread", OP_DELETE_SUBTHREAD, "\033d" }, + { "edit-inplace", OP_EDIT_INPLACE_MESSAGE, "E" }, { "edit", OP_EDIT_MESSAGE, "e" }, { "edit-type", OP_EDIT_TYPE, "\005" }, { "forward-message", OP_FORWARD_MESSAGE, "f" }, Index: mutt-1.5.17+20080114/mh.c =================================================================== --- mutt-1.5.17+20080114.orig/mh.c 2008-01-14 22:25:33.000000000 +0000 +++ mutt-1.5.17+20080114/mh.c 2008-03-01 23:34:02.000000000 +0000 @@ -733,6 +733,12 @@ else h->path = safe_strdup (de->d_name); + { + char steve[_POSIX_PATH_MAX]; + snprintf(steve,sizeof(steve),"%s/%s",buf,h->path); + h->file_path = safe_strdup( steve ); + } + entry = safe_calloc (sizeof (struct maildir), 1); entry->h = h; #ifdef HAVE_DIRENT_D_INO @@ -1069,6 +1075,7 @@ #endif if (maildir_parse_message (ctx->magic, fn, p->h->old, p->h)) { + p->header_parsed = 1; #if USE_HCACHE if (ctx->magic == M_MH) Index: mutt-1.5.17+20080114/mutt.h =================================================================== --- mutt-1.5.17+20080114.orig/mutt.h 2008-01-14 22:24:11.000000000 +0000 +++ mutt-1.5.17+20080114/mutt.h 2008-03-01 23:37:08.000000000 +0000 @@ -761,6 +761,7 @@ ENVELOPE *env; /* envelope information */ BODY *content; /* list of MIME parts */ char *path; + char *file_path; char *tree; /* character string to print thread tree */ struct thread *thread; @@ -862,6 +863,7 @@ typedef struct _context { char *path; + FILE *fp; time_t mtime; off_t size;