%X marks the cursor spot for reply quote format
authorAlfons Hoogervorst <alfons@proteus.demon.nl>
Tue, 17 Feb 2004 18:40:13 +0000 (18:40 +0000)
committerAlfons Hoogervorst <alfons@proteus.demon.nl>
Tue, 17 Feb 2004 18:40:13 +0000 (18:40 +0000)
* src/quote_fmt_lex.l
  src/quote_fmt.c
add %X token

* src/quote_fmt.h
  src/quote_fmt_parse.y
handle %X token

* src/compose.c
handle %X token for replies only (for now)

ChangeLog.claws
configure.ac
src/compose.c
src/quote_fmt.c
src/quote_fmt.h
src/quote_fmt_lex.l
src/quote_fmt_parse.y

index 0f71e17a71fb46b9a6b972b798f7a7e61c3bcc6f..af5938d1c7d7bb36a80b7f48ddbc3becc4f30c89 100644 (file)
@@ -1,3 +1,18 @@
+2004-02-17 [alfons]    0.9.9claws21
+
+       %X marks the cursor spot for reply quote format
+
+       * src/quote_fmt_lex.l 
+         src/quote_fmt.c
+               add %X token
+               
+       * src/quote_fmt.h
+         src/quote_fmt_parse.y
+               handle %X token
+               
+       * src/compose.c
+               handle %X token for replies only (for now)
+
 2004-02-17 [paul]      0.9.9claws20
 
        * po/sk.po
 2004-02-17 [paul]      0.9.9claws20
 
        * po/sk.po
index 7f8bdbe390a826e82b924ab2bebe711064901c2e..5a50e04a922b31f7abac33cacfacdb7cf54098ce 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=9
 INTERFACE_AGE=0
 BINARY_AGE=0
 MICRO_VERSION=9
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=20
+EXTRA_VERSION=21
 if test $EXTRA_VERSION -eq 0; then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
 else
 if test $EXTRA_VERSION -eq 0; then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
 else
@@ -90,6 +90,7 @@ AM_ICONV
 dnl for gettext
 ALL_LINGUAS="bg cs de el en_GB es fr hr hu it ja ko nl pl pt_BR ru sk sr sv zh_CN zh_TW.Big5"
 AM_GNU_GETTEXT([use-libtool])
 dnl for gettext
 ALL_LINGUAS="bg cs de el en_GB es fr hr hu it ja ko nl pl pt_BR ru sk sr sv zh_CN zh_TW.Big5"
 AM_GNU_GETTEXT([use-libtool])
+AM_GNU_GETTEXT_VERSION(0.12.1)
 dnl AC_CHECK_FUNC(gettext, AC_CHECK_LIB(intl, gettext))
 localedir='${prefix}/${DATADIRNAME}/locale'
 AC_SUBST(localedir)
 dnl AC_CHECK_FUNC(gettext, AC_CHECK_LIB(intl, gettext))
 localedir='${prefix}/${DATADIRNAME}/locale'
 AC_SUBST(localedir)
