From: Michael Elkins Date: Wed, 29 Sep 2010 21:17:24 +0000 (-0700) Subject: Add $reflow_text boolean, and $reflow_wrap variables to control display of format... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=74a43ec38c80bfa7a6a589b549d0327a60819d5a;p=mutt Add $reflow_text boolean, and $reflow_wrap variables to control display of format=flowed text parts. --- diff --git a/globals.h b/globals.h index 62d831d7..5aec5300 100644 --- a/globals.h +++ b/globals.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 1996-2002 Michael R. Elkins + * Copyright (C) 1996-2002, 2010 Michael R. Elkins * * 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); diff --git a/handler.c b/handler.c index a45fbab6..39b7979b 100644 --- a/handler.c +++ b/handler.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1996-2000,2002 Michael R. Elkins + * Copyright (C) 1996-2000,2002,2010 Michael R. Elkins * * 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 ab262f14..8ff7a298 100644 --- a/init.h +++ b/init.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 1996-2002,2007 Michael R. Elkins + * Copyright (C) 1996-2002,2007,2010 Michael R. Elkins * 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 578d1118..f7a024e5 100644 --- a/mutt.h +++ b/mutt.h @@ -1,6 +1,6 @@ /* - * Copyright (C) 1996-2002 Michael R. Elkins + * Copyright (C) 1996-2002, 2010 Michael R. Elkins * 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, diff --git a/rfc3676.c b/rfc3676.c index fdb43e13..10cf105c 100644 --- a/rfc3676.c +++ b/rfc3676.c @@ -2,6 +2,7 @@ * Copyright (C) 2005 Andreas Krennmair * Copyright (C) 2005 Peter J. Holzer * Copyright (C) 2005-9 Rocco Rutte + * Copyright (C) 2010 Michael R. Elkins * * 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