1 diff -udprP mutt-1.5.19.orig/globals.h mutt-1.5.19/globals.h
2 --- mutt-1.5.19.orig/globals.h 2009-01-04 01:27:10.000000000 +0200
3 +++ mutt-1.5.19/globals.h 2009-01-06 19:40:35.000000000 +0200
4 @@ -24,6 +24,8 @@ WHERE CONTEXT *Context;
5 WHERE char Errorbuf[STRING];
6 WHERE char AttachmentMarker[STRING];
8 +WHERE char Quotebuf[SHORT_STRING];
10 #if defined(DL_STANDALONE) && defined(USE_DOTLOCK)
11 WHERE char *MuttDotlock;
13 diff -udprP mutt-1.5.19.orig/handler.c mutt-1.5.19/handler.c
14 --- mutt-1.5.19.orig/handler.c 2009-01-05 21:20:53.000000000 +0200
15 +++ mutt-1.5.19/handler.c 2009-01-06 19:40:35.000000000 +0200
16 @@ -90,6 +90,8 @@ static void mutt_convert_to_state(iconv_
18 state_prefix_put (bufo, ob - bufo, s);
20 + if (Quotebuf[0] != '\0')
21 + state_prefix_putc ('\n', s);
25 @@ -1473,6 +1475,8 @@ void mutt_decode_attachment (BODY *b, ST
26 int istext = mutt_is_text_part (b);
27 iconv_t cd = (iconv_t)(-1);
31 if (istext && s->flags & M_CHARCONV)
33 char *charset = mutt_get_parameter ("charset", b->parameter);
34 @@ -1542,7 +1546,7 @@ int mutt_body_handler (BODY *b, STATE *s
36 if ((WithCrypto & APPLICATION_PGP) && mutt_is_application_pgp (b))
37 handler = crypt_pgp_application_pgp_handler;
38 - else if (ascii_strcasecmp ("flowed", mutt_get_parameter ("format", b->parameter)) == 0)
39 + else if (ascii_strcasecmp ("flowed", mutt_get_parameter ("format", b->parameter)) == 0 && !s->prefix)
40 handler = rfc3676_handler;
43 diff -udprP mutt-1.5.19.orig/init.h mutt-1.5.19/init.h
44 --- mutt-1.5.19.orig/init.h 2009-01-05 21:20:53.000000000 +0200
45 +++ mutt-1.5.19/init.h 2009-01-06 19:40:35.000000000 +0200
46 @@ -2451,6 +2451,19 @@ struct option_t MuttVars[] = {
47 ** have no effect, and if it is set to \fIask-yes\fP or \fIask-no\fP, you are
48 ** prompted for confirmation when you try to quit.
50 + { "quote_empty", DT_BOOL, R_NONE, OPTQUOTEEMPTY, 1 },
53 + ** Controls whether or not empty lines will be quoted using
54 + ** ``$indent_string''.
56 + { "quote_quoted", DT_BOOL, R_NONE, OPTQUOTEQUOTED, 0 },
59 + ** Controls how quoted lines will be quoted. If set, one quote
60 + ** character will be added to the end of existing prefix. Otherwise,
61 + ** quoted lines will be prepended by ``$indent_string''.
63 { "quote_regexp", DT_RX, R_PAGER, UL &QuoteRegexp, UL "^([ \t]*[|>:}#])+" },
66 diff -udprP mutt-1.5.19.orig/mutt.h mutt-1.5.19/mutt.h
67 --- mutt-1.5.19.orig/mutt.h 2008-09-26 01:00:03.000000000 +0300
68 +++ mutt-1.5.19/mutt.h 2009-01-06 19:40:35.000000000 +0200
69 @@ -398,6 +398,8 @@ enum
78 diff -udprP mutt-1.5.19.orig/muttlib.c mutt-1.5.19/muttlib.c
79 --- mutt-1.5.19.orig/muttlib.c 2009-01-05 21:20:53.000000000 +0200
80 +++ mutt-1.5.19/muttlib.c 2009-01-06 19:40:35.000000000 +0200
81 @@ -1497,15 +1497,45 @@ void state_prefix_putc (char c, STATE *s
83 if (s->flags & M_PENDINGPREFIX)
85 - state_reset_prefix (s);
87 - state_puts (s->prefix, s);
92 + i = strlen (Quotebuf);
95 + if (i == sizeof (Quotebuf) - 1 || c == '\n')
97 + char buf[2 * SHORT_STRING];
98 + int j = 0, offset = 0;
99 + regmatch_t pmatch[1];
101 + state_reset_prefix (s);
102 + while (regexec ((regex_t *) QuoteRegexp.rx, &Quotebuf[offset], 1, pmatch, 0) == 0)
103 + offset += pmatch->rm_eo;
105 + if (!option (OPTQUOTEEMPTY) && Quotebuf[0] == '\n')
106 + strcpy (buf, Quotebuf);
107 + else if (option (OPTQUOTEQUOTED) && offset)
109 + for (i = 0; i < offset; i++)
110 + if (Quotebuf[i] != ' ')
112 + strncpy (buf, Quotebuf, j + 1);
113 + strcpy (buf + j + 1, Quotebuf + j);
116 + snprintf (buf, sizeof (buf), "%s%s", NONULL(s->prefix), Quotebuf);
118 + state_puts (buf, s);
126 state_set_prefix (s);
127 + Quotebuf[0] = '\0';
131 int state_printf (STATE *s, const char *fmt, ...)
132 diff -udprP mutt-1.5.19.orig/PATCHES mutt-1.5.19/PATCHES
133 --- mutt-1.5.19.orig/PATCHES 2008-03-19 22:07:06.000000000 +0200
134 +++ mutt-1.5.19/PATCHES 2009-01-06 19:40:35.000000000 +0200