]> git.pld-linux.org Git - packages/mutt.git/blame - mutt-vvv.quote.patch
Up to 2.0.6.
[packages/mutt.git] / mutt-vvv.quote.patch
CommitLineData
32845784
AG
1diff -udprP mutt-1.12.1.orig/PATCHES mutt-1.12.1/PATCHES
2--- mutt-1.12.1.orig/PATCHES 2017-12-03 05:10:17.000000000 +0200
3+++ mutt-1.12.1/PATCHES 2019-08-11 19:32:51.176165992 +0300
4@@ -0,0 +1 @@
5+vvv.quote
6diff -udprP mutt-1.12.1.orig/handler.c mutt-1.12.1/handler.c
7--- mutt-1.12.1.orig/handler.c 2019-05-31 19:21:33.000000000 +0300
8+++ mutt-1.12.1/handler.c 2019-08-11 19:32:51.177165977 +0300
9@@ -1593,7 +1593,31 @@ static int text_plain_handler (BODY *b,
10 buf[--l] = 0;
95768aa9 11 }
32845784
AG
12 if (s->prefix)
13- state_puts (s->prefix, s);
14+ {
15+ int i;
16+ char qbuf[2 * LONG_STRING];
17+ int j = 0, offset = 0;
18+ regmatch_t pmatch[1];
19+
20+ while (regexec ((regex_t *) QuoteRegexp.rx, &buf[offset], 1, pmatch, 0) == 0)
21+ offset += pmatch->rm_eo;
95768aa9 22+
32845784
AG
23+ if (!option (OPTQUOTEEMPTY) && !*buf)
24+ strcpy (qbuf, buf);
25+ else if (option (OPTQUOTEQUOTED) && offset)
26+ {
27+ for (i = 0; i < offset; i++)
28+ if (buf[i] != ' ')
29+ j = i;
30+ strncpy (qbuf, buf, j + 1);
31+ strcpy (qbuf + j + 1, buf + j);
32+ }
33+ else
34+ snprintf (qbuf, sizeof (qbuf), "%s%s", NONULL(s->prefix), buf);
35+
36+ state_puts (qbuf, s);
37+ }
38+ else
39 state_puts (buf, s);
40 state_putc ('\n', s);
41 }
42@@ -1779,7 +1803,7 @@ int mutt_body_handler (BODY *b, STATE *s
bebcbf73
AG
43 */
44 if ((WithCrypto & APPLICATION_PGP) && mutt_is_application_pgp (b))
458d46c4 45 encrypted_handler = handler = crypt_pgp_application_pgp_handler;
c59ea3a3
KK
46- else if (option(OPTREFLOWTEXT) && ascii_strcasecmp ("flowed", mutt_get_parameter ("format", b->parameter)) == 0)
47+ else if (option(OPTREFLOWTEXT) && ascii_strcasecmp ("flowed", mutt_get_parameter ("format", b->parameter)) == 0 && !s->prefix)
bebcbf73
AG
48 handler = rfc3676_handler;
49 else
c59ea3a3 50 handler = text_plain_handler;
8d013520
PZ
51--- mutt-2.0.6/init.h.orig 2021-04-07 17:27:35.690778943 +0000
52+++ mutt-2.0.6/init.h 2021-04-07 17:29:10.704113619 +0000
53@@ -2966,6 +2966,19 @@
bebcbf73 54 ** have no effect, and if it is set to \fIask-yes\fP or \fIask-no\fP, you are
95768aa9 55 ** prompted for confirmation when you try to quit.
56 */
8d013520 57+ { "quote_empty", DT_BOOL, R_NONE, OPTQUOTEEMPTY, 1 },
95768aa9 58+ /*
59+ ** .pp
60+ ** Controls whether or not empty lines will be quoted using
61+ ** ``$indent_string''.
62+ */
8d013520 63+ { "quote_quoted", DT_BOOL, R_NONE, OPTQUOTEQUOTED, 0 },
95768aa9 64+ /*
65+ ** .pp
66+ ** Controls how quoted lines will be quoted. If set, one quote
67+ ** character will be added to the end of existing prefix. Otherwise,
68+ ** quoted lines will be prepended by ``$indent_string''.
69+ */
8d013520 70 { "quote_regexp", DT_RX, R_PAGER, {.p=&QuoteRegexp}, {.p="^([ \t]*[|>:}#])+"} },
95768aa9 71 /*
72 ** .pp
32845784
AG
73diff -udprP mutt-1.12.1.orig/mutt.h mutt-1.12.1/mutt.h
74--- mutt-1.12.1.orig/mutt.h 2019-06-14 04:29:29.000000000 +0300
75+++ mutt-1.12.1/mutt.h 2019-08-11 19:32:51.179165947 +0300
76@@ -479,6 +479,8 @@ enum
95768aa9 77 OPTPRINTDECODE,
78 OPTPRINTSPLIT,
79 OPTPROMPTAFTER,
80+ OPTQUOTEEMPTY,
81+ OPTQUOTEQUOTED,
82 OPTREADONLY,
32845784
AG
83 OPTREFLOWSPACEQUOTES,
84 OPTREFLOWTEXT,
This page took 0.046624 seconds and 4 git commands to generate.