2006-07-08 [colin] 2.3.1cvs76
authorColin Leroy <colin@colino.net>
Sat, 8 Jul 2006 22:15:33 +0000 (22:15 +0000)
committerColin Leroy <colin@colino.net>
Sat, 8 Jul 2006 22:15:33 +0000 (22:15 +0000)
* src/compose.c
Svae RMID in drafted mails too
Save quote_fmt vars for whole mails,
don't reset at each quote_fmt_init:
allows to use the same |i{var} in
various template fields
* src/prefs_template.c
* src/quote_fmt.h
* src/quote_fmt_parse.y
Same

ChangeLog
PATCHSETS
configure.ac
src/compose.c
src/prefs_template.c
src/quote_fmt.h
src/quote_fmt_parse.y

index 24b938ebf65bacc716295003ed921232b39c0998..7b53379708793e77b053d90ca65f48efa81e97c7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2006-07-08 [colin]     2.3.1cvs76
+
+       * src/compose.c
+               Svae RMID in drafted mails too
+               Save quote_fmt vars for whole mails,
+               don't reset at each quote_fmt_init:
+               allows to use the same |i{var} in
+               various template fields
+       * src/prefs_template.c
+       * src/quote_fmt.h
+       * src/quote_fmt_parse.y
+               Same
+
 2006-07-08 [colin]     2.3.1cvs75
 
        * src/textview.c
index 585b00f80cc7f4465ee11ca8bf95bfa7eaf5dd4d..3ca0138c1e91336d9d424a0c2e77ad43710e3535 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.60.2.37 -r 1.60.2.38 src/prefs_actions.c;  ) > 2.3.1cvs73.patchset
 ( cvs diff -u -r 1.115.2.94 -r 1.115.2.95 src/main.c;  ) > 2.3.1cvs74.patchset
 ( cvs diff -u -r 1.96.2.125 -r 1.96.2.126 src/textview.c;  ) > 2.3.1cvs75.patchset
+( cvs diff -u -r 1.382.2.293 -r 1.382.2.294 src/compose.c;  cvs diff -u -r 1.12.2.27 -r 1.12.2.28 src/prefs_template.c;  cvs diff -u -r 1.5.12.4 -r 1.5.12.5 src/quote_fmt.h;  cvs diff -u -r 1.22.2.22 -r 1.22.2.23 src/quote_fmt_parse.y;  ) > 2.3.1cvs76.patchset
index 5fb09e8db11589f65a70401905b58e1c0960e704..91587172a44744d5e5e235334b56ad715a7064d5 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=3
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=75
+EXTRA_VERSION=76
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 2df9191b1d23dc762e7e1e9303395c81de097262..326a0acb35cd17363a07efc1a53fbc189735ef25 100644 (file)
@@ -1316,6 +1316,7 @@ static Compose *compose_generic_reply(MsgInfo *msginfo, gboolean quote,
                compose_quote_fmt(compose, compose->replyinfo,
                                  prefs_common.quotefmt,
                                  qmark, body, FALSE);
+               quote_fmt_reset_vartable();
        }
        if (procmime_msginfo_is_encrypted(compose->replyinfo)) {
                compose_force_encryption(compose, account, FALSE);
@@ -1431,6 +1432,7 @@ Compose *compose_forward(PrefsAccount *account, MsgInfo *msginfo,
                compose_quote_fmt(compose, full_msginfo,
                                  prefs_common.fw_quotefmt,
                                  qmark, body, FALSE);
+               quote_fmt_reset_vartable();
                compose_attach_parts(compose, msginfo);
 
                procmsg_msginfo_free(full_msginfo);
@@ -1876,6 +1878,7 @@ Compose *compose_redirect(PrefsAccount *account, MsgInfo *msginfo,
        gtk_editable_set_editable(GTK_EDITABLE(compose->subject_entry), FALSE);
 
        compose_quote_fmt(compose, msginfo, "%M", NULL, NULL, FALSE);
+       quote_fmt_reset_vartable();
        gtk_text_view_set_editable(GTK_TEXT_VIEW(compose->text), FALSE);
 
        compose_colorize_signature(compose);
@@ -6568,7 +6571,7 @@ static void compose_template_apply(Compose *compose, Template *tmpl,
 
        /* process the other fields */
        compose_template_apply_fields(compose, tmpl);
-       
+       quote_fmt_reset_vartable();
        compose_changed_cb(NULL, compose);
 }
 
@@ -7614,6 +7617,15 @@ static void compose_draft_cb(gpointer data, guint action, GtkWidget *widget)
                fprintf(fp, "X-Sylpheed-Privacy-System:%s\n", compose->privacy_system);
        }
 
+       /* Message-ID of message replying to */
+       if ((compose->replyinfo != NULL) && (compose->replyinfo->msgid != NULL)) {
+               gchar *folderid;
+               
+               folderid = folder_item_get_identifier(compose->replyinfo->folder);
+               fprintf(fp, "RMID:%s\t%d\t%s\n", folderid, compose->replyinfo->msgnum, compose->replyinfo->msgid);
+               g_free(folderid);
+       }
+
        /* end of headers */
        fprintf(fp, "X-Sylpheed-End-Special-Headers: 1\n");
 
@@ -8735,6 +8747,7 @@ static void text_inserted(GtkTextBuffer *buffer, GtkTextIter *iter,
                gtk_text_buffer_place_cursor(buffer, iter);
 
                compose_quote_fmt(compose, NULL, "%Q", qmark, new_text, TRUE);
+               quote_fmt_reset_vartable();
                g_free(new_text);
                g_object_set_data(G_OBJECT(compose->text), "paste_as_quotation",
                                  GINT_TO_POINTER(paste_as_quotation - 1));
index 3e5e7fb0dd881ed8a8081a7efc9b8463bf8f341a..4b09b5d09614b7dcabe7943e1498989171365341 100644 (file)
@@ -522,6 +522,7 @@ static gboolean prefs_template_list_view_set_row(GtkTreeIter *row)
                        g_free(value);
                        return FALSE;
                }
+               quote_fmt_reset_vartable();
        }
 
        name = gtk_editable_get_chars(GTK_EDITABLE(templates.entry_name),
index ca6859a0c3d598ef9e82999a93f95adaed0d7f7d..31a747b8374084e98263b551f4326e716fea70b8 100644 (file)
@@ -11,7 +11,7 @@ void quote_fmt_init(MsgInfo *info, const gchar *my_quote_str,
                    const gchar *my_body, gboolean my_dry_run);
 gint quote_fmtparse(void);
 void quote_fmt_scan_string(const gchar *str);
-
+void quote_fmt_reset_vartable(void);
 gint quote_fmt_get_cursor_pos(void);
 
 #endif /* __QUOTE_FMT_H__ */
index 5d4681438094f6527a95b6e3999dd5ce927543c7..2fdc01937af19ffdd7641dd2b0cfc3d2200b1565 100644 (file)
@@ -146,6 +146,14 @@ gint quote_fmt_get_cursor_pos(void)
                add_buffer(tmp); \
        }
 
+void quote_fmt_reset_vartable(void)
+{
+       if (var_table) {
+               g_hash_table_destroy(var_table);
+               var_table = NULL;
+       }
+}
+
 void quote_fmt_init(MsgInfo *info, const gchar *my_quote_str,
                    const gchar *my_body, gboolean my_dry_run)
 {
@@ -160,11 +168,10 @@ void quote_fmt_init(MsgInfo *info, const gchar *my_quote_str,
        current = &main_expr;
        clear_buffer();
        error = 0;
-       if (var_table) {
-               g_hash_table_destroy(var_table);
-               var_table = NULL;
-       }
-       var_table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
+
+       if (!var_table)
+               var_table = g_hash_table_new_full(g_str_hash, g_str_equal, 
+                               g_free, g_free);
 
         /*
          * force LEX initialization