Re: Coloring wrapped quotes
- From: Peter Bloomfield <bloomfld eos ncsu edu>
- To: balsa-list gnome org
- Subject: Re: Coloring wrapped quotes
- Date: Sat, 23 Jun 2001 13:51:26 -0400
On 2001.06.22 12:15 Ali Akcaagac wrote:
>
> could it be that your patch doesnt take care of the 'url click'
> patch of albrecht dreß ???
>
> --
> Name....: Ali Akcaagac
> Status..: Student Of Computer & Economic Science
> E-Mail..: mailto:ali.akcaagac@stud.fh-wilhelmshaven.de
> WWW.....: http://www.fh-wilhelmshaven.de/~akcaagaa
>
Good catch! I thought I checked that--oh, well. Here's a better patch.
diff -Naur balsa-1.1.6/src/balsa-message.c balsa-work/src/balsa-message.c
--- balsa-1.1.6/src/balsa-message.c Mon May 28 03:22:01 2001
+++ balsa-work/src/balsa-message.c Fri Jun 22 19:43:58 2001
@@ -1271,6 +1271,7 @@
gchar *ptr = NULL;
size_t alloced;
gchar **l = NULL, **lines = NULL, *line = NULL;
+ gchar **mini_l, **mini_lines, *mini_line;
gint quote_level = 0;
if (!libbalsa_message_body_save_temporary(info->body, NULL)) {
@@ -1318,9 +1319,6 @@
fnt = find_body_font(info->body);
- if (bm->wrap_text)
- libbalsa_wrap_string(ptr, balsa_app.wraplength);
-
if (!fnt)
fnt = gdk_fontset_load(balsa_app.message_font);
@@ -1351,6 +1349,8 @@
if (regcomp(&rex, balsa_app.quote_regex, REG_EXTENDED) != 0) {
g_warning
("part_info_init_mimetext: quote regex compilation failed.");
+ if (bm->wrap_text)
+ libbalsa_wrap_string(ptr, balsa_app.wraplength);
gtk_text_insert(GTK_TEXT(item), fnt, NULL, NULL, ptr, -1);
} else {
gint ypos = 0;
@@ -1359,19 +1359,28 @@
for (line = *lines; line != NULL; line = *(++lines)) {
line = g_strconcat(line, "\n", NULL);
quote_level = is_a_quote(line, &rex);
- if (quote_level != 0) {
+ if (quote_level)
/* Modulus the quote level by the max,
* ie, always have "1 <= quote level <= MAX"
* this allows cycling through the possible
* quote colors over again as the quote level
* grows arbitrarily deep. */
- quote_level = (quote_level-1)%MAX_QUOTED_COLOR;
+ quote_level = (quote_level-1)%MAX_QUOTED_COLOR + 1;
+
+ if (bm->wrap_text)
+ libbalsa_wrap_string(line, balsa_app.wraplength);
+
+ mini_lines = mini_l = g_strsplit(line, "\n", -1);
+ for (mini_line = *mini_lines; mini_line; mini_line =
+ *(++mini_lines)) {
+ mini_line = g_strconcat(mini_line, "\n", NULL);
gtk_text_insert_with_url(GTK_TEXT(item), fnt,
- &balsa_app.quoted_color[quote_level],
- line, &url_reg, &url_list, &ypos);
- } else
- gtk_text_insert_with_url(GTK_TEXT(item), fnt, NULL,
- line, &url_reg, &url_list, &ypos);
+ quote_level ? &balsa_app.quoted_color[quote_level - 1]
+ : NULL,
+ mini_line, &url_reg, &url_list, &ypos);
+ g_free(mini_line);
+ }
+ g_strfreev(mini_l);
g_free(line);
}
g_strfreev(l);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]