diff --git a/alpine-2.20.tar.xz b/alpine-2.20.tar.xz deleted file mode 100644 index 84eb67d..0000000 --- a/alpine-2.20.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ed639b6e5bb97e6b0645c85262ca6a784316195d461ce8d8411999bf80449227 -size 4841816 diff --git a/alpine-2.21.tar.xz b/alpine-2.21.tar.xz new file mode 100644 index 0000000..098ecee --- /dev/null +++ b/alpine-2.21.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6030b6881b8168546756ab3a5e43628d8d564539b0476578e287775573a77438 +size 4720856 diff --git a/alpine-no-add-needed.patch b/alpine-no-add-needed.patch deleted file mode 100644 index 7188b53..0000000 --- a/alpine-no-add-needed.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- - alpine/Makefile.am | 2 +- - configure.ac | 3 ++- - 2 files changed, 3 insertions(+), 2 deletions(-) - -Index: alpine-2.11/alpine/Makefile.am -=================================================================== ---- alpine-2.11.orig/alpine/Makefile.am -+++ alpine-2.11/alpine/Makefile.am -@@ -35,7 +35,7 @@ BUILT_SOURCES = date.c - LDADD = ../pico/libpico.a ../pico/osdep/libpicoosd.a \ - ../pith/libpith.a ../pith/osdep/libpithosd.a \ - ../pith/charconv/libpithcc.a \ -- osdep/libpineosd.a ../c-client/c-client.a -+ osdep/libpineosd.a ../c-client/c-client.a -lkrb5 -lcrypto - - AM_CPPFLAGS = -I@top_builddir@/include -I@top_srcdir@/include -DLOCALEDIR=\"$(localedir)\" - -Index: alpine-2.11/configure.ac -=================================================================== ---- alpine-2.11.orig/configure.ac -+++ alpine-2.11/configure.ac -@@ -38,8 +38,9 @@ WEB_BUILD=web/src/alpined.d - - dnl CHECK PROGRAMS - --AC_PROG_CC - AC_PROG_CC_STDC -+AC_USE_SYSTEM_EXTENSIONS -+AC_SYS_LARGEFILE - AC_PROG_INSTALL - AC_PROG_MAKE_SET - AC_PROG_LN_S diff --git a/alpine-timestamp.patch b/alpine-timestamp.patch index a1886f9..98c3756 100644 --- a/alpine-timestamp.patch +++ b/alpine-timestamp.patch @@ -1,24 +1,3 @@ ---- - alpine/Makefile | 4 ++-- - alpine/Makefile.am | 4 ++-- - alpine/Makefile.in | 4 ++-- - 3 files changed, 6 insertions(+), 6 deletions(-) - -Index: alpine-2.20/alpine/Makefile -=================================================================== ---- alpine-2.20.orig/alpine/Makefile -+++ alpine-2.20/alpine/Makefile -@@ -888,8 +888,8 @@ uninstall-am: uninstall-binPROGRAMS - - - date.c: -- echo "char datestamp[]="\"`date`\"";" > date.c -- echo "char hoststamp[]="\"`hostname`\"";" >> date.c -+ echo 'char datestamp[]="today";' > date.c -+ echo 'char hoststamp[]="sand";' >> date.c - - # Tell versions [3.59,3.63) of GNU make to not export all variables. - # Otherwise a system limit (for SysV at least) may be exceeded. Index: alpine-2.20/alpine/Makefile.am =================================================================== --- alpine-2.20.orig/alpine/Makefile.am diff --git a/alpine.changes b/alpine.changes index cb0d639..2105b48 100644 --- a/alpine.changes +++ b/alpine.changes @@ -1,3 +1,33 @@ +------------------------------------------------------------------- +Tue Mar 21 21:21:06 UTC 2017 - opensuse@dstoecker.de + +- add chappa patch to add own rules (chappa-rules.patch) +- add chappa patch to change from header (chappa-fromheader.patch) +- add chappa patch to better justify paragraphs (chappa-fillpara.patch) +- drop empty lint.diff + +------------------------------------------------------------------- +Tue Mar 21 15:31:10 UTC 2017 - max@suse.com + +- New version 2.21: + * New SHORTSUBJECT, SHORTSUBJKEY and SHORTSUBJKEYINIT token for + index format + * New SMARTTIME24 token for index screen. + * Added support for RFC 2971 - IMAP ID extension. + * SMIME: Upgrade the default signature digest from SHA-1 to + SHA-256. + * SMIME: Turn off automatic signing and encrypting of a message + when bouncing. + * The complete change list can be viewed by pressing "R" + in the Alpine main menu. +- Updated "Chappa" patches to the latest version. +- Obsolete patches: + * alpine-no-add-needed.patch + * chappa-ignoresize.patch + * chappa-unixnullbug.patch + * pico-stripwhitespace.diff + * pine-nonvoid-function.patch + ------------------------------------------------------------------- Mon Apr 4 14:18:00 CEST 2016 - kukuk@suse.de diff --git a/alpine.spec b/alpine.spec index bf286d3..0725448 100644 --- a/alpine.spec +++ b/alpine.spec @@ -1,7 +1,7 @@ # # spec file for package alpine # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -22,7 +22,7 @@ Name: alpine Summary: Mail User Agent License: Apache-2.0 Group: Productivity/Networking/Email/Clients -Version: 2.20 +Version: 2.21 Release: 0 Url: http://patches.freeiz.com/alpine/ @@ -31,7 +31,6 @@ Url: http://patches.freeiz.com/alpine/ Source: %name-%version.tar.xz Source1: %name.png Source2: %name.desktop -Patch1: pine-nonvoid-function.patch Patch2: make-use-of-strncat-safer.diff Patch3: operation-may-be-undefined-warning.diff Patch4: fix-implicit.patch @@ -39,21 +38,19 @@ Patch5: alpine-gcc44.diff Patch6: alpine-timestamp.patch Patch10: pico-fix-spurious-undef-warnings.diff Patch20: pine-expression-warnings.diff -Patch40: pico-stripwhitespace.diff Patch60: signal-and-panic-improvements.diff -Patch61: lint.diff # # Eduardo Chappa's patches. # http://patches.freeiz.com/alpine/ # Patch600: chappa-colortext.patch Patch601: chappa-fancy.patch -Patch602: chappa-ignoresize.patch Patch603: chappa-insertpat.patch Patch604: chappa-maildir.patch Patch605: chappa-WrtAcc.patch -Patch606: chappa-unixnullbug.patch -Patch613: alpine-no-add-needed.patch +Patch614: chappa-fillpara.patch +Patch615: chappa-fromheader.patch +Patch616: chappa-rules.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: autoconf >= 2.69 BuildRequires: imap-devel @@ -121,16 +118,15 @@ fi # %patch600 -p1 %patch601 -p1 -%patch602 -p1 %patch603 -p1 %patch604 -p1 %patch605 -p1 -%patch606 -p1 -%patch613 -p1 +%patch614 -p1 +%patch615 -p1 +%patch616 -p1 # # SuSE patches - warning fixes, etc: # -%patch1 -p1 %patch2 -p1 %patch3 -p1 %patch4 -p1 @@ -138,9 +134,7 @@ fi %patch6 -p1 %patch10 -p1 %patch20 -p1 -%patch40 -p1 %patch60 -p1 -%patch61 -p1 %endif # End of "if !{build_vanilla}" %build @@ -214,7 +208,7 @@ install -D -m644 %{SOURCE2} $RPM_BUILD_ROOT/usr/share/applications/%name.desktop ln -sf alpine $RPM_BUILD_ROOT%{_bindir}/pine : install -m755 pico/{pico,pilot} $RPM_BUILD_ROOT%{_bindir} -install -m644 doc/{pico.1,pilot.1} $RPM_BUILD_ROOT%{_mandir}/man1/ +install -m644 doc/man1/{pico.1,pilot.1} $RPM_BUILD_ROOT%{_mandir}/man1/ %check #since where are no logs in the package at the moment, there are no checks, diff --git a/chappa-WrtAcc.patch b/chappa-WrtAcc.patch index 2cfb520..3eda2b8 100644 --- a/chappa-WrtAcc.patch +++ b/chappa-WrtAcc.patch @@ -1,351 +1,354 @@ ---- - pico/basic.c | 183 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - pico/composer.c | 9 ++ - pico/display.c | 7 +- - pico/ebind.h | 8 +- - pico/efunc.h | 3 - pico/main.c | 6 + - pico/search.c | 6 - - 7 files changed, 214 insertions(+), 8 deletions(-) - -Index: alpine-2.20/pico/basic.c -=================================================================== ---- alpine-2.20.orig/pico/basic.c -+++ alpine-2.20/pico/basic.c -@@ -342,6 +342,189 @@ gotobop(int f, int n) - return(TRUE); - } - -+unsigned char GetAccent() -+{ -+ UCS c,d; -+ c = GetKey(); -+ if ((c == '?') || (c == '!')) { -+ d = c; -+ c = '\\'; -+ } -+ else -+ if ((c == 's') || (c == 'S')){ -+ c = d = 's'; -+ } -+ else -+ if ((c == 'l') || (c == 'L')){ -+ c = d = 'l'; -+ } -+ else -+ d = GetKey(); -+ return accent(c,d); -+} -+ -+int pineaccent(f,n) -+ int f,n; -+{ unsigned char e; -+ -+ if (e = GetAccent()) -+ execute(e, 0, 1); -+ return 1; -+} -+ -+unsigned char accent(f,n) -+UCS f,n; -+{ UCS c,d; -+ -+ c = f; -+ d = n; -+ switch(c){ -+ case '~' : -+ switch(d){ -+ case 'a' : return '\343'; -+ case 'n' : return '\361'; -+ case 'o' : return '\365'; -+ case 'A' : return '\303'; -+ case 'N' : return '\321'; -+ case 'O' : return '\325'; -+ } -+ break; -+ case '\047' : -+ switch(d){ -+ case 'a' : return '\341'; -+ case 'e' : return '\351'; -+ case 'i' : return '\355'; -+ case 'o' : return '\363'; -+ case 'u' : return '\372'; -+ case 'y' : return '\375'; -+ case 'A' : return '\301'; -+ case 'E' : return '\311'; -+ case 'I' : return '\315'; -+ case 'O' : return '\323'; -+ case 'U' : return '\332'; -+ case 'Y' : return '\335'; -+ } -+ break; -+ case '"' : -+ switch(d){ -+ case 'a' : return '\344'; -+ case 'e' : return '\353'; -+ case 'i' : return '\357'; -+ case 'o' : return '\366'; -+ case 'u' : return '\374'; -+ case 'y' : return '\377'; -+ case 'A' : return '\304'; -+ case 'E' : return '\313'; -+ case 'I' : return '\317'; -+ case 'O' : return '\326'; -+ case 'U' : return '\334'; -+ } -+ break; -+ case '^' : -+ switch(d){ -+ case 'a' : return '\342'; -+ case 'e' : return '\352'; -+ case 'i' : return '\356'; -+ case 'o' : return '\364'; -+ case 'u' : return '\373'; -+ case 'A' : return '\302'; -+ case 'E' : return '\312'; -+ case 'I' : return '\316'; -+ case 'O' : return '\324'; -+ case 'U' : return '\333'; -+ case '0' : return '\260'; -+ case '1' : return '\271'; -+ case '2' : return '\262'; -+ case '3' : return '\263'; -+ } -+ break; -+ case '`' : -+ switch(d){ -+ case 'a' : return '\340'; -+ case 'e' : return '\350'; -+ case 'i' : return '\354'; -+ case 'o' : return '\362'; -+ case 'u' : return '\371'; -+ case 'A' : return '\300'; -+ case 'E' : return '\310'; -+ case 'I' : return '\314'; -+ case 'O' : return '\322'; -+ case 'U' : return '\331'; -+ } -+ break; -+ case 'o' : -+ switch(d){ -+ case 'a' : return '\345'; -+ case 'A' : return '\305'; -+ case '/' : return '\370'; -+ case 'r' : return '\256'; -+ case 'R' : return '\256'; -+ case 'c' : return '\251'; -+ case 'C' : return '\251'; -+ } -+ break; -+ case '-' : -+ switch(d){ -+ case 'o' : return '\272'; -+ case 'O' : return '\272'; -+ case '0' : return '\272'; -+ case 'a' : return '\252'; -+ case 'A' : return '\252'; -+ case 'l' : return '\243'; -+ case 'L' : return '\243'; -+ } -+ break; -+ case 'O' : -+ switch(d){ -+ case '/' : return '\330'; -+ case 'r' : return '\256'; -+ case 'R' : return '\256'; -+ case 'c' : return '\251'; -+ case 'C' : return '\251'; -+ } -+ case '/' : -+ switch(d){ -+ case 'o' : return '\370'; -+ case 'O' : return '\330'; -+ } -+ break; -+ case 'a' : -+ switch(d){ -+ case 'e' : return '\346'; -+ case 'E' : return '\346'; -+ } -+ break; -+ case 'A' : -+ switch(d){ -+ case 'E' : return '\306'; -+ case 'e' : return '\306'; -+ } -+ break; -+ case ',' : -+ switch(d){ -+ case 'c' : return '\347'; -+ case 'C' : return '\307'; -+ } -+ break; -+ case '\\' : -+ switch(d){ -+ case '?' : return '\277'; -+ case '!' : return '\241'; -+ } -+ break; -+ case 's' : -+ switch(d){ -+ case 's' : return '\337'; -+ } -+ break; -+ case 'l' : -+ switch(d){ -+ case 'l' : return '\243'; -+ } -+ break; +diff -rc alpine-2.21/pico/basic.c alpine-2.21.WrtAcc/pico/basic.c +*** alpine-2.21/pico/basic.c Sun Feb 5 16:02:36 2017 +--- alpine-2.21.WrtAcc/pico/basic.c Sun Feb 5 16:15:24 2017 +*************** +*** 342,347 **** +--- 342,530 ---- + return(TRUE); + } + ++ unsigned char GetAccent() ++ { ++ UCS c,d; ++ c = GetKey(); ++ if ((c == '?') || (c == '!')) { ++ d = c; ++ c = '\\'; ++ } ++ else ++ if ((c == 's') || (c == 'S')){ ++ c = d = 's'; + } -+ return '\0'; -+} - - /* - * go forword to the end of the current paragraph -Index: alpine-2.20/pico/composer.c -=================================================================== ---- alpine-2.20.orig/pico/composer.c -+++ alpine-2.20/pico/composer.c -@@ -2015,7 +2015,7 @@ LineEdit(int allowedit, UCS *lastch) - tbufp = &strng[ods.p_len]; - - if(VALID_KEY(ch)){ /* char input */ -- /* -+insert_char:/* - * if we are allowing editing, insert the new char - * end up leaving tbufp pointing to newly - * inserted character in string, and offset to the -@@ -2095,6 +2095,13 @@ LineEdit(int allowedit, UCS *lastch) - } - else { /* interpret ch as a command */ - switch (ch = normalize_cmd(ch, ckm, 2)) { -+ case (CTRL|'\\') : -+ if (ch = GetAccent()) -+ goto insert_char; -+ else -+ clearcursor(); -+ break; -+ - case (CTRL|KEY_LEFT): /* word skip left */ - if(ods.p_ind > 0) /* Scoot one char left if possible */ - ods.p_ind--; -Index: alpine-2.20/pico/display.c -=================================================================== ---- alpine-2.20.orig/pico/display.c -+++ alpine-2.20/pico/display.c -@@ -1751,6 +1751,11 @@ mlreplyd(UCS *prompt, UCS *buf, int nbuf - b = &buf[ucs4_strlen(buf)]; - continue; - -+ case (CTRL|'\\'): -+ if (c = GetAccent()) -+ goto text; -+ continue; -+ - case (CTRL|'F') : /* CTRL-F forward a char*/ - case KEY_RIGHT : - if(*b == '\0') -@@ -1881,7 +1886,7 @@ mlreplyd(UCS *prompt, UCS *buf, int nbuf - #endif - - default : -- -+text: - /* look for match in extra_v */ - for(i = 0; i < 12; i++) - if(c && c == extra_v[i]){ -Index: alpine-2.20/pico/ebind.h -=================================================================== ---- alpine-2.20.orig/pico/ebind.h -+++ alpine-2.20/pico/ebind.h -@@ -61,7 +61,7 @@ KEYTAB keytab[NBINDS] = { - #ifdef MOUSE - {KEY_MOUSE, mousepress}, - #ifndef _WINDOWS -- {CTRL|'\\', toggle_xterm_mouse}, -+ {CTRL|'|', toggle_xterm_mouse}, - #endif - #endif - {CTRL|'A', gotobol}, -@@ -100,7 +100,9 @@ KEYTAB keytab[NBINDS] = { - {CTRL|KEY_HOME, gotobob}, - {CTRL|KEY_END, gotoeob}, - {0x7F, backdel}, -- {0, NULL} -+ {CTRL|'\\', pineaccent}, -+ {0, -+NULL} - }; - - -@@ -123,7 +125,7 @@ KEYTAB pkeytab[NBINDS] = { - #ifdef MOUSE - {KEY_MOUSE, mousepress}, - #ifndef _WINDOWS -- {CTRL|'\\', toggle_xterm_mouse}, -+ {CTRL|'|', toggle_xterm_mouse}, - #endif - #endif - {CTRL|'A', gotobol}, -Index: alpine-2.20/pico/efunc.h -=================================================================== ---- alpine-2.20.orig/pico/efunc.h -+++ alpine-2.20/pico/efunc.h -@@ -54,6 +54,9 @@ extern int forwline(int, int); - extern int backline(int, int); - extern int gotobop(int, int); - extern int gotoeop(int, int); -+extern int pineaccent(int, int); -+extern unsigned char accent(UCS, UCS); -+extern unsigned char GetAccent(void); - extern int forwpage(int, int); - extern int backpage(int, int); - extern int scrollupline(int, int); -Index: alpine-2.20/pico/main.c -=================================================================== ---- alpine-2.20.orig/pico/main.c -+++ alpine-2.20/pico/main.c -@@ -416,6 +416,12 @@ main(int argc, char *argv[]) - emlwrite(_("You may possibly have new mail."), NULL); - } - -+ if (c == (CTRL|'\\')){ -+ c = GetAccent(); -+ if (!c) -+ c = NODATA; -+ } -+ - if(km_popped) - switch(c){ - case NODATA: -Index: alpine-2.20/pico/search.c -=================================================================== ---- alpine-2.20.orig/pico/search.c -+++ alpine-2.20/pico/search.c -@@ -291,7 +291,7 @@ forwsearch(int f, int n) - } - - if(status + curwp->w_doto >= llength(curwp->w_dotp) || -- !eq(defpat[status],lgetc(curwp->w_dotp, curwp->w_doto + status).c)) -+ !eq((unsigned char) defpat[status],lgetc(curwp->w_dotp, curwp->w_doto + status).c)) - break; - status++; - } -@@ -1096,7 +1096,7 @@ forscan(int *wrapt, /* boolean indicatin - c = lgetc(curline, curoff++).c; /* get the char */ - - /* test it against first char in pattern */ -- if (eq(c, patrn[0]) != FALSE) { /* if we find it..*/ -+ if (eq(c, (unsigned char)patrn[0]) != FALSE) { /* if we find it..*/ - /* setup match pointers */ - matchline = curline; - matchoff = curoff; -@@ -1117,7 +1117,7 @@ forscan(int *wrapt, /* boolean indicatin - return(FALSE); - - /* and test it against the pattern */ -- if (eq(*patptr, c) == FALSE) -+ if (eq((unsigned char) *patptr, c) == FALSE) - goto fail; - } - ++ else ++ if ((c == 'l') || (c == 'L')){ ++ c = d = 'l'; ++ } ++ else ++ d = GetKey(); ++ return accent(c,d); ++ } ++ ++ int pineaccent(f,n) ++ int f,n; ++ { unsigned char e; ++ ++ if (e = GetAccent()) ++ execute(e, 0, 1); ++ return 1; ++ } ++ ++ unsigned char accent(f,n) ++ UCS f,n; ++ { UCS c,d; ++ ++ c = f; ++ d = n; ++ switch(c){ ++ case '~' : ++ switch(d){ ++ case 'a' : return '\343'; ++ case 'n' : return '\361'; ++ case 'o' : return '\365'; ++ case 'A' : return '\303'; ++ case 'N' : return '\321'; ++ case 'O' : return '\325'; ++ } ++ break; ++ case '\047' : ++ switch(d){ ++ case 'a' : return '\341'; ++ case 'e' : return '\351'; ++ case 'i' : return '\355'; ++ case 'o' : return '\363'; ++ case 'u' : return '\372'; ++ case 'y' : return '\375'; ++ case 'A' : return '\301'; ++ case 'E' : return '\311'; ++ case 'I' : return '\315'; ++ case 'O' : return '\323'; ++ case 'U' : return '\332'; ++ case 'Y' : return '\335'; ++ } ++ break; ++ case '"' : ++ switch(d){ ++ case 'a' : return '\344'; ++ case 'e' : return '\353'; ++ case 'i' : return '\357'; ++ case 'o' : return '\366'; ++ case 'u' : return '\374'; ++ case 'y' : return '\377'; ++ case 'A' : return '\304'; ++ case 'E' : return '\313'; ++ case 'I' : return '\317'; ++ case 'O' : return '\326'; ++ case 'U' : return '\334'; ++ } ++ break; ++ case '^' : ++ switch(d){ ++ case 'a' : return '\342'; ++ case 'e' : return '\352'; ++ case 'i' : return '\356'; ++ case 'o' : return '\364'; ++ case 'u' : return '\373'; ++ case 'A' : return '\302'; ++ case 'E' : return '\312'; ++ case 'I' : return '\316'; ++ case 'O' : return '\324'; ++ case 'U' : return '\333'; ++ case '0' : return '\260'; ++ case '1' : return '\271'; ++ case '2' : return '\262'; ++ case '3' : return '\263'; ++ } ++ break; ++ case '`' : ++ switch(d){ ++ case 'a' : return '\340'; ++ case 'e' : return '\350'; ++ case 'i' : return '\354'; ++ case 'o' : return '\362'; ++ case 'u' : return '\371'; ++ case 'A' : return '\300'; ++ case 'E' : return '\310'; ++ case 'I' : return '\314'; ++ case 'O' : return '\322'; ++ case 'U' : return '\331'; ++ } ++ break; ++ case 'o' : ++ switch(d){ ++ case 'a' : return '\345'; ++ case 'A' : return '\305'; ++ case '/' : return '\370'; ++ case 'r' : return '\256'; ++ case 'R' : return '\256'; ++ case 'c' : return '\251'; ++ case 'C' : return '\251'; ++ } ++ break; ++ case '-' : ++ switch(d){ ++ case 'o' : return '\272'; ++ case 'O' : return '\272'; ++ case '0' : return '\272'; ++ case 'a' : return '\252'; ++ case 'A' : return '\252'; ++ case 'l' : return '\243'; ++ case 'L' : return '\243'; ++ } ++ break; ++ case 'O' : ++ switch(d){ ++ case '/' : return '\330'; ++ case 'r' : return '\256'; ++ case 'R' : return '\256'; ++ case 'c' : return '\251'; ++ case 'C' : return '\251'; ++ } ++ case '/' : ++ switch(d){ ++ case 'o' : return '\370'; ++ case 'O' : return '\330'; ++ } ++ break; ++ case 'a' : ++ switch(d){ ++ case 'e' : return '\346'; ++ case 'E' : return '\346'; ++ } ++ break; ++ case 'A' : ++ switch(d){ ++ case 'E' : return '\306'; ++ case 'e' : return '\306'; ++ } ++ break; ++ case ',' : ++ switch(d){ ++ case 'c' : return '\347'; ++ case 'C' : return '\307'; ++ } ++ break; ++ case '\\' : ++ switch(d){ ++ case '?' : return '\277'; ++ case '!' : return '\241'; ++ } ++ break; ++ case 's' : ++ switch(d){ ++ case 's' : return '\337'; ++ } ++ break; ++ case 'l' : ++ switch(d){ ++ case 'l' : return '\243'; ++ } ++ break; ++ } ++ return '\0'; ++ } + + /* + * go forword to the end of the current paragraph +diff -rc alpine-2.21/pico/composer.c alpine-2.21.WrtAcc/pico/composer.c +*** alpine-2.21/pico/composer.c Sun Feb 5 16:02:36 2017 +--- alpine-2.21.WrtAcc/pico/composer.c Sun Feb 5 16:15:24 2017 +*************** +*** 2015,2021 **** + tbufp = &strng[ods.p_len]; + + if(VALID_KEY(ch)){ /* char input */ +! /* + * if we are allowing editing, insert the new char + * end up leaving tbufp pointing to newly + * inserted character in string, and offset to the +--- 2015,2021 ---- + tbufp = &strng[ods.p_len]; + + if(VALID_KEY(ch)){ /* char input */ +! insert_char:/* + * if we are allowing editing, insert the new char + * end up leaving tbufp pointing to newly + * inserted character in string, and offset to the +*************** +*** 2095,2100 **** +--- 2095,2107 ---- + } + else { /* interpret ch as a command */ + switch (ch = normalize_cmd(ch, ckm, 2)) { ++ case (CTRL|'\\') : ++ if (ch = GetAccent()) ++ goto insert_char; ++ else ++ clearcursor(); ++ break; ++ + case (CTRL|KEY_LEFT): /* word skip left */ + if(ods.p_ind > 0) /* Scoot one char left if possible */ + ods.p_ind--; +diff -rc alpine-2.21/pico/display.c alpine-2.21.WrtAcc/pico/display.c +*** alpine-2.21/pico/display.c Sun Feb 5 16:02:36 2017 +--- alpine-2.21.WrtAcc/pico/display.c Sun Feb 5 16:15:24 2017 +*************** +*** 2196,2201 **** +--- 2196,2206 ---- + b = &buf[ucs4_strlen(buf)]; + continue; + ++ case (CTRL|'\\'): ++ if (c = GetAccent()) ++ goto text; ++ continue; ++ + case (CTRL|'F') : /* CTRL-F forward a char*/ + case KEY_RIGHT : + if(*b == '\0') +*************** +*** 2314,2320 **** + #endif + + default : +! + /* look for match in extra_v */ + for(i = 0; i < 12; i++) + if(c && c == extra_v[i]){ +--- 2319,2325 ---- + #endif + + default : +! text: + /* look for match in extra_v */ + for(i = 0; i < 12; i++) + if(c && c == extra_v[i]){ +diff -rc alpine-2.21/pico/ebind.h alpine-2.21.WrtAcc/pico/ebind.h +*** alpine-2.21/pico/ebind.h Sun Feb 5 16:02:36 2017 +--- alpine-2.21.WrtAcc/pico/ebind.h Sun Feb 5 16:15:24 2017 +*************** +*** 61,67 **** + #ifdef MOUSE + {KEY_MOUSE, mousepress}, + #ifndef _WINDOWS +! {CTRL|'\\', toggle_xterm_mouse}, + #endif + #endif + {CTRL|'A', gotobol}, +--- 61,67 ---- + #ifdef MOUSE + {KEY_MOUSE, mousepress}, + #ifndef _WINDOWS +! {CTRL|'|', toggle_xterm_mouse}, + #endif + #endif + {CTRL|'A', gotobol}, +*************** +*** 100,106 **** + {CTRL|KEY_HOME, gotobob}, + {CTRL|KEY_END, gotoeob}, + {0x7F, backdel}, +! {0, NULL} + }; + + +--- 100,108 ---- + {CTRL|KEY_HOME, gotobob}, + {CTRL|KEY_END, gotoeob}, + {0x7F, backdel}, +! {CTRL|'\\', pineaccent}, +! {0, +! NULL} + }; + + +*************** +*** 123,129 **** + #ifdef MOUSE + {KEY_MOUSE, mousepress}, + #ifndef _WINDOWS +! {CTRL|'\\', toggle_xterm_mouse}, + #endif + #endif + {CTRL|'A', gotobol}, +--- 125,131 ---- + #ifdef MOUSE + {KEY_MOUSE, mousepress}, + #ifndef _WINDOWS +! {CTRL|'|', toggle_xterm_mouse}, + #endif + #endif + {CTRL|'A', gotobol}, +diff -rc alpine-2.21/pico/efunc.h alpine-2.21.WrtAcc/pico/efunc.h +*** alpine-2.21/pico/efunc.h Sun Feb 5 16:02:36 2017 +--- alpine-2.21.WrtAcc/pico/efunc.h Sun Feb 5 16:15:24 2017 +*************** +*** 54,59 **** +--- 54,62 ---- + extern int backline(int, int); + extern int gotobop(int, int); + extern int gotoeop(int, int); ++ extern int pineaccent(int, int); ++ extern unsigned char accent(UCS, UCS); ++ extern unsigned char GetAccent(void); + extern int forwpage(int, int); + extern int backpage(int, int); + extern int scrollupline(int, int); +diff -rc alpine-2.21/pico/main.c alpine-2.21.WrtAcc/pico/main.c +*** alpine-2.21/pico/main.c Sun Feb 5 16:02:36 2017 +--- alpine-2.21.WrtAcc/pico/main.c Sun Feb 5 16:15:24 2017 +*************** +*** 451,456 **** +--- 451,462 ---- + emlwrite(_("You may possibly have new mail."), NULL); + } + ++ if (c == (CTRL|'\\')){ ++ c = GetAccent(); ++ if (!c) ++ c = NODATA; ++ } ++ + if(km_popped) + switch(c){ + case NODATA: diff --git a/chappa-colortext.patch b/chappa-colortext.patch index 9124002..3e4adec 100644 --- a/chappa-colortext.patch +++ b/chappa-colortext.patch @@ -1,522 +1,545 @@ ---- - alpine/confscroll.c | 3 - pith/conf.c | 14 +++ - pith/conf.h | 4 + - pith/conftype.h | 3 - pith/mailview.c | 192 ++++++++++++++++++++++++++++++++++++++++++++++++++++ - pith/mailview.h | 15 ++++ - pith/pine.hlp | 63 +++++++++++++++++ - pith/state.c | 3 - pith/state.h | 2 - pith/text.c | 9 ++ - 10 files changed, 308 insertions(+) - -Index: alpine-2.20/alpine/confscroll.c -=================================================================== ---- alpine-2.20.orig/alpine/confscroll.c -+++ alpine-2.20/alpine/confscroll.c -@@ -5196,6 +5196,9 @@ fix_side_effects(struct pine *ps, struct - - clear_index_cache(ps->mail_stream, 0); - } -+ else if(var == &ps->vars[V_SPECIAL_TEXT]){ -+ regex_pattern(ps->VAR_SPECIAL_TEXT); -+ } - else if(var == &ps->vars[V_INIT_CMD_LIST]){ - if(!revert) - q_status_message(SM_ASYNC, 0, 3, -Index: alpine-2.20/pith/conf.c -=================================================================== ---- alpine-2.20.orig/pith/conf.c -+++ alpine-2.20/pith/conf.c -@@ -228,6 +228,8 @@ CONF_TXT_T cf_text_deadlets[] = "Specif - - CONF_TXT_T cf_text_fillcol[] = "Specifies the column of the screen where the composer should wrap."; - -+CONF_TXT_T cf_special_text_color[] = "Specifies a comma separated list of text and regular expresions that Pine\n# will highlight"; -+ - CONF_TXT_T cf_text_replystr[] = "Specifies the string to insert when replying to a message."; - - CONF_TXT_T cf_text_quotereplstr[] = "Specifies the string to replace quotes with when viewing a message."; -@@ -562,6 +564,8 @@ static struct variable variables[] = { - NULL, cf_text_speller}, - {"composer-wrap-column", 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, - NULL, cf_text_fillcol}, -+{"special-text-color", 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, -+ NULL, cf_special_text_color}, - {"reply-indent-string", 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, - NULL, cf_text_replystr}, - {"reply-leadin", 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, -@@ -821,6 +825,8 @@ static struct variable variables[] = { - {"incoming-unseen-background-color", 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0}, - {"signature-foreground-color", 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0}, - {"signature-background-color", 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0}, -+{"special-text-foreground-color", 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0}, -+{"special-text-background-color", 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0}, - {"prompt-foreground-color", 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0}, - {"prompt-background-color", 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0}, - {"header-general-foreground-color", 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0}, -@@ -1990,6 +1996,8 @@ init_vars(struct pine *ps, void (*cmds_f - set_current_val(&vars[V_FORM_FOLDER], TRUE, TRUE); - set_current_val(&vars[V_EDITOR], TRUE, TRUE); - set_current_val(&vars[V_SPELLER], TRUE, TRUE); -+ set_current_val(&vars[V_SPECIAL_TEXT], TRUE, TRUE); -+ regex_pattern(VAR_SPECIAL_TEXT); - set_current_val(&vars[V_IMAGE_VIEWER], TRUE, TRUE); - set_current_val(&vars[V_BROWSER], TRUE, TRUE); - set_current_val(&vars[V_SMTP_SERVER], TRUE, TRUE); -@@ -6549,6 +6557,7 @@ set_current_color_vals(struct pine *ps) - set_color_val(&vars[V_IND_OP_FORE_COLOR], 0); - set_color_val(&vars[V_INCUNSEEN_FORE_COLOR], 0); - set_color_val(&vars[V_SIGNATURE_FORE_COLOR], 0); -+ set_color_val(&vars[V_SPECIAL_TEXT_FORE_COLOR], 0); - - set_current_val(&ps->vars[V_INDEX_TOKEN_COLORS], TRUE, TRUE); - set_current_val(&ps->vars[V_VIEW_HDR_COLORS], TRUE, TRUE); -@@ -7732,6 +7741,8 @@ config_help(int var, int feature) - return(h_config_scroll_margin); - case V_DEADLETS : - return(h_config_deadlets); -+ case V_SPECIAL_TEXT : -+ return(h_config_special_text_to_color); - case V_FILLCOL : - return(h_config_composer_wrap_column); - case V_TCPOPENTIMEO : -@@ -7897,6 +7908,9 @@ config_help(int var, int feature) - case V_SIGNATURE_FORE_COLOR : - case V_SIGNATURE_BACK_COLOR : - return(h_config_signature_color); -+ case V_SPECIAL_TEXT_FORE_COLOR : -+ case V_SPECIAL_TEXT_BACK_COLOR : -+ return(h_config_special_text_color); - case V_PROMPT_FORE_COLOR : - case V_PROMPT_BACK_COLOR : - return(h_config_prompt_color); -Index: alpine-2.20/pith/conf.h -=================================================================== ---- alpine-2.20.orig/pith/conf.h -+++ alpine-2.20/pith/conf.h -@@ -161,6 +161,8 @@ - #define GLO_EDITOR vars[V_EDITOR].global_val.l - #define VAR_SPELLER vars[V_SPELLER].current_val.p - #define GLO_SPELLER vars[V_SPELLER].global_val.p -+#define VAR_SPECIAL_TEXT vars[V_SPECIAL_TEXT].current_val.l -+#define GLO_SPECIAL_TEXT vars[V_SPECIAL_TEXT].global_val.l - #define VAR_FILLCOL vars[V_FILLCOL].current_val.p - #define GLO_FILLCOL vars[V_FILLCOL].global_val.p - #define VAR_DEADLETS vars[V_DEADLETS].current_val.p -@@ -458,6 +460,8 @@ - #define GLO_SIGNATURE_FORE_COLOR vars[V_SIGNATURE_FORE_COLOR].global_val.p - #define VAR_SIGNATURE_BACK_COLOR vars[V_SIGNATURE_BACK_COLOR].current_val.p - #define GLO_SIGNATURE_BACK_COLOR vars[V_SIGNATURE_BACK_COLOR].global_val.p -+#define VAR_SPECIAL_TEXT_FORE_COLOR vars[V_SPECIAL_TEXT_FORE_COLOR].current_val.p -+#define VAR_SPECIAL_TEXT_BACK_COLOR vars[V_SPECIAL_TEXT_BACK_COLOR].current_val.p - #define VAR_PROMPT_FORE_COLOR vars[V_PROMPT_FORE_COLOR].current_val.p - #define VAR_PROMPT_BACK_COLOR vars[V_PROMPT_BACK_COLOR].current_val.p - #define VAR_VIEW_HDR_COLORS vars[V_VIEW_HDR_COLORS].current_val.l -Index: alpine-2.20/pith/conftype.h -=================================================================== ---- alpine-2.20.orig/pith/conftype.h -+++ alpine-2.20/pith/conftype.h -@@ -80,6 +80,7 @@ typedef enum { V_PERSONAL_NAME = 0 - , V_EDITOR - , V_SPELLER - , V_FILLCOL -+ , V_SPECIAL_TEXT - , V_REPLY_STRING - , V_REPLY_INTRO - , V_QUOTE_REPLACE_STRING -@@ -231,6 +232,8 @@ typedef enum { V_PERSONAL_NAME = 0 - , V_INCUNSEEN_BACK_COLOR - , V_SIGNATURE_FORE_COLOR - , V_SIGNATURE_BACK_COLOR -+ , V_SPECIAL_TEXT_FORE_COLOR -+ , V_SPECIAL_TEXT_BACK_COLOR - , V_PROMPT_FORE_COLOR - , V_PROMPT_BACK_COLOR - , V_HEADER_GENERAL_FORE_COLOR -Index: alpine-2.20/pith/mailview.c -=================================================================== ---- alpine-2.20.orig/pith/mailview.c -+++ alpine-2.20/pith/mailview.c -@@ -282,6 +282,14 @@ format_body(long int msgno, BODY *body, - if((flgs & FM_DISPLAY) - && !(flgs & FM_NOCOLOR) - && pico_usingcolor() -+ && ps_global->VAR_SPECIAL_TEXT_FORE_COLOR -+ && ps_global->VAR_SPECIAL_TEXT_BACK_COLOR){ -+ gf_link_filter(gf_line_test, gf_line_test_opt(color_this_text, NULL)); -+ } -+ -+ if((flgs & FM_DISPLAY) -+ && !(flgs & FM_NOCOLOR) -+ && pico_usingcolor() - && ps_global->VAR_SIGNATURE_FORE_COLOR - && ps_global->VAR_SIGNATURE_BACK_COLOR){ - gf_link_filter(gf_line_test, gf_line_test_opt(color_signature, &is_in_sig)); -@@ -2503,6 +2511,190 @@ hdr_color(char *fieldname, char *value, - return(color_pair); - } - -+void -+interval_free(IVAL_S **ival) -+{ -+ if (!(*ival)) -+ return; -+ -+ if ((*ival)->next) -+ interval_free(&((*ival)->next)); -+ -+ fs_give((void **)(ival)); -+} -+ -+IVAL_S * -+compute_interval (char *string, int endm) -+{ -+ IVAL_S *ival = NULL; -+ regmatch_t pmatch; -+ -+ if(ps_global->paterror == 0 && -+ regexec(&ps_global->colorpat, string + endm, 1, &pmatch, 0) == 0){ -+ ival = (IVAL_S *) fs_get(sizeof(IVAL_S)); -+ ival->start = endm + pmatch.rm_so; -+ ival->end = endm + pmatch.rm_eo; -+ ival->next = compute_interval(string, ival->end); -+ } -+ return ival; -+} -+ -+void -+regex_pattern(char **plist) -+{ -+ int i = 0, j = 0, len = 0; -+ char *pattern = NULL; -+ regex_t preg; -+ -+ if(ps_global->paterror == 0) -+ regfree(&ps_global->colorpat); -+ -+ if(plist && *plist && *plist){ -+ for (i = 0; plist[i] && plist[i][0]; i++) -+ len += strlen(plist[i]) + 1; -+ pattern = (char *) fs_get(len * sizeof(char)); -+ *pattern = '\0'; -+ for (j = 0; j < i; j++){ -+ strcat(pattern, plist[j]); -+ strcat(pattern, (j < i - 1) ? "|" : ""); -+ } -+ if ((ps_global->paterror = regcomp(&preg, pattern, REG_EXTENDED)) != 0) -+ regfree(&preg); -+ else -+ ps_global->colorpat = preg; -+ } -+ if(pattern) -+ fs_give((void **)&pattern); -+} -+ -+LT_INS_S ** -+insert_color_special_text(LT_INS_S **ins, char **p, IVAL_S *ival, int last_end, -+ COLOR_PAIR *col) -+{ -+ struct variable *vars = ps_global->vars; -+ -+ if (ival){ -+ *p += ival->start - last_end; -+ ins = gf_line_test_new_ins(ins, *p, color_embed(col->fg, col->bg), -+ (2 * RGBLEN) + 4); -+ *p += ival->end - ival->start; -+ ins = gf_line_test_new_ins(ins, *p, color_embed(VAR_NORM_FORE_COLOR, -+ VAR_NORM_BACK_COLOR), (2 * RGBLEN) + 4); -+ ins = insert_color_special_text(ins, p, ival->next, ival->end, col); +diff -rc alpine-2.21/alpine/confscroll.c alpine-2.21.colortext/alpine/confscroll.c +*** alpine-2.21/alpine/confscroll.c Sun Feb 5 16:02:36 2017 +--- alpine-2.21.colortext/alpine/confscroll.c Sun Feb 5 16:15:26 2017 +*************** +*** 5222,5227 **** +--- 5222,5230 ---- + + clear_index_cache(ps->mail_stream, 0); + } ++ else if(var == &ps->vars[V_SPECIAL_TEXT]){ ++ regex_pattern(ps->VAR_SPECIAL_TEXT); ++ } + else if(var == &ps->vars[V_INIT_CMD_LIST]){ + if(!revert) + q_status_message(SM_ASYNC, 0, 3, +diff -rc alpine-2.21/pith/conf.c alpine-2.21.colortext/pith/conf.c +*** alpine-2.21/pith/conf.c Sun Feb 5 16:02:36 2017 +--- alpine-2.21.colortext/pith/conf.c Sun Feb 5 16:15:26 2017 +*************** +*** 232,237 **** +--- 232,239 ---- + + CONF_TXT_T cf_text_fillcol[] = "Specifies the column of the screen where the composer should wrap."; + ++ CONF_TXT_T cf_special_text_color[] = "Specifies a comma separated list of text and regular expresions that Pine\n# will highlight"; ++ + CONF_TXT_T cf_text_replystr[] = "Specifies the string to insert when replying to a message."; + + CONF_TXT_T cf_text_quotereplstr[] = "Specifies the string to replace quotes with when viewing a message."; +*************** +*** 572,577 **** +--- 574,581 ---- + #endif /* _WINDOWS */ + {"composer-wrap-column", 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, + NULL, cf_text_fillcol}, ++ {"special-text-color", 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, ++ NULL, cf_special_text_color}, + {"reply-indent-string", 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, + NULL, cf_text_replystr}, + {"reply-leadin", 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, +*************** +*** 833,838 **** +--- 837,844 ---- + {"incoming-unseen-background-color", 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0}, + {"signature-foreground-color", 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0}, + {"signature-background-color", 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0}, ++ {"special-text-foreground-color", 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0}, ++ {"special-text-background-color", 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0}, + {"prompt-foreground-color", 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0}, + {"prompt-background-color", 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0}, + {"header-general-foreground-color", 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0}, +*************** +*** 2021,2026 **** +--- 2027,2034 ---- + set_current_val(&vars[V_DICTIONARY], TRUE, TRUE); + #endif /* _WINDOWS */ + set_current_val(&vars[V_IMAGE_VIEWER], TRUE, TRUE); ++ set_current_val(&vars[V_SPECIAL_TEXT], TRUE, TRUE); ++ regex_pattern(VAR_SPECIAL_TEXT); + set_current_val(&vars[V_BROWSER], TRUE, TRUE); + set_current_val(&vars[V_HISTORY], TRUE, TRUE); + set_current_val(&vars[V_SMTP_SERVER], TRUE, TRUE); +*************** +*** 6567,6572 **** +--- 6575,6581 ---- + set_color_val(&vars[V_IND_OP_FORE_COLOR], 0); + set_color_val(&vars[V_INCUNSEEN_FORE_COLOR], 0); + set_color_val(&vars[V_SIGNATURE_FORE_COLOR], 0); ++ set_color_val(&vars[V_SPECIAL_TEXT_FORE_COLOR], 0); + + set_current_val(&ps->vars[V_INDEX_TOKEN_COLORS], TRUE, TRUE); + set_current_val(&ps->vars[V_VIEW_HDR_COLORS], TRUE, TRUE); +*************** +*** 7755,7760 **** +--- 7764,7771 ---- + return(h_config_scroll_margin); + case V_DEADLETS : + return(h_config_deadlets); ++ case V_SPECIAL_TEXT : ++ return(h_config_special_text_to_color); + case V_FILLCOL : + return(h_config_composer_wrap_column); + case V_TCPOPENTIMEO : +*************** +*** 7922,7927 **** +--- 7933,7941 ---- + case V_SIGNATURE_FORE_COLOR : + case V_SIGNATURE_BACK_COLOR : + return(h_config_signature_color); ++ case V_SPECIAL_TEXT_FORE_COLOR : ++ case V_SPECIAL_TEXT_BACK_COLOR : ++ return(h_config_special_text_color); + case V_PROMPT_FORE_COLOR : + case V_PROMPT_BACK_COLOR : + return(h_config_prompt_color); +diff -rc alpine-2.21/pith/conf.h alpine-2.21.colortext/pith/conf.h +*** alpine-2.21/pith/conf.h Sun Feb 5 16:02:36 2017 +--- alpine-2.21.colortext/pith/conf.h Sun Feb 5 16:15:26 2017 +*************** +*** 165,170 **** +--- 165,172 ---- + #define VAR_DICTIONARY vars[V_DICTIONARY].current_val.l + #define GLO_DICTIONARY vars[V_DICTIONARY].global_val.l + #endif /* _WINDOWS */ ++ #define VAR_SPECIAL_TEXT vars[V_SPECIAL_TEXT].current_val.l ++ #define GLO_SPECIAL_TEXT vars[V_SPECIAL_TEXT].global_val.l + #define VAR_FILLCOL vars[V_FILLCOL].current_val.p + #define GLO_FILLCOL vars[V_FILLCOL].global_val.p + #define VAR_DEADLETS vars[V_DEADLETS].current_val.p +*************** +*** 463,468 **** +--- 465,472 ---- + #define GLO_SIGNATURE_FORE_COLOR vars[V_SIGNATURE_FORE_COLOR].global_val.p + #define VAR_SIGNATURE_BACK_COLOR vars[V_SIGNATURE_BACK_COLOR].current_val.p + #define GLO_SIGNATURE_BACK_COLOR vars[V_SIGNATURE_BACK_COLOR].global_val.p ++ #define VAR_SPECIAL_TEXT_FORE_COLOR vars[V_SPECIAL_TEXT_FORE_COLOR].current_val.p ++ #define VAR_SPECIAL_TEXT_BACK_COLOR vars[V_SPECIAL_TEXT_BACK_COLOR].current_val.p + #define VAR_PROMPT_FORE_COLOR vars[V_PROMPT_FORE_COLOR].current_val.p + #define VAR_PROMPT_BACK_COLOR vars[V_PROMPT_BACK_COLOR].current_val.p + #define VAR_VIEW_HDR_COLORS vars[V_VIEW_HDR_COLORS].current_val.l +diff -rc alpine-2.21/pith/conftype.h alpine-2.21.colortext/pith/conftype.h +*** alpine-2.21/pith/conftype.h Sun Feb 5 16:02:36 2017 +--- alpine-2.21.colortext/pith/conftype.h Sun Feb 5 16:15:26 2017 +*************** +*** 83,88 **** +--- 83,89 ---- + , V_DICTIONARY + #endif /* _WINDOWS */ + , V_FILLCOL ++ , V_SPECIAL_TEXT + , V_REPLY_STRING + , V_REPLY_INTRO + , V_QUOTE_REPLACE_STRING +*************** +*** 235,240 **** +--- 236,243 ---- + , V_INCUNSEEN_BACK_COLOR + , V_SIGNATURE_FORE_COLOR + , V_SIGNATURE_BACK_COLOR ++ , V_SPECIAL_TEXT_FORE_COLOR ++ , V_SPECIAL_TEXT_BACK_COLOR + , V_PROMPT_FORE_COLOR + , V_PROMPT_BACK_COLOR + , V_HEADER_GENERAL_FORE_COLOR +diff -rc alpine-2.21/pith/mailview.c alpine-2.21.colortext/pith/mailview.c +*** alpine-2.21/pith/mailview.c Sun Feb 5 16:02:36 2017 +--- alpine-2.21.colortext/pith/mailview.c Sun Feb 5 16:15:26 2017 +*************** +*** 282,287 **** +--- 282,295 ---- + if((flgs & FM_DISPLAY) + && !(flgs & FM_NOCOLOR) + && pico_usingcolor() ++ && ps_global->VAR_SPECIAL_TEXT_FORE_COLOR ++ && ps_global->VAR_SPECIAL_TEXT_BACK_COLOR){ ++ gf_link_filter(gf_line_test, gf_line_test_opt(color_this_text, NULL)); ++ } ++ ++ if((flgs & FM_DISPLAY) ++ && !(flgs & FM_NOCOLOR) ++ && pico_usingcolor() + && ps_global->VAR_SIGNATURE_FORE_COLOR + && ps_global->VAR_SIGNATURE_BACK_COLOR){ + gf_link_filter(gf_line_test, gf_line_test_opt(color_signature, &is_in_sig)); +*************** +*** 2503,2508 **** +--- 2511,2700 ---- + return(color_pair); + } + ++ void ++ interval_free(IVAL_S **ival) ++ { ++ if (!(*ival)) ++ return; ++ ++ if ((*ival)->next) ++ interval_free(&((*ival)->next)); ++ ++ fs_give((void **)(ival)); ++ } ++ ++ IVAL_S * ++ compute_interval (char *string, int endm) ++ { ++ IVAL_S *ival = NULL; ++ regmatch_t pmatch; ++ ++ if(ps_global->paterror == 0 && ++ regexec(&ps_global->colorpat, string + endm, 1, &pmatch, 0) == 0){ ++ ival = (IVAL_S *) fs_get(sizeof(IVAL_S)); ++ ival->start = endm + pmatch.rm_so; ++ ival->end = endm + pmatch.rm_eo; ++ ival->next = compute_interval(string, ival->end); + } -+ return ins; -+} -+ -+int -+length_color(char *p, int begin_color) -+{ -+ int len = 0, done = begin_color ? 0 : -1; -+ char *orig = p; -+ -+ while (*p && done <= 0){ -+ switch(*p++){ -+ case TAG_HANDLE : -+ p += *p + 1; -+ done++; -+ break; -+ -+ case TAG_FGCOLOR : -+ case TAG_BGCOLOR : -+ p += RGBLEN; -+ if (!begin_color) -+ done++; -+ break; -+ -+ default : -+ break; -+ } ++ return ival; ++ } ++ ++ void ++ regex_pattern(char **plist) ++ { ++ int i = 0, j = 0, len = 0; ++ char *pattern = NULL; ++ regex_t preg; ++ ++ if(ps_global->paterror == 0) ++ regfree(&ps_global->colorpat); ++ ++ if(plist && *plist && *plist){ ++ for (i = 0; plist[i] && plist[i][0]; i++) ++ len += strlen(plist[i]) + 1; ++ pattern = (char *) fs_get(len * sizeof(char)); ++ *pattern = '\0'; ++ for (j = 0; j < i; j++){ ++ strcat(pattern, plist[j]); ++ strcat(pattern, (j < i - 1) ? "|" : ""); ++ } ++ if ((ps_global->paterror = regcomp(&preg, pattern, REG_EXTENDED)) != 0) ++ regfree(&preg); ++ else ++ ps_global->colorpat = preg; + } -+ len = p - orig; -+ return len; -+} -+ -+int -+any_color_in_string(char *p) -+{ -+ int rv = 0; -+ char *orig = p; -+ while (*p && !rv) -+ if (*p++ == TAG_EMBED) -+ rv = p - orig; -+ return rv; -+} -+ -+void -+remove_spaces_ival(IVAL_S **ivalp, char *p) -+{ -+ IVAL_S *ival; -+ int i; -+ if (!ivalp || !*ivalp) -+ return; -+ ival = *ivalp; -+ for (i = 0; isspace((unsigned char) p[ival->start + i]); i++); -+ if (ival->start + i < ival->end) /* do not do this if match only spaces */ -+ ival->start += i; -+ else -+ return; -+ for (i = 0; isspace((unsigned char) p[ival->end - i - 1]); i++); -+ ival->end -= i; -+ if (ival->next) -+ remove_spaces_ival(&(ival->next), p); -+} -+ -+int -+color_this_text(long linenum, char *line, LT_INS_S **ins, void *local) -+{ ++ if(pattern) ++ fs_give((void **)&pattern); ++ } ++ ++ LT_INS_S ** ++ insert_color_special_text(LT_INS_S **ins, char **p, IVAL_S *ival, int last_end, ++ COLOR_PAIR *col) ++ { + struct variable *vars = ps_global->vars; -+ COLOR_PAIR *col = NULL; -+ char *p; -+ int i = 0; -+ static char *pattern = NULL; -+ -+/* select_quote(linenum, line, ins, (void *) &i); -+ for (i = 0; tmp_20k_buf[i] != '\0'; i++); */ -+ p = line + i; -+ -+ if(VAR_SPECIAL_TEXT_FORE_COLOR && VAR_SPECIAL_TEXT_BACK_COLOR -+ && (col = new_color_pair(VAR_SPECIAL_TEXT_FORE_COLOR, -+ VAR_SPECIAL_TEXT_BACK_COLOR)) -+ && !pico_is_good_colorpair(col)) -+ free_color_pair(&col); -+ -+ if(ps_global->VAR_SPECIAL_TEXT && *ps_global->VAR_SPECIAL_TEXT -+ && **ps_global->VAR_SPECIAL_TEXT && col){ -+ IVAL_S *ival; -+ int done = 0, begin_color = 0; -+ -+ while (!done){ -+ if (i = any_color_in_string(p)){ -+ begin_color = (begin_color + 1) % 2; -+ if (begin_color){ -+ p[i - 1] = '\0'; -+ ival = compute_interval(p, 0); -+ remove_spaces_ival(&ival, p); -+ p[i - 1] = TAG_EMBED; -+ ins = insert_color_special_text(ins, &p, ival, 0, col); -+ } -+ for (;*p++ != TAG_EMBED; ); -+ p += length_color(p, begin_color); -+ } -+ else{ -+ ival = compute_interval(p, 0); -+ remove_spaces_ival(&ival, p); -+ ins = insert_color_special_text(ins, &p, ival, 0, col); -+ done++; -+ } -+ interval_free(&ival); -+ if (!*p) -+ done++; -+ } -+ free_color_pair(&col); ++ ++ if (ival){ ++ *p += ival->start - last_end; ++ ins = gf_line_test_new_ins(ins, *p, color_embed(col->fg, col->bg), ++ (2 * RGBLEN) + 4); ++ *p += ival->end - ival->start; ++ ins = gf_line_test_new_ins(ins, *p, color_embed(VAR_NORM_FORE_COLOR, ++ VAR_NORM_BACK_COLOR), (2 * RGBLEN) + 4); ++ ins = insert_color_special_text(ins, p, ival->next, ival->end, col); + } -+ -+ return 0; -+} - - /* - * The argument fieldname is something like "Subject:..." or "Subject". -Index: alpine-2.20/pith/mailview.h -=================================================================== ---- alpine-2.20.orig/pith/mailview.h -+++ alpine-2.20/pith/mailview.h -@@ -30,6 +30,12 @@ - #include "../pith/color.h" - - -+typedef struct IVAL { -+ int start; -+ int end; -+ struct IVAL *next; -+} IVAL_S; -+ - /* format_message flags */ - #define FM_DISPLAY 0x0001 /* result is headed for display */ - #define FM_NEW_MESS 0x0002 /* a new message so zero out attachment descrip */ -@@ -126,6 +132,15 @@ char *format_body(long int, BODY *, HAND - int url_hilite(long, char *, LT_INS_S **, void *); - int handle_start_color(char *, size_t, int *, int); - int handle_end_color(char *, size_t, int *); -+IVAL_S *compute_interval(char *, int); -+void remove_spaces_ival(IVAL_S **, char *); -+void interval_free(IVAL_S **); -+void regex_pattern(char **); -+LT_INS_S **insert_color_special_text(LT_INS_S **, char **, IVAL_S *, -+ int, COLOR_PAIR *); -+int any_color_in_string(char *); -+int length_color(char *, int); -+int color_this_text(long, char *, LT_INS_S **, void *); - - /* - * BUG: BELOW IS UNIX/PC ONLY since config'd browser means nothing to webpine -Index: alpine-2.20/pith/pine.hlp -=================================================================== ---- alpine-2.20.orig/pith/pine.hlp -+++ alpine-2.20/pith/pine.hlp -@@ -3833,6 +3833,7 @@ There are also additional details on -