Re: [PATCH] to improve the rendering of format=flowed quoted text
Hello Gary, and happy new year to you all!
On Monday, December 29, 2003 at 10:12:30 PM -0800, Gary Johnson wrote:
> Attached is a patch for mutt-1.4i to improve the rendering of
> format=flowed quoted text by space-stuffing all quoted lines.
Thanks, small and very nice. It changed my mind about flowed format
(I considered evil so far).
May I suggest adding a little sophistication, so spaces are not
added in situations where they have no visual nor functional effect (as
empty or TAB-beginning lines), and before the external quote pipe
symbol? AFAICS it's 2646-compliant. Like adding to conditions:
&& *cont && *cont != '|' && (*cont != '\t' || level % 8 == 7)
The level calculation is for cases where "<Space><Tab>" and "<Tab>"
are different visually, to preserve identation with other non-TAB lines
at same quote level. Suggested *.2 attached.
> This behavior is controlled by a new boolean option,
> 'stuff_all_quoted'. When unset (the default), mutt's behavior is the
> same as without the patch.
Is an option really necessary? I mean: Given the choice, would a
significant amount of users choose the ugly unreadable old behaviour?
It's a real question: I don't know the answer. I only know that me, as a
user, I'd definitely choose permanently the new one and would just try
to forget the dark ages.
The $stuff_all_quoted option name is perfectly clear for anyone
familiar with the code and the RFC 2646. But seems to me a little
confusing and cryptic for users. No suggestions, but $flowed_quote_space
or $flowed_airing or something like that. Needs to be a more "visible
feature" oriented name than internal variables.
Bye! Alain.
--
Mutt users break quotes readability for everyone else on a mailing list!
They should stop doing so immediately!
« Flowed text considered HARMFUL » PCC CB on MU. © June 2002
--- PATCHES.orig 2003-02-25 07:06:57.000000000 -0800
+++ PATCHES 2003-12-28 02:33:50.000000000 -0800
@@ -1,0 +1 @@
+patch-1.4.gj.stuff_all_quoted.2
--- handler.c.orig 2003-02-25 07:06:53.000000000 -0800
+++ handler.c 2003-12-28 01:19:07.000000000 -0800
@@ -935,7 +935,14 @@
*/
if (*cont && !level && !mutt_strcmp (Pager, "builtin") &&
flowed_maybe_quoted (cont))
state_puts ("\033[0m",s);
+
+ if (level && option (OPTSTUFFALLQUOTED) && *cont && *cont != '|'
+ && (*cont != '\t' || level % 8 == 7))
+ state_putc (' ', s);
}
+ else if (level && option (OPTSTUFFALLQUOTED) && *cont && *cont != '|'
+ && (*cont != '\t' || level % 8 == 7))
+ state_putc (' ', s);
else if ((*cont == ' ') || (*cont == '>') || (!level && !mutt_strncmp (cont,
"From ", 5)))
state_putc (' ', s);
}
--- init.h.orig 2003-02-25 07:06:56.000000000 -0800
+++ init.h 2003-12-29 01:14:31.000000000 -0800
@@ -2191,6 +2191,17 @@
** personal mailbox where you might have several unrelated messages with
** the subject ``hi'' which will get grouped together.
*/
+ { "stuff_all_quoted", DT_BOOL, R_NONE, OPTSTUFFALLQUOTED, 0 },
+ /*
+ ** .pp
+ ** When set, mutt will space-stuff all quoted lines in displayed and
+ ** generated text/plain; format=flowed attachments, as allowed by RFC
+ ** 2646. This makes the quoting of format=flowed text more consistent
+ ** with the quoting style traditionally used for format=fixed text.
+ ** The quoted text is easier to read and is recognizable by the
+ ** default ``$$quote_regexp''. When unset, mutt will space-stuff
+ ** quoted lines only as required by RFC 2646.
+ */
{ "suspend", DT_BOOL, R_NONE, OPTSUSPEND, 1 },
/*
** .pp
--- mutt.h.orig 2003-02-25 07:06:56.000000000 -0800
+++ mutt.h 2003-12-28 01:04:59.000000000 -0800
@@ -394,6 +394,7 @@
OPTSTATUSONTOP,
OPTSTRICTTHREADS,
OPTSUSPEND,
+ OPTSTUFFALLQUOTED,
OPTTEXTFLOWED,
OPTTHOROUGHSRC,
OPTTHREADRECEIVED,