]> granicus.if.org Git - neomutt/commitdiff
Add $reflow_text boolean, and $reflow_wrap variables to control display of format...
authorMichael Elkins <me@mutt.org>
Wed, 29 Sep 2010 21:17:24 +0000 (14:17 -0700)
committerMichael Elkins <me@mutt.org>
Wed, 29 Sep 2010 21:17:24 +0000 (14:17 -0700)
globals.h
handler.c
init.h
mutt.h
rfc3676.c

index 62d831d7525c7992d39f6c46c445a932f36aa6ac..5aec53007177209d3d76ef88a9b960ef48daf7f3 100644 (file)
--- a/globals.h
+++ b/globals.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1996-2002 Michael R. Elkins <me@mutt.org>
+ * Copyright (C) 1996-2002, 2010 Michael R. Elkins <me@mutt.org>
  * 
  *     This program is free software; you can redistribute it and/or modify
  *     it under the terms of the GNU General Public License as published by
@@ -194,6 +194,7 @@ WHERE short MenuContext;
 WHERE short PagerContext;
 WHERE short PagerIndexLines;
 WHERE short ReadInc;
+WHERE short ReflowWrap;
 WHERE short SaveHist;
 WHERE short SendmailWait;
 WHERE short SleepTime INITVAL (1);
index a45fbab646e305e6c3897587c7990c352458dc17..39b7979bc9072c581aacf3e52926dbfe199d0ef3 100644 (file)
--- a/handler.c
+++ b/handler.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1996-2000,2002 Michael R. Elkins <me@mutt.org>
+ * Copyright (C) 1996-2000,2002,2010 Michael R. Elkins <me@mutt.org>
  * 
  *     This program is free software; you can redistribute it and/or modify
  *     it under the terms of the GNU General Public License as published by
@@ -1550,7 +1550,7 @@ int mutt_body_handler (BODY *b, STATE *s)
        */
       if ((WithCrypto & APPLICATION_PGP) && mutt_is_application_pgp (b))
        handler = crypt_pgp_application_pgp_handler;
-      else if (ascii_strcasecmp ("flowed", mutt_get_parameter ("format", b->parameter)) == 0)
+      else if (option(OPTREFLOWTEXT) && ascii_strcasecmp ("flowed", mutt_get_parameter ("format", b->parameter)) == 0)
        handler = rfc3676_handler;
       else
        handler = text_plain_handler;
diff --git a/init.h b/init.h
index ab262f141504da15c6f9e322565848fb28b34c51..8ff7a29849567645027c8e03810de971c469b2b5 100644 (file)
--- a/init.h
+++ b/init.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1996-2002,2007 Michael R. Elkins <me@mutt.org>
+ * Copyright (C) 1996-2002,2007,2010 Michael R. Elkins <me@mutt.org>
  * Copyright (C) 2004 g10 Code GmbH
  *
  *     This program is free software; you can redistribute it and/or modify
@@ -2282,6 +2282,27 @@ struct option_t MuttVars[] = {
   ** The value of \fI$$record\fP is overridden by the $$force_name and
   ** $$save_name variables, and the ``$fcc-hook'' command.
   */
+  { "reflow_text",     DT_BOOL, R_NONE, OPTREFLOWTEXT, 1 },
+  /*
+  ** .pp
+  ** When \fIset\fP, Mutt will reformat paragraphs in text/plain
+  ** parts marked format=flowed.  If \fIunset\fP, Mutt will display paragraphs
+  ** unaltered from how they appear in the message body.  See RFC3676 for
+  ** details on the \fIformat=flowed\fP format.
+  ** .pp
+  ** Also see $$reflow_wrap, and $$wrap.
+  */
+  { "reflow_wrap",     DT_NUM, R_NONE, UL &ReflowWrap, 78 },
+  /*
+  ** .pp
+  ** This variable controls the maximum paragraph width when reformatting text/plain
+  ** parts when $$reflow_text is \fIset\fP.  When the value is 0, paragraphs will
+  ** be wrapped at the terminal's right margin.  A positive value sets the
+  ** paragraph width relative to the left margin.  A negative value set the
+  ** paragraph width relative to the right margin.
+  ** .pp
+  ** Also see $$wrap.
+  */
   { "reply_regexp",    DT_RX,   R_INDEX|R_RESORT, UL &ReplyRegexp, UL "^(re([\\[0-9\\]+])*|aw):[ \t]*" },
   /*
   ** .pp
@@ -3320,6 +3341,8 @@ struct option_t MuttVars[] = {
   ** When set to a negative value, mutt will wrap text so that there are $$wrap
   ** characters of empty space on the right side of the terminal. Setting it
   ** to zero makes mutt wrap at the terminal width.
+  ** .pp
+  ** Also see $$reflow_wrap.
   */
   { "wrap_headers",     DT_NUM,  R_PAGER, UL &WrapHeaders, 78 },
   /*
diff --git a/mutt.h b/mutt.h
index 578d1118d74e69c78cef84bd63133fb7ab0cc539..f7a024e54a556a1329d4bdef18a868747e9f8d90 100644 (file)
--- a/mutt.h
+++ b/mutt.h
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (C) 1996-2002 Michael R. Elkins <me@mutt.org>
+ * Copyright (C) 1996-2002, 2010 Michael R. Elkins <me@mutt.org>
  * Copyright (C) 2004 g10 Code GmbH
  * 
  *     This program is free software; you can redistribute it and/or modify
@@ -409,6 +409,7 @@ enum
   OPTPRINTSPLIT,
   OPTPROMPTAFTER,
   OPTREADONLY,
+  OPTREFLOWTEXT,
   OPTREPLYSELF,
   OPTRESOLVE,
   OPTREVALIAS,
index fdb43e13e92dac6c4e786639c70be1bcd55fd24b..10cf105cbfaad9fafbd777c61fd4a7ac50106a74 100644 (file)
--- a/rfc3676.c
+++ b/rfc3676.c
@@ -2,6 +2,7 @@
  * Copyright (C) 2005 Andreas Krennmair <ak@synflood.at>
  * Copyright (C) 2005 Peter J. Holzer <hjp@hjp.net>
  * Copyright (C) 2005-9 Rocco Rutte <pdmef@gmx.net>
+ * Copyright (C) 2010 Michael R. Elkins <me@mutt.org>
  * 
  *     This program is free software; you can redistribute it and/or modify
  *     it under the terms of the GNU General Public License as published by
@@ -101,7 +102,7 @@ static void flush_par (STATE *s, flowed_state_t *fst)
  * for the prefix from the terminal width. */
 static int quote_width (STATE *s, int ql)
 {
-  int width = mutt_term_width (Wrap);
+  int width = mutt_term_width (ReflowWrap);
   if (option(OPTTEXTFLOWED) && (s->flags & M_REPLYING))
   {
     /* When replying, force a wrap at FLOWED_MAX to comply with RFC3676