[tin-dev] [PATCH] highlight external quotes

Dennis Preiser dennis at d--p.de
Fri Oct 9 18:06:14 CEST 2015


On Fri, Oct 09, 2015 at 12:17:57AM +0200, Urs Janßen wrote:
> On Thu, Oct 08, 2015 at 09:39:18PM +0200, Dennis Preiser wrote:
>> (extquote_handling, default OFF, tinrc and attributes), a regex
>> (extquote_regex, default "^|\s", tinrc) and a color definition
>> (col_extquote, default color 5, tinrc).
> 
> "^|\s" is included in DEFAULT_QUOTE_REGEX:
> ^\s{0,3}(?:[\]{}>|:)]|
> ^^^^^            ^

Ups. I use a modified version without "|" for some reason... Probably
related with these external citations ;-)

> with use_color=ON, extquote_handling=ON and col_extquote!=col_quote
> I still get col_quote colored lines, IMHO the flags |= C_EXTQUOTE should
> be done right after flags |= C_QUOTE2 and before flags |= C_QUOTE1 in
> cook.c:process_text_body_part() ~ 664

I have attached a patch for this.

Dennis
-------------- next part --------------
diff -urp tin-2.3.1_r8/src/cook.c tin-2.3.1_r9/src/cook.c
--- tin-2.3.1_r8/src/cook.c	2015-10-07 19:25:19.000000000 +0200
+++ tin-2.3.1_r9/src/cook.c	2015-10-09 17:02:54.000000000 +0200
@@ -658,16 +658,16 @@ process_text_body_part(
 			else if (quote_regex2.re) {
 				if (MATCH_REGEX(quote_regex2, line, len))
 					flags |= C_QUOTE2;
-				else if (quote_regex.re) {
-					if (MATCH_REGEX(quote_regex, line, len))
-						flags |= C_QUOTE1;
+				else if (curr_group->attribute->extquote_handling && extquote_regex.re) {
+					if (MATCH_REGEX(extquote_regex, line, len))
+						flags |= C_EXTQUOTE;
+					else if (quote_regex.re) {
+						if (MATCH_REGEX(quote_regex, line, len))
+							flags |= C_QUOTE1;
+					}
 				}
 			}
 		}
-		if (curr_group->attribute->extquote_handling && extquote_regex.re) {
-			if (MATCH_REGEX(extquote_regex, line, len))
-				flags |= C_EXTQUOTE;
-		}
 #endif /* HAVE_COLOR */
 
 		if (MATCH_REGEX(url_regex, line, len))


More information about the tin-dev mailing list