wiki.mutt.org down, delsp, and subject spellcheck
Hey everybody,
wiki.mutt.org sends back ye olde reset on port 80.
I was trying to access it because I wanted to find out about the status
of "delsp" ala rfc3676. This is of keen interest to me because of
certain insufferable mac users who keep emailing me "broken" URLs. I
happily add my vote to the "we can do this guys!" squad without, of
course, offering any patches.
...Or perhaps I can trade somebody delsp support for something that I do
have patches for...da da da DA...the world-famous (yet still
underground) mutt subject spellcheck patch! I mailed it to the dev list
a while ago, but I thought I'd attach it here again in the spirit of
mutt rejuvenation. How does one survive with misspelled subject lines?!
Thanks for any comments and best wishes,
Mike H.
diff -u -r mutt-1.5.11-orig/PATCHES mutt-1.5.11-checksubj/PATCHES
--- mutt-1.5.11-orig/PATCHES 2005-08-15 03:16:00.000000000 -0500
+++ mutt-1.5.11-checksubj/PATCHES 2006-04-10 21:21:34.000000000 -0500
@@ -0,0 +1 @@
+patch-1.5.11.mh.checksubj.3
diff -u -r mutt-1.5.11-orig/compose.c mutt-1.5.11-checksubj/compose.c
--- mutt-1.5.11-orig/compose.c 2005-08-11 14:37:23.000000000 -0500
+++ mutt-1.5.11-checksubj/compose.c 2006-03-12 17:35:16.000000000 -0600
@@ -1178,6 +1178,61 @@
case OP_COMPOSE_ISPELL:
endwin ();
+/*#ifdef MTH_SUBJECT_SPELLCHECK_HACK*/
+ if (option (OPTSPELLCHECKSUBJECT))
+ {
+ FILE * spellfp;
+ char spellfile[_POSIX_PATH_MAX];
+ size_t subjectlen;
+
+ if (msg->env->subject != NULL && (subjectlen = strlen
(msg->env->subject))> 0)
+ {
+ mutt_mktemp (spellfile);
+
+ /* put subject in a file by itself, ispell the file, rewrite the
subject in memory */
+ if (!(spellfp = fopen (spellfile, "w")))
+ {
+ mutt_error (_("Can't create file %s"),
spellfile);
+ continue;
+ }
+
+ fputs(msg->env->subject,spellfp);
+ fclose(spellfp);
+
+ snprintf (buf, sizeof (buf), "%s -x %s",
NONULL(Ispell), spellfile);
+ if (mutt_system (buf) == -1)
+ mutt_error (_("Error running \"%s\"!"), buf);
+
+ if (!(spellfp = fopen (spellfile, "r")))
+ {
+ mutt_error (_("Can't open file %s"), spellfile);
+ continue;
+ }
+
+ subjectlen = fread(buf, 1, LONG_STRING, spellfp );
+ fclose(spellfp);
+ mutt_unlink (spellfile);
+
+ /*truncate the subject to LONG_STRING of what we got back from ispell*/
+ if (subjectlen < LONG_STRING)
+ buf[subjectlen] = '\0';
+ else
+ buf[LONG_STRING-1] = '\0';
+
+ mutt_str_replace(&msg->env->subject, buf);
+ mutt_update_encoding (msg->content);
+ menu->redraw |= REDRAW_STATUS; /*TODO Remove? */
+ mutt_str_replace (&msg->env->subject, buf);
+ move (HDR_SUBJECT, HDR_XOFFSET);
+ clrtoeol ();
+ if (msg->env->subject)
+ mutt_paddstr (W, msg->env->subject);
+
+ /*#endif MTH_SUBJECT_SPELLCHECK_HACK*/
+ }
+ }
+
snprintf (buf, sizeof (buf), "%s -x %s", NONULL(Ispell),
msg->content->filename);
if (mutt_system (buf) == -1)
mutt_error (_("Error running \"%s\"!"), buf);
diff -u -r mutt-1.5.11-orig/init.h mutt-1.5.11-checksubj/init.h
--- mutt-1.5.11-orig/init.h 2005-09-15 09:19:54.000000000 -0500
+++ mutt-1.5.11-checksubj/init.h 2006-03-12 17:13:50.000000000 -0600
@@ -2690,6 +2690,13 @@
** ``$$sort_re'' for a less drastic way of controlling this
** behaviour.
*/
+ { "spellcheck_subject", DT_BOOL, R_NONE, OPTSPELLCHECKSUBJECT , 0 },
+ /*
+ ** .pp
+ ** When set, mutt also spellchecks the subject line of a message by
+ ** writing it out to a temp file and envoking the spell check, then
+ ** continues the standard spellcheck as usual
+ */
{ "suspend", DT_BOOL, R_NONE, OPTSUSPEND, 1 },
/*
** .pp
diff -u -r mutt-1.5.11-orig/mutt.h mutt-1.5.11-checksubj/mutt.h
--- mutt-1.5.11-orig/mutt.h 2005-09-07 03:19:43.000000000 -0500
+++ mutt-1.5.11-checksubj/mutt.h 2006-03-12 14:13:48.000000000 -0600
@@ -419,6 +419,7 @@
OPTSIGONTOP,
OPTSORTRE,
OPTSPAMSEP,
+ OPTSPELLCHECKSUBJECT,
OPTSTATUSONTOP,
OPTSTRICTTHREADS,
OPTSUSPEND,