# # Patches for qozzy modifications to mutt, as of v2.2.10 # Carried over from MV patches. MV is no more. # # cd to the mutt source directory, and # patch -p1 < this_file # # You'll get a couple of BUILD.*QOZZY.orig files, delete or ignore them. # # # diff -Naur mutt-2.2.10.orig/BUILD-NO-SLANG.QOZZY mutt-2.2.10.patched/BUILD-NO-SLANG.QOZZY --- mutt-2.2.10.orig/BUILD-NO-SLANG.QOZZY 1969-12-31 19:00:00.000000000 -0500 +++ mutt-2.2.10.patched/BUILD-NO-SLANG.QOZZY 2023-03-29 14:06:48.398851000 -0400 @@ -0,0 +1,19 @@ +#! /bin/sh +# +# How to configure mutt here at qozzy, using ncurses instead of slang +# +# + +CPPFLAGS="-I/usr/local/ssl/include -I/usr/local/include" +export CPPFLAGS + +LDFLAGS=-L/usr/local/lib +export LDFLAGS + +./configure \ + --enable-pop \ + --enable-imap \ + --with-homespool=Mailbox \ + --with-ssl + +# --with-ssl=/usr/local/ssl diff -Naur mutt-2.2.10.orig/BUILD-SLANG.QOZZY mutt-2.2.10.patched/BUILD-SLANG.QOZZY --- mutt-2.2.10.orig/BUILD-SLANG.QOZZY 1969-12-31 19:00:00.000000000 -0500 +++ mutt-2.2.10.patched/BUILD-SLANG.QOZZY 2023-03-29 14:06:48.404512000 -0400 @@ -0,0 +1,20 @@ +#! /bin/sh +# +# How to configure mutt here at qozzy, using slang +# +# + +CPPFLAGS="-I/usr/local/ssl/include -I/usr/local/include" +export CPPFLAGS + +LDFLAGS=-L/usr/local/lib +export LDFLAGS + +./configure \ + --with-slang \ + --enable-pop \ + --enable-imap \ + --with-homespool=Mailbox \ + --with-ssl + +# --with-ssl=/usr/local/ssl diff -Naur mutt-2.2.10.orig/Makefile.am mutt-2.2.10.patched/Makefile.am --- mutt-2.2.10.orig/Makefile.am 2022-12-12 17:42:54.000000000 -0500 +++ mutt-2.2.10.patched/Makefile.am 2023-03-29 14:06:48.409372000 -0400 @@ -55,7 +55,7 @@ DEFS=-DPKGDATADIR=\"$(pkgdatadir)\" -DSYSCONFDIR=\"$(sysconfdir)\" \ -DBINDIR=\"$(bindir)\" -DMUTTLOCALEDIR=\"$(datadir)/locale\" \ - -DHAVE_CONFIG_H=1 + -DHAVE_CONFIG_H=1 -DQOZZY AM_CPPFLAGS=-I. -I$(top_srcdir) $(IMAP_INCLUDES) $(AUTOCRYPT_INCLUDES) $(GPGME_CFLAGS) diff -Naur mutt-2.2.10.orig/Makefile.in mutt-2.2.10.patched/Makefile.in --- mutt-2.2.10.orig/Makefile.in 2023-03-25 16:07:36.000000000 -0400 +++ mutt-2.2.10.patched/Makefile.in 2023-03-29 14:06:48.416420000 -0400 @@ -395,7 +395,7 @@ DEBUGGER = @DEBUGGER@ DEFS = -DPKGDATADIR=\"$(pkgdatadir)\" -DSYSCONFDIR=\"$(sysconfdir)\" \ -DBINDIR=\"$(bindir)\" -DMUTTLOCALEDIR=\"$(datadir)/locale\" \ - -DHAVE_CONFIG_H=1 + -DHAVE_CONFIG_H=1 -DQOZZY DEPDIR = @DEPDIR@ DOTLOCK_GROUP = @DOTLOCK_GROUP@ diff -Naur mutt-2.2.10.orig/README.qozzy-patches mutt-2.2.10.patched/README.qozzy-patches --- mutt-2.2.10.orig/README.qozzy-patches 1969-12-31 19:00:00.000000000 -0500 +++ mutt-2.2.10.patched/README.qozzy-patches 2023-03-29 14:16:29.436733000 -0400 @@ -0,0 +1,40 @@ +This patch adds a few things to mutt done at qozzy, carried over +from changes made at MV Communications, Inc., which no longer exists. +These changes were originally done for an older mutt, but this patch set +has been generated for mutt 2.2.10 + +Variables added: + + top_margin number of margin lines to leave at the top of the index + display. + + bottom_margin number of margin lines to leave at the bottom of the + index display. + +I must say the implementation of margin variables became a lot simpler +after mutt 1.9 or so, or whatever point the window drawing code was +reorganized. + + +Functional changes / fixes: + +in mbox.c, the recognition of "^From " lines (for quoting and for detecting +new messages) has always been buggy. The From line should only be recognized +if it is preceded by a blank line (blank line separating messages) or if +it is the first line in the file. + +Also in mbox.c I carried forward an old patch testing against a missing +content length - the test should be against -1 but it is testing for +a positive value. This still seems to be needed, so I've left it in. + +Remove the recent addition of mutt_sleep(0) in send.c after sending +the message. It creates an annoying delay in workflow when sending +messages. One can prevent this by setting sleep_time to 0 in muttrc, +but that has far-ranging effects that inhibit reasonable short waits +for messages to be seen. The idea between the sleep we're taking out +is a good one, to make sure the message is seen if the screen is +cleared or replaced right afterwards, but there must be a better way to +do just that. + +All of these are in QOZZY conditionals. This patch also adds a define +for QOZZY to the Makefile.in (and Makefile.am in case you re-automake). diff -Naur mutt-2.2.10.orig/curs_lib.c mutt-2.2.10.patched/curs_lib.c --- mutt-2.2.10.orig/curs_lib.c 2023-03-25 15:50:20.000000000 -0400 +++ mutt-2.2.10.patched/curs_lib.c 2023-03-29 14:06:48.427477000 -0400 @@ -854,6 +854,16 @@ } #endif +#ifdef QOZZY + /* Apply top/bottom margins but only if there's room. If no room, + within some extra fuzz factor, no margins. + */ + if ( MuttIndexWindow->rows > (TopMarginLines + BottomMarginLines +2) ) { + MuttIndexWindow->row_offset += TopMarginLines; + MuttIndexWindow->rows -= (TopMarginLines + BottomMarginLines); + } +#endif /* QOZZY */ + mutt_set_current_menu_redraw_full (); /* the pager menu needs this flag set to recalc lineInfo */ mutt_set_current_menu_redraw (REDRAW_FLOW); diff -Naur mutt-2.2.10.orig/doc/Makefile.am mutt-2.2.10.patched/doc/Makefile.am --- mutt-2.2.10.orig/doc/Makefile.am 2022-12-12 17:42:54.000000000 -0500 +++ mutt-2.2.10.patched/doc/Makefile.am 2023-03-29 14:06:48.432147000 -0400 @@ -12,7 +12,7 @@ BUILD_DOC_TARGETS = stamp-doc-chunked manual.html manual.txt $(INFO_DOCFILES) endif -DEFS = -DSYSCONFDIR=\"$(sysconfdir)\" -DBINDIR=\"$(bindir)\" -DHAVE_CONFIG_H=1 +DEFS = -DSYSCONFDIR=\"$(sysconfdir)\" -DBINDIR=\"$(bindir)\" -DHAVE_CONFIG_H=1 -DQOZZY AM_CPPFLAGS = -I. -I.. -I$(includedir) -I$(top_srcdir) MAKEDOC_CPP = $(CPP) $(AM_CPPFLAGS) $(DEFS) $(CPPFLAGS) -D_MAKEDOC -C diff -Naur mutt-2.2.10.orig/doc/Makefile.in mutt-2.2.10.patched/doc/Makefile.in --- mutt-2.2.10.orig/doc/Makefile.in 2023-03-25 16:07:36.000000000 -0400 +++ mutt-2.2.10.patched/doc/Makefile.in 2023-03-29 14:06:48.437170000 -0400 @@ -147,7 +147,7 @@ DB2XTEXI = @DB2XTEXI@ DBX = @DBX@ DEBUGGER = @DEBUGGER@ -DEFS = -DSYSCONFDIR=\"$(sysconfdir)\" -DBINDIR=\"$(bindir)\" -DHAVE_CONFIG_H=1 +DEFS = -DSYSCONFDIR=\"$(sysconfdir)\" -DBINDIR=\"$(bindir)\" -DHAVE_CONFIG_H=1 -DQOZZY DEPDIR = @DEPDIR@ DOTLOCK_GROUP = @DOTLOCK_GROUP@ DOTLOCK_PERMISSION = @DOTLOCK_PERMISSION@ diff -Naur mutt-2.2.10.orig/globals.h mutt-2.2.10.patched/globals.h --- mutt-2.2.10.orig/globals.h 2023-03-25 15:50:20.000000000 -0400 +++ mutt-2.2.10.patched/globals.h 2023-03-29 14:06:48.441983000 -0400 @@ -255,6 +255,11 @@ WHERE LIST *SidebarWhitelist; #endif +#ifdef QOZZY /* mem 20010703 */ +WHERE short TopMarginLines; +WHERE short BottomMarginLines; +#endif /* QOZZY */ + #ifdef USE_IMAP WHERE long ImapFetchChunkSize; WHERE short ImapKeepalive; diff -Naur mutt-2.2.10.orig/init.h mutt-2.2.10.patched/init.h --- mutt-2.2.10.orig/init.h 2023-03-25 15:50:20.000000000 -0400 +++ mutt-2.2.10.patched/init.h 2023-03-29 14:06:48.451872000 -0400 @@ -548,6 +548,21 @@ ** notifying you of new mail. This is independent of the setting of the ** $$beep variable. */ + + +#ifdef QOZZY /* mem 20010703 */ + { "bottom_margin", DT_NUM, R_REFLOW, {.p=&BottomMarginLines}, {.p=0} }, + /* + ** .pp + ** Specifies the number of margin lines at the bottom of the index + ** display. When greater than zero, this will provide some white + ** space at the bottom of the index list. + ** Note: this is a QOZZY specific variable. + */ +#endif /* QOZZY */ + + + { "bounce", DT_QUAD, R_NONE, {.l=OPT_BOUNCE}, {.l=MUTT_ASKYES} }, /* ** .pp @@ -4664,6 +4679,21 @@ ** by \fIyou\fP. The sixth character is used to indicate when a mail ** was sent to a mailing-list you subscribe to. */ + + +#ifdef QOZZY /* mem 20010703 */ + { "top_margin", DT_NUM, R_REFLOW, {.p=&TopMarginLines}, {.p=0} }, + /* + ** .pp + ** Specifies the number of margin lines at the top of the index + ** display. When greater than zero, this will provide some white + ** space at the top of the index list. + ** Note: this is a QOZZY specific variable. + */ + +#endif /* QOZZY */ + + { "trash", DT_PATH, R_NONE, {.p=&TrashPath}, {.p=0} }, /* ** .pp diff -Naur mutt-2.2.10.orig/mbox.c mutt-2.2.10.patched/mbox.c --- mutt-2.2.10.orig/mbox.c 2023-01-26 13:49:37.000000000 -0500 +++ mutt-2.2.10.patched/mbox.c 2023-03-29 14:06:48.457850000 -0400 @@ -258,6 +258,15 @@ progress_t progress; char msgbuf[STRING]; +#ifdef QOZZY /* mem 20040423 fix for improper recognition + of new message; "From " can only be at the + beginning or following a blank line. A + "From " after a non-blank line doesn't start + a new message. Other mailers get this + right, odd that mutt doesn't. */ + int fromOK; /* If it's OK to see a "From " line here */ +#endif + /* Save information about the folder at the time we opened it. */ if (stat (ctx->path, &sb) == -1) { @@ -296,9 +305,24 @@ } loc = ftello (ctx->fp); + +#ifdef QOZZY /* mem 20040423 */ + fromOK = TRUE; /* "From " is OK at the beginning */ +/* I suppose this might be better: + fromOK = ( loc == 0L ); + but we don't really know the context here. +*/ +#endif /* QOZZY */ + while (fgets (buf, sizeof (buf), ctx->fp) != NULL) { + +#ifndef QOZZY /* mem 20040423 */ if (is_from (buf, return_path, sizeof (return_path), &t)) +#else + if (fromOK && is_from (buf, return_path, sizeof (return_path), &t)) +#endif /* QOZZY */ + { /* Save the Content-Length of the previous message */ if (count > 0) @@ -335,7 +359,13 @@ * or if we don't know how many lines there are, count them now (this will * save time by not having to search for the next message marker). */ +#ifdef QOZZY /* mem 20040423 -- missing content length is -1, + not 0, so this test is wrong */ if (curhdr->content->length > 0) +#else + if (curhdr->content->length >= 0) +#endif /* QOZZY */ + { LOFF_T tmploc; @@ -395,6 +425,10 @@ /* return to the offset of the next message separator */ if (fseeko (ctx->fp, tmploc, SEEK_SET) != 0) dprint (1, (debugfile, "mbox_parse_mailbox: fseek() failed\n")); + +#ifdef QOZZY /* mem 20040423 */ + else fromOK = TRUE; +#endif /* QOZZY */ } } @@ -408,8 +442,15 @@ lines = 0; } +#ifndef QOZZY /* mem 20040423 */ else lines++; +#else + else { + lines++; + fromOK = ( buf[0] == '\n' ); + } +#endif /* QOZZY */ loc = ftello (ctx->fp); } diff -Naur mutt-2.2.10.orig/menu.c mutt-2.2.10.patched/menu.c --- mutt-2.2.10.orig/menu.c 2023-01-01 23:42:19.000000000 -0500 +++ mutt-2.2.10.patched/menu.c 2023-03-29 14:06:48.463490000 -0400 @@ -238,8 +238,7 @@ mutt_paddstr (menu->helpwin->cols, menu->help); NORMAL_COLOR; } - menu->offset = 0; - menu->pagelen = menu->indexwin->rows; + mutt_show_error (); diff -Naur mutt-2.2.10.orig/send.c mutt-2.2.10.patched/send.c --- mutt-2.2.10.orig/send.c 2023-01-01 23:42:19.000000000 -0500 +++ mutt-2.2.10.patched/send.c 2023-03-29 14:06:48.470408000 -0400 @@ -2704,7 +2704,9 @@ if (!option (OPTNOCURSES) && !(sctx->flags & SENDMAILX)) { mutt_message (mta_rc == 0 ? _("Mail sent.") : _("Sending in background.")); +#ifndef QOZZY /* mem 20200211 revert this */ mutt_sleep (0); +#endif /* QOZZY */ } rv = 0;