index 5113956a951b94b89eba5289e3b61b9d165de79e..55d130678501f71674653784f2f47031766c6a88 100644 (file)
@@ -1008,13 +1008,20 @@ static void compose_generic_reply(MsgInfo *msginfo, gboolean quote,
        if (account->auto_sig)
                compose_insert_sig(compose, FALSE);
 
        if (account->auto_sig)
                compose_insert_sig(compose, FALSE);
 
-       if (quote && prefs_common.linewrap_quote)
-               compose_wrap_line_all(compose);
+       /* Must thaw here, otherwise the GtkSTextEdit will become confused 
+        * when positioning cursor */
+       gtk_stext_thaw(text);
 
 
-       gtk_editable_set_position(GTK_EDITABLE(text), 0);
-       gtk_stext_set_point(text, 0);
+       gtk_editable_set_position
+               (GTK_EDITABLE(text), quote_fmt_get_cursor_pos());
+       gtk_stext_set_point(text, quote_fmt_get_cursor_pos());
+
+       if (quote && prefs_common.linewrap_quote) {
+               gtk_stext_freeze(text);
+               compose_wrap_line_all(compose);
+               gtk_stext_thaw(text);
+       }
 
 
-       gtk_stext_thaw(text);
        gtk_widget_grab_focus(compose->text);
 
        if (prefs_common.auto_exteditor)
        gtk_widget_grab_focus(compose->text);
 
        if (prefs_common.auto_exteditor)
index 3ac7d9a0ff2aba6db3c7df316ec32f2b928b3719..bc6cbb6aec49ac0ed79732ef3f82cec8e3b1bde7 100644 (file)
@@ -54,6 +54,7 @@ static gchar *quote_desc_strings[] = {
        "%Q",           N_("Quoted message body"), /* quoted message */ 
        "%m",           N_("Message body without signature"), /* message with no signature */ 
        "%q",           N_("Quoted message body without signature"), /* quoted message with no signature */ 
        "%Q",           N_("Quoted message body"), /* quoted message */ 
        "%m",           N_("Message body without signature"), /* message with no signature */ 
        "%q",           N_("Quoted message body without signature"), /* quoted message with no signature */ 
+       "%X",           N_("Cursor position"), /* X marks the cursor spot */
        "",             NULL,
        "?x{expr}",     N_("Insert expr if x is set\nx is one of the characters above after %"),
        "",             NULL,
        "",             NULL,
        "?x{expr}",     N_("Insert expr if x is set\nx is one of the characters above after %"),
        "",             NULL,
index f192f316923b9fb156869198a3f29d64fda449b5..4d352bd224f85dbaec04525a113d515417a0dc3a 100644 (file)
@@ -12,4 +12,6 @@ void quote_fmt_init(MsgInfo *info, const gchar *my_quote_str,
 gint quote_fmtparse(void);
 void quote_fmt_scan_string(const gchar *str);
 
 gint quote_fmtparse(void);
 void quote_fmt_scan_string(const gchar *str);
 
+gint quote_fmtparse_get_cursor_pos(void);
+
 #endif /* __QUOTE_FMT_H__ */
 #endif /* __QUOTE_FMT_H__ */
index f5ac10c95a3ca325ec9c293b5793af34c3675311..5c35a7d7aeac7cd48da251c9b83f7a227ce516ab 100644 (file)
@@ -49,6 +49,7 @@ static int firsttime = 1;
        }       
 %}
 
        }       
 %}
 
+<S_NORMAL>"%X" /* cursor pos */ return SET_CURSOR_POS;
 <S_NORMAL>"%c" /* cc */ return SHOW_CC;
 <S_NORMAL>"%d" /* date */ return SHOW_DATE;
 <S_NORMAL>"%D" /* date */ { BEGIN S_DATE; return SHOW_DATE_EXPR; }
 <S_NORMAL>"%c" /* cc */ return SHOW_CC;
 <S_NORMAL>"%d" /* date */ return SHOW_DATE;
 <S_NORMAL>"%D" /* date */ { BEGIN S_DATE; return SHOW_DATE_EXPR; }
index 605cbd9a01e479063b2f7485f399179f82c5dcce..722c69e07a7a8f7b172633a35bd4f207637600fd 100644 (file)
@@ -52,6 +52,8 @@ static const gchar *quote_str = NULL;
 static const gchar *body = NULL;
 static gint error = 0;
 
 static const gchar *body = NULL;
 static gint error = 0;
 
+static gint cursor_pos  = 0;
+
 static void add_visibility(gboolean val)
 {
        stacksize++;
 static void add_visibility(gboolean val)
 {
        stacksize++;
@@ -94,6 +96,11 @@ gchar *quote_fmt_get_buffer(void)
                return buffer;
 }
 
                return buffer;
 }
 
+gint quote_fmt_get_cursor_pos(void)
+{
+       return cursor_pos;      
+}
+
 #define INSERT(buf) \
        if (stacksize != 0 && visible[stacksize - 1]) \
                add_buffer(buf)
 #define INSERT(buf) \
        if (stacksize != 0 && visible[stacksize - 1]) \
                add_buffer(buf)
@@ -118,6 +125,7 @@ void quote_fmt_init(MsgInfo *info, const gchar *my_quote_str,
                *buffer = 0;
        bufsize = 0;
        error = 0;
                *buffer = 0;
        bufsize = 0;
        error = 0;
+       cursor_pos = 0;
 }
 
 void quote_fmterror(char *str)
 }
 
 void quote_fmterror(char *str)
@@ -156,6 +164,7 @@ static int isseparator(int ch)
 %token OPARENT CPARENT
 %token CHARACTER
 %token SHOW_DATE_EXPR
 %token OPARENT CPARENT
 %token CHARACTER
 %token SHOW_DATE_EXPR
+%token SET_CURSOR_POS
 
 %start quote_fmt
 
 
 %start quote_fmt
 
@@ -507,6 +516,10 @@ special:
        | SHOW_CPARENT
        {
                INSERT("}");
        | SHOW_CPARENT
        {
                INSERT("}");
+       }
+       | SET_CURSOR_POS
+       {
+               cursor_pos = bufsize;
        };
 
 query:
        };
 
 query: