diff --git a/alpine-2.00.tar.bz2 b/alpine-2.00.tar.bz2 deleted file mode 100644 index 7384f52..0000000 --- a/alpine-2.00.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c85db8405af90375ba2440c85b7952d80996154e9916b83acca558dc82e0a2a6 -size 5222673 diff --git a/alpine-2.10.clean.tar.lzma b/alpine-2.10.clean.tar.lzma new file mode 100644 index 0000000..707b689 --- /dev/null +++ b/alpine-2.10.clean.tar.lzma @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ee9a0a08e2bdeafb42448c759fcc38f1d960ed9485a7c7178d8c4016b13898cc +size 4849936 diff --git a/alpine-no-add-needed.patch b/alpine-no-add-needed.patch index ffae4e7..6b39c8c 100644 --- a/alpine-no-add-needed.patch +++ b/alpine-no-add-needed.patch @@ -1,5 +1,12 @@ ---- alpine/Makefile.am.orig -+++ alpine/Makefile.am +--- + alpine/Makefile.am | 2 +- + configure.ac | 3 ++- + 2 files changed, 3 insertions(+), 2 deletions(-) + +Index: alpine-2.10/alpine/Makefile.am +=================================================================== +--- alpine-2.10.orig/alpine/Makefile.am ++++ alpine-2.10/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 \ @@ -7,10 +14,12 @@ - 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)\" + AM_CPPFLAGS = -I@top_builddir@/include -I@top_srcdir@/include -DLOCALEDIR=\"$(localedir)\" ---- configure.ac.orig -+++ configure.ac +Index: alpine-2.10/configure.ac +=================================================================== +--- alpine-2.10.orig/configure.ac ++++ alpine-2.10/configure.ac @@ -37,8 +37,9 @@ WEB_BUILD=web/src/alpined.d dnl CHECK PROGRAMS diff --git a/alpine.changes b/alpine.changes index 97044a9..094b3d4 100644 --- a/alpine.changes +++ b/alpine.changes @@ -1,3 +1,30 @@ +------------------------------------------------------------------- +Wed May 22 20:37:21 UTC 2013 - jengelh@inai.de + +- Update to new upstream release 2.10 +* Quota report for IMAP folders that support it + (press the "@" command in the index screen of such folder). +* Search a folder for the content of any header with the ";" + command. +* Foreign characters are decoded correctly in IMAP folders. +* Recognition of proper mime type for docx, xlsx, and pptx files. +* When composing a message, Alpine will create a new thread when + the subject is erased. +- Uncompress patches, since quilt does not like working with them +- Remove because merged upstream: chappa-filterflagbug.patch(.gz), + chappa-nlinfobug.patch(.gz), chappa-replacebug.patch(.gz), + chappa-searchheader.patch(.gz), chappa-streamlock.patch(.gz) +- Rediff to clear fuzz: alpine-no-add-needed.patch, + pine-nonvoid-function.patch +- Remove because no longer applies and total lack of description + as per Patch Guidelines: + alpine-no-add-needed.patch + +------------------------------------------------------------------- +Wed May 22 12:10:17 UTC 2013 - jengelh@inai.de + +- Remove old SUSE definitions + ------------------------------------------------------------------- Fri Jul 27 08:43:05 UTC 2012 - aj@suse.de diff --git a/alpine.spec b/alpine.spec index d5fa730..58fa2d7 100644 --- a/alpine.spec +++ b/alpine.spec @@ -1,7 +1,7 @@ # # spec file for package alpine # -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,18 +18,7 @@ Name: alpine # -# Package configuration: -# -%if %{suse_version} > 1030 -%define obsolete_pine 1 -%define provide_pico_and_pilot 1 -%else -%define obsolete_pine 0 -%define provide_pico_and_pilot 0 -%endif -# # For debugging only: -%define use_mudflap 0 %define build_vanilla 0 # Summary: Mail User Agent @@ -44,23 +33,17 @@ BuildRequires: openldap2-devel BuildRequires: openssl-devel BuildRequires: pam-devel BuildRequires: update-desktop-files -%if %{use_mudflap} -BuildRequires: libmudflap -%endif +BuildRequires: xz # pgp4pine requires pine: Provides: pine # -%if %obsolete_pine Obsoletes: pine4 Provides: pine4 -%else -Conflicts: pine4 -%endif # -Version: 2.00 +Version: 2.10 Release: 0 Url: http://www.washington.edu/alpine/ -Source: %{name}-%{version}.tar.bz2 +Source: http://patches.freeiz.com/alpine/patches/alpine-2.10/alpine-2.10.clean.tar.lzma BuildRoot: %{_tmppath}/%{name}-%{version}-build Source1: %name.png Source2: %name.desktop @@ -71,28 +54,21 @@ Patch4: fix-implicit.patch Patch5: alpine-gcc44.diff Patch6: alpine-2.00-as_needed.patch Patch7: alpine-month_name-utf8.patch -Patch8: alpine-maildir-closedir.patch Patch10: pico-fix-spurious-undef-warnings.diff Patch20: pine-expression-warnings.diff Patch40: pico-stripwhitespace.diff Patch60: signal-and-panic-improvements.diff # # Eduardo Chappa's patches. -# http://staff.washington.edu/chappa/alpine/patches +# http://patches.freeiz.com/alpine/ # -Patch600: chappa-colortext.patch.gz -Patch601: chappa-fancy.patch.gz -Patch602: chappa-ignoresize.patch.gz -Patch603: chappa-insertpat.patch.gz -Patch604: chappa-maildir.patch.gz -Patch605: chappa-searchheader.patch.gz -Patch606: chappa-WrtAcc.patch.gz -Patch607: chappa-replacebug.patch.gz -Patch608: chappa-unixnullbug.patch.gz -Patch609: chappa-streamlock.patch.gz -Patch610: chappa-filterflagbug.patch.gz -Patch611: chappa-nlinfobug.patch.gz -Patch612: chappa-unverified.patch.gz +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 %description @@ -151,24 +127,17 @@ fi %patch604 -p1 %patch605 -p1 %patch606 -p1 -%patch607 -p1 -%patch608 -p1 -%patch609 -p1 -%patch610 -p1 -%patch611 -p1 -%patch612 -p1 -%patch613 +%patch613 -p1 # # SuSE patches - warning fixes, etc: # -%patch1 +%patch1 -p1 %patch2 -p1 %patch3 %patch4 -p0 %patch5 -p0 %patch6 -p0 %patch7 -%patch8 %patch10 -p1 %patch20 -p1 %patch40 -p1 @@ -176,25 +145,13 @@ fi %endif # End of "if !{build_vanilla}" %build -# Workaround for older distros which slashed the gnu: -%if %{suse_version} <= 1010 -%define _host_os %{_os}%{?_gnu} -%define _host %{_host_cpu}-%{_host_vendor}-%{_host_os} -%endif # # Comment on disabled warnings: The disabled warnings are rather harmless # and disabling them allows to focus on the really serious warnings: # export CFLAGS="${RPM_OPT_FLAGS/-O2/-Os} \ -%if %{suse_version} >= 1010 -Wno-unused-value -fno-strict-aliasing -Wno-pointer-sign -Wno-unused \ -%endif -%if %{suse_version} >= 1030 -Wno-address \ -%endif -%if %{use_mudflap} - -fmudflap \ -%endif " # # On -Waddress: @@ -213,26 +170,8 @@ export CFLAGS="${RPM_OPT_FLAGS/-O2/-Os} \ # export LDFLAGS="-rdynamic" # -rdynamic is used for backtrace_symbols: : -# -# In case one wants to compile alpine with libmudflap to instrument all risky -# pointer/array dereferencing operations, some standard library string/heap -# functions, and some other associated constructs with range/validity tests. -# Modules so instrumented should be immune to buffer overflows, invalid heap -# use, and some other classes of C/C++ programming errors. Disabled by default, -# but may be used for debugging issues which are otherwise hard to catch: -#-fmudflap -fmudflapir \ -%if %{use_mudflap} -export EXTRALDFLAGS="-lmudflap" -# Silences warnings at startup (faster, could be used for production builds): -#export EXTRALDFLAGS="-lmudflapir" -LDFLAGS="$LDFLAGS $EXTRALDFLAGS" -%endif autoreconf -fiv %configure \ -%if %{use_mudflap} - %( : 'mudflap(th) does not work with with threads:' )\ - --without-pthread \ -%endif --with-ssl-dir=/usr \ --with-smtp-msa=/usr/sbin/sendmail \ --with-password-prog=/usr/bin/passwd \ @@ -266,14 +205,10 @@ install -D -m644 %{SOURCE1} $RPM_BUILD_ROOT/usr/share/pixmaps/%name.png install -D -m644 %{SOURCE2} $RPM_BUILD_ROOT/usr/share/applications/%name.desktop %suse_update_desktop_file %name : -%if %obsolete_pine ln -sf alpine $RPM_BUILD_ROOT%{_bindir}/pine -%endif : -%if %provide_pico_and_pilot install -m755 pico/{pico,pilot} $RPM_BUILD_ROOT%{_bindir} install -m644 doc/{pico.1,pilot.1} $RPM_BUILD_ROOT%{_mandir}/man1/ -%endif %check #since where are no logs in the package at the moment, there are no checks, @@ -342,7 +277,6 @@ fi %{_bindir}/mailutil /usr/share/applications/%name.desktop /usr/share/pixmaps/%name.png -%if %provide_pico_and_pilot %files -n pico %defattr(-, root, root) @@ -353,6 +287,5 @@ fi %defattr(-, root, root) %{_bindir}/pilot %doc %{_mandir}/man1/pilot.* -%endif %changelog diff --git a/chappa-WrtAcc.patch b/chappa-WrtAcc.patch new file mode 100644 index 0000000..8cc7b4e --- /dev/null +++ b/chappa-WrtAcc.patch @@ -0,0 +1,408 @@ +diff -rc alpine-2.10/pico/basic.c alpine-2.10.WrtAcc/pico/basic.c +*** alpine-2.10/pico/basic.c 2013-01-11 11:25:28.000000000 -0700 +--- alpine-2.10.WrtAcc/pico/basic.c 2013-01-11 20:43:11.000000000 -0700 +*************** +*** 344,349 **** +--- 344,532 ---- + 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; ++ } ++ return '\0'; ++ } + + /* + * go forword to the end of the current paragraph +diff -rc alpine-2.10/pico/composer.c alpine-2.10.WrtAcc/pico/composer.c +*** alpine-2.10/pico/composer.c 2013-01-11 19:45:41.000000000 -0700 +--- alpine-2.10.WrtAcc/pico/composer.c 2013-01-11 20:43:11.000000000 -0700 +*************** +*** 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.10/pico/display.c alpine-2.10.WrtAcc/pico/display.c +*** alpine-2.10/pico/display.c 2013-01-11 11:25:29.000000000 -0700 +--- alpine-2.10.WrtAcc/pico/display.c 2013-01-11 20:43:11.000000000 -0700 +*************** +*** 1751,1756 **** +--- 1751,1761 ---- + 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') +*************** +*** 1869,1875 **** + #endif + + default : +! + /* look for match in extra_v */ + for(i = 0; i < 12; i++) + if(c && c == extra_v[i]){ +--- 1874,1880 ---- + #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.10/pico/ebind.h alpine-2.10.WrtAcc/pico/ebind.h +*** alpine-2.10/pico/ebind.h 2013-01-11 11:25:29.000000000 -0700 +--- alpine-2.10.WrtAcc/pico/ebind.h 2013-01-11 20:43:11.000000000 -0700 +*************** +*** 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.10/pico/efunc.h alpine-2.10.WrtAcc/pico/efunc.h +*** alpine-2.10/pico/efunc.h 2013-01-11 11:25:29.000000000 -0700 +--- alpine-2.10.WrtAcc/pico/efunc.h 2013-01-11 20:43:11.000000000 -0700 +*************** +*** 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.10/pico/main.c alpine-2.10.WrtAcc/pico/main.c +*** alpine-2.10/pico/main.c 2013-01-11 11:25:29.000000000 -0700 +--- alpine-2.10.WrtAcc/pico/main.c 2013-01-11 20:43:11.000000000 -0700 +*************** +*** 416,421 **** +--- 416,427 ---- + 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 -rc alpine-2.10/pico/search.c alpine-2.10.WrtAcc/pico/search.c +*** alpine-2.10/pico/search.c 2013-01-11 11:25:29.000000000 -0700 +--- alpine-2.10.WrtAcc/pico/search.c 2013-01-11 20:43:11.000000000 -0700 +*************** +*** 274,280 **** + } + + if(status + curwp->w_doto >= llength(curwp->w_dotp) || +! !eq(defpat[status],lgetc(curwp->w_dotp, curwp->w_doto + status).c)) + break; /* do nothing! */ + status++; + } +--- 274,280 ---- + } + + if(status + curwp->w_doto >= llength(curwp->w_dotp) || +! !eq((unsigned char)defpat[status],lgetc(curwp->w_dotp, curwp->w_doto + status).c)) + break; /* do nothing! */ + status++; + } +*************** +*** 927,933 **** + 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..*/ + /* setup match pointers */ + matchline = curline; + matchoff = curoff; +--- 927,933 ---- + c = lgetc(curline, curoff++).c; /* get the char */ + + /* test it against first char in pattern */ +! if (eq(c, (unsigned char)patrn[0]) != FALSE) { /* if we find it..*/ + /* setup match pointers */ + matchline = curline; + matchoff = curoff; +*************** +*** 948,954 **** + return(FALSE); + + /* and test it against the pattern */ +! if (eq(*patptr, c) == FALSE) + goto fail; + } + +--- 948,954 ---- + return(FALSE); + + /* and test it against the pattern */ +! if (eq((unsigned char) *patptr, c) == FALSE) + goto fail; + } + diff --git a/chappa-WrtAcc.patch.gz b/chappa-WrtAcc.patch.gz deleted file mode 100644 index 27f59a2..0000000 --- a/chappa-WrtAcc.patch.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1884da3a57396eeb664281c48760d0c508fc51fb9af760c2dd125952cc25eab7 -size 2576 diff --git a/chappa-colortext.patch b/chappa-colortext.patch new file mode 100644 index 0000000..44235ac --- /dev/null +++ b/chappa-colortext.patch @@ -0,0 +1,545 @@ +diff -rc alpine-2.10/alpine/confscroll.c alpine-2.10.colortext/alpine/confscroll.c +*** alpine-2.10/alpine/confscroll.c 2013-01-11 15:21:34.000000000 -0700 +--- alpine-2.10.colortext/alpine/confscroll.c 2013-01-11 20:43:16.000000000 -0700 +*************** +*** 5180,5185 **** +--- 5180,5188 ---- + + 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.10/pith/conf.c alpine-2.10.colortext/pith/conf.c +*** alpine-2.10/pith/conf.c 2013-01-11 19:45:41.000000000 -0700 +--- alpine-2.10.colortext/pith/conf.c 2013-01-11 20:43:16.000000000 -0700 +*************** +*** 226,231 **** +--- 226,233 ---- + + 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."; +*************** +*** 558,563 **** +--- 560,567 ---- + 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, +*************** +*** 809,814 **** +--- 813,820 ---- + {"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}, +*************** +*** 1972,1977 **** +--- 1978,1985 ---- + 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); +*************** +*** 6424,6429 **** +--- 6432,6438 ---- + 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_VIEW_HDR_COLORS], TRUE, TRUE); + set_current_val(&ps->vars[V_KW_COLORS], TRUE, TRUE); +*************** +*** 7599,7604 **** +--- 7608,7615 ---- + 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 : +*************** +*** 7758,7763 **** +--- 7769,7777 ---- + 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.10/pith/conf.h alpine-2.10.colortext/pith/conf.h +*** alpine-2.10/pith/conf.h 2013-01-11 11:26:44.000000000 -0700 +--- alpine-2.10.colortext/pith/conf.h 2013-01-11 20:43:16.000000000 -0700 +*************** +*** 161,166 **** +--- 161,168 ---- + #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 +*************** +*** 444,449 **** +--- 446,453 ---- + #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.10/pith/conftype.h alpine-2.10.colortext/pith/conftype.h +*** alpine-2.10/pith/conftype.h 2013-01-11 19:45:41.000000000 -0700 +--- alpine-2.10.colortext/pith/conftype.h 2013-01-11 20:43:16.000000000 -0700 +*************** +*** 80,85 **** +--- 80,86 ---- + , V_EDITOR + , V_SPELLER + , V_FILLCOL ++ , V_SPECIAL_TEXT + , V_REPLY_STRING + , V_REPLY_INTRO + , V_QUOTE_REPLACE_STRING +*************** +*** 224,229 **** +--- 225,232 ---- + , 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.10/pith/mailview.c alpine-2.10.colortext/pith/mailview.c +*** alpine-2.10/pith/mailview.c 2013-01-11 17:43:09.000000000 -0700 +--- alpine-2.10.colortext/pith/mailview.c 2013-01-11 20:43:16.000000000 -0700 +*************** +*** 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 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); ++ } ++ 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; ++ } ++ } ++ 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) ++ { ++ 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); ++ } ++ ++ return 0; ++ } + + /* + * The argument fieldname is something like "Subject:..." or "Subject". +diff -rc alpine-2.10/pith/mailview.h alpine-2.10.colortext/pith/mailview.h +*** alpine-2.10/pith/mailview.h 2013-01-11 11:26:44.000000000 -0700 +--- alpine-2.10.colortext/pith/mailview.h 2013-01-11 20:43:16.000000000 -0700 +*************** +*** 30,35 **** +--- 30,41 ---- + #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,131 **** +--- 132,146 ---- + 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 +diff -rc alpine-2.10/pith/pine.hlp alpine-2.10.colortext/pith/pine.hlp +*** alpine-2.10/pith/pine.hlp 2013-01-11 20:33:27.000000000 -0700 +--- alpine-2.10.colortext/pith/pine.hlp 2013-01-11 20:43:16.000000000 -0700 +*************** +*** 3517,3522 **** +--- 3517,3523 ---- +