</sect3>
+<sect3 id="ff-pager">
+<title>Support for viewing and non-flowed replies</title>
+
+<para>
+ Mutt has some support for viewing and replying to
+ <literal>format=flowed</literal> messages. In order to take advantage of these,
+ <link linkend="reflow-text">$reflow_text</link> must be set.
+</para>
+
+<itemizedlist>
+ <listitem>
+ <para>
+ Paragraphs are automatically reflowed and wrapped at a width specified
+ by <link linkend="reflow-wrap">$reflow_wrap</link>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ By default, the quoting style of <literal>format=flowed</literal>
+ messages can be difficult to read, and doesn't intermix well with
+ non-flowed replies.
+ Setting <link linkend="reflow-space-quotes">$reflow_space_quotes</link>
+ adds spaces after each level of quoting when in the pager and
+ replying in a non-flowed format
+ (i.e. with <link linkend="text-flowed">$text_flowed</link> unset).
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ If <link linkend="reflow-space-quotes">$reflow_space_quotes</link>
+ is unset, mutt will still add one trailing space after all the
+ quotes in the pager (but not when replying).
+ </para>
+ </listitem>
+</itemizedlist>
+
+</sect3>
+
</sect2>
</sect1>
** The value of \fI$$record\fP is overridden by the $$force_name and
** $$save_name variables, and the ``$fcc-hook'' command.
*/
+ { "reflow_space_quotes", DT_BOOL, R_NONE, OPTREFLOWSPACEQUOTES, 1 },
+ /*
+ ** .pp
+ ** This option controls how quotes from format=flowed messages are displayed
+ ** in the pager and when replying (with $$text_flowed \fIunset\fP).
+ ** When set, this option adds spaces after each level of quote marks, turning
+ ** ">>>foo" into "> > > foo".
+ ** .pp
+ ** \fBNote:\fP If $$reflow_text is \fIunset\fP, this option has no effect.
+ ** Also, this option does not affect replies when $$text_flowed is \fIset\fP.
+ */
{ "reflow_text", DT_BOOL, R_NONE, OPTREFLOWTEXT, 1 },
/*
** .pp
return quoted;
}
-static size_t print_indent (int ql, STATE *s, int sp)
+/* Determines whether to add spacing between/after each quote level:
+ * >>>foo
+ * becomes
+ * > > > foo
+ */
+static int space_quotes (STATE *s)
+{
+ /* Allow quote spacing in the pager even for OPTTEXTFLOWED,
+ * but obviously not when replying.
+ */
+ if (option (OPTTEXTFLOWED) && (s->flags & M_REPLYING))
+ return 0;
+
+ return option (OPTREFLOWSPACEQUOTES);
+}
+
+/* Determines whether to add a trailing space to quotes:
+ * >>> foo
+ * as opposed to
+ * >>>foo
+ */
+static int add_quote_suffix (STATE *s, int ql)
+{
+ if (s->flags & M_REPLYING)
+ return 0;
+
+ if (space_quotes (s))
+ return 0;
+
+ if (!ql && !s->prefix)
+ return 0;
+
+ /* The prefix will add its own space */
+ if (!option (OPTTEXTFLOWED) && !ql && s->prefix)
+ return 0;
+
+ return 1;
+}
+
+static size_t print_indent (int ql, STATE *s, int add_suffix)
{
int i;
size_t wid = 0;
{
state_puts (s->prefix, s);
wid = mutt_strwidth (s->prefix);
- sp = 0;
}
}
for (i = 0; i < ql; i++)
+ {
state_putc ('>', s);
- if (sp)
+ if (space_quotes (s) )
+ state_putc (' ', s);
+ }
+ if (add_suffix)
state_putc (' ', s);
- return ql + sp + wid;
+
+ if (space_quotes (s))
+ ql *= 2;
+
+ return ql + add_suffix + wid;
}
static void flush_par (STATE *s, flowed_state_t *fst)
++ql; /* When replying, we will add an additional quote level */
}
/* adjust the paragraph width subtracting the number of prefix chars */
- width -= ql;
- /* When displaying (not replying), there will be a space between the prefix
+ width -= space_quotes (s) ? ql*2 : ql;
+ /* When displaying (not replying), there may be a space between the prefix
* string and the paragraph */
- if ((s->flags & M_REPLYING) == 0 && ql > 0)
+ if (add_quote_suffix (s, ql))
--width;
/* failsafe for really long quotes */
if (width <= 0)
}
if (!words && !fst->width)
- fst->width = print_indent (ql, s, !(s->flags & M_REPLYING) &&
- (ql > 0 || s->prefix));
+ fst->width = print_indent (ql, s, add_quote_suffix (s, ql));
fst->width += w + fst->spaces;
for ( ; fst->spaces; fst->spaces--)
state_putc (' ', s);
static void print_fixed_line (const char *line, STATE *s, int ql,
flowed_state_t *fst)
{
- print_indent (ql, s, !(s->flags & M_REPLYING) && (ql > 0 || s->prefix));
+ print_indent (ql, s, add_quote_suffix (s, ql));
if (line && *line)
state_puts (line, s);
state_putc ('\n', s);