patch: wraplength configuration variable
Okay. I have come up with a small patch that will implement
"wraplength" in the simplest case. I say simplest case because there
are some circumstances where WrapMargin is used for something other
than just plain smart-wrapping. For instance, enriched wrap uses its
value for right-justification. If you need wraplength to apply in
these cases also, please be as specific as you can about how you would
like it to behave.
Enjoy,
Allister
diff -ur ../mutt-1.5.4/globals.h ./globals.h
--- ../mutt-1.5.4/globals.h 2003-03-07 03:19:41.000000000 -0500
+++ ./globals.h 2003-10-04 10:27:12.000000000 -0400
@@ -152,6 +152,7 @@
WHERE short SendmailWait;
WHERE short SleepTime INITVAL (1);
WHERE short Timeout;
+WHERE short WrapLength;
WHERE short WrapMargin;
WHERE short WriteInc;
diff -ur ../mutt-1.5.4/init.h ./init.h
--- ../mutt-1.5.4/init.h 2003-03-04 04:28:12.000000000 -0500
+++ ./init.h 2003-10-04 10:26:48.000000000 -0400
@@ -2618,6 +2618,11 @@
** When set, searches will wrap around the first (or last) message. When
** unset, searches will not wrap.
*/
+ { "wraplength", DT_NUM, R_PAGER, UL &WrapLength, 0 },
+ /*
+ ** .pp
+ ** Controls the length of lines when mutt's pager does smart wrapping.
+ */
{ "wrapmargin", DT_NUM, R_PAGER, UL &WrapMargin, 0 },
/*
** .pp
diff -ur ../mutt-1.5.4/pager.c ./pager.c
--- ../mutt-1.5.4/pager.c 2003-01-23 17:04:28.000000000 -0500
+++ ./pager.c 2003-10-04 10:30:22.000000000 -0400
@@ -1037,6 +1037,9 @@
if (wrap_cols <= 0)
wrap_cols = COLS;
+ if (WrapLength && wrap_cols > WrapLength)
+ wrap_cols = WrapLength;
+
/* FIXME: this should come from lineInfo */
memset(&mbstate, 0, sizeof(mbstate));