Andreas Krennmair:
authorak1 <ak1@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Tue, 1 Mar 2005 08:52:07 +0000 (08:52 +0000)
committerak1 <ak1@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Tue, 1 Mar 2005 08:52:07 +0000 (08:52 +0000)
add an option to break f=f messages at a certain column.

git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@123 e385b8ad-14ed-0310-8656-cc95a2468c6d

globals.h
handler.c
init.h

index c04e5a3..7e06280 100644 (file)
--- a/globals.h
+++ b/globals.h
@@ -207,6 +207,7 @@ WHERE short Timeout;
 WHERE short Umask INITVAL(0077);
 WHERE short WrapMargin;
 WHERE short WriteInc;
+WHERE short MaxLineLength;
 
 WHERE short ScoreThresholdDelete;
 WHERE short ScoreThresholdRead;
index d0900ae..cae8a2e 100644 (file)
--- a/handler.c
+++ b/handler.c
@@ -1212,11 +1212,19 @@ static void print_flowed_line(char * line, STATE *s,int ql) {
   int len = strlen(line);
   int i;
 
-  width = COLS - WrapMargin - ql - 1;
-  if (option(OPTSTUFFQUOTED))
-    --width;
-  if (width < 0)
-    width = COLS;
+  if (MaxLineLength > 0) {
+    width = MaxLineLength - WrapMargin - ql - 1;
+    if (option(OPTSTUFFQUOTED))
+      --width;
+    if (width < 0)
+      width = MaxLineLength;
+  } else {
+    width = COLS - WrapMargin - ql - 1;
+    if (option(OPTSTUFFQUOTED))
+      --width;
+    if (width < 0)
+      width = COLS;
+  }
 
   /* fprintf(stderr,"print_flowed_line will print `%s' with ql = %d\n",line,ql); */
 
diff --git a/init.h b/init.h
index 5e8cd10..1de9507 100644 (file)
--- a/init.h
+++ b/init.h
@@ -1123,6 +1123,13 @@ struct option_t MuttVars[] = {
   ** from (instead to the author only). Setting this option to ``ask-yes'' or
   ** ``ask-no'' will ask if you really intended to reply to the author only.
   */
+  { "max_line_length", DT_NUM, R_NONE, UL &MaxLineLength, 0 },
+  /*
+  ** .pp
+  ** When set, the maximum line length for displaying f=f messages is limited
+  ** to this length. A value of 0 (which is also the default) means that the
+  ** maximum line length is determined by the terminal width and $$wrapmargin.
+  */
   { "mail_check",      DT_NUM,  R_NONE, UL &BuffyTimeout, 5 },
   /*
   ** .pp