]> git.pld-linux.org Git - packages/mutt.git/blob - mutt-vvv.quote.patch
- updated to 2.1.4
[packages/mutt.git] / mutt-vvv.quote.patch
1 diff -urNp -x '*.orig' mutt-2.0.6.org/PATCHES mutt-2.0.6/PATCHES
2 --- mutt-2.0.6.org/PATCHES      2020-06-24 23:41:42.000000000 +0200
3 +++ mutt-2.0.6/PATCHES  2021-04-18 19:23:37.740004690 +0200
4 @@ -0,0 +1 @@
5 +vvv.quote
6 diff -urNp -x '*.orig' mutt-2.0.6.org/handler.c mutt-2.0.6/handler.c
7 --- mutt-2.0.6.org/handler.c    2021-03-06 20:06:37.000000000 +0100
8 +++ mutt-2.0.6/handler.c        2021-04-18 19:23:37.740004690 +0200
9 @@ -1603,7 +1603,31 @@ static int text_plain_handler (BODY *b,
10         buf[--l] = 0;
11      }
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;
22 +
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 @@ -1806,7 +1830,7 @@ int mutt_body_handler (BODY *b, STATE *s
43         */
44        if ((WithCrypto & APPLICATION_PGP) && mutt_is_application_pgp (b))
45         encrypted_handler = handler = crypt_pgp_application_pgp_handler;
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)
48         handler = rfc3676_handler;
49        else
50         handler = text_plain_handler;
51 diff -urNp -x '*.orig' mutt-2.0.6.org/init.h mutt-2.0.6/init.h
52 --- mutt-2.0.6.org/init.h       2021-04-18 19:23:37.610002974 +0200
53 +++ mutt-2.0.6/init.h   2021-04-18 19:23:37.740004690 +0200
54 @@ -2966,6 +2966,19 @@ struct option_t MuttVars[] = {
55    ** have no effect, and if it is set to \fIask-yes\fP or \fIask-no\fP, you are
56    ** prompted for confirmation when you try to quit.
57    */
58 +  { "quote_empty",     DT_BOOL, R_NONE, OPTQUOTEEMPTY, 1 },
59 +  /*
60 +  ** .pp
61 +  ** Controls whether or not empty lines will be quoted using
62 +  ** ``$indent_string''.
63 +  */
64 +  { "quote_quoted",    DT_BOOL, R_NONE, OPTQUOTEQUOTED, 0 },
65 +  /*
66 +  ** .pp
67 +  ** Controls how quoted lines will be quoted. If set, one quote
68 +  ** character will be added to the end of existing prefix.  Otherwise,
69 +  ** quoted lines will be prepended by ``$indent_string''.
70 +  */
71    { "quote_regexp",    DT_RX,   R_PAGER, {.p=&QuoteRegexp}, {.p="^([ \t]*[|>:}#])+"} },
72    /*
73    ** .pp
74 diff -urNp -x '*.orig' mutt-2.0.6.org/mutt.h mutt-2.0.6/mutt.h
75 --- mutt-2.0.6.org/mutt.h       2021-03-06 20:06:37.000000000 +0100
76 +++ mutt-2.0.6/mutt.h   2021-04-18 19:23:37.740004690 +0200
77 @@ -510,6 +510,8 @@ enum
78    OPTPRINTDECODEWEED,
79    OPTPRINTSPLIT,
80    OPTPROMPTAFTER,
81 +  OPTQUOTEEMPTY,
82 +  OPTQUOTEQUOTED,
83    OPTREADONLY,
84    OPTREFLOWSPACEQUOTES,
85    OPTREFLOWTEXT,
This page took 0.036799 seconds and 4 git commands to generate.