2007-05-23 [wwp] 2.9.2cvs13
authorTristan Chabredier <wwp@claws-mail.org>
Wed, 23 May 2007 17:19:50 +0000 (17:19 +0000)
committerTristan Chabredier <wwp@claws-mail.org>
Wed, 23 May 2007 17:19:50 +0000 (17:19 +0000)
* src/compose.c
* src/prefs_compose_writing.c
* src/prefs_quote.c
* src/prefs_template.c
* src/prefs_template.h
* src/quote_fmt.c
* src/quote_fmt.h
* src/quote_fmt_lex.l
* src/quote_fmt_parse.y
Introduced new syntax elements (symbols and commands)
in templates/quote_fmt. Compatibility w/ old
symbols is kept.
Updated and reworked the corresponding Information
dialog.
Display the line number in dialogs that talk about
parser errors (in addition to the error message in
output).

12 files changed:
ChangeLog
PATCHSETS
configure.ac
src/compose.c
src/prefs_compose_writing.c
src/prefs_quote.c
src/prefs_template.c
src/prefs_template.h
src/quote_fmt.c
src/quote_fmt.h
src/quote_fmt_lex.l
src/quote_fmt_parse.y

index be9f09a5c23922658b6e4c85d9274dd700c2fafe..13c93a18d8d70c6440bca69e6539b91ba76efdde 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2007-05-23 [wwp]       2.9.2cvs13
+
+       * src/compose.c
+       * src/prefs_compose_writing.c
+       * src/prefs_quote.c
+       * src/prefs_template.c
+       * src/prefs_template.h
+       * src/quote_fmt.c
+       * src/quote_fmt.h
+       * src/quote_fmt_lex.l
+       * src/quote_fmt_parse.y
+               Introduced new syntax elements (symbols and commands)
+               in templates/quote_fmt. Compatibility w/ old
+               symbols is kept.
+               Updated and reworked the corresponding Information
+               dialog.
+               Display the line number in dialogs that talk about
+               parser errors (in addition to the error message in
+               output).
+
 2007-05-23 [wwp]       2.9.2cvs12
 
        * src/quote_fmt_parse.y
index 43259333ed34f666ad82f258e259d3b6d32b1f87..83e5d281264be50aa86f5334b8aed8b7b4311b13 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.382.2.377 -r 1.382.2.378 src/compose.c;  cvs diff -u -r 1.12.2.41 -r 1.12.2.42 src/prefs_template.c;  cvs diff -u -r 1.8.2.15 -r 1.8.2.16 src/quote_fmt.c;  cvs diff -u -r 1.5.12.6 -r 1.5.12.7 src/quote_fmt.h;  cvs diff -u -r 1.8.2.9 -r 1.8.2.10 src/quote_fmt_lex.l;  cvs diff -u -r 1.22.2.28 -r 1.22.2.29 src/quote_fmt_parse.y;  cvs diff -u -r 1.9.2.50 -r 1.9.2.51 src/gtk/gtkaspell.c;  cvs diff -u -r 1.5.2.11 -r 1.5.2.12 src/gtk/gtkaspell.h;  ) > 2.9.2cvs10.patchset
 ( cvs diff -u -r 1.382.2.378 -r 1.382.2.379 src/compose.c;  cvs diff -u -r 1.12.2.42 -r 1.12.2.43 src/prefs_template.c;  cvs diff -u -r 1.5.12.7 -r 1.5.12.8 src/quote_fmt.h;  cvs diff -u -r 1.22.2.29 -r 1.22.2.30 src/quote_fmt_parse.y;  ) > 2.9.2cvs11.patchset
 ( cvs diff -u -r 1.22.2.30 -r 1.22.2.31 src/quote_fmt_parse.y;  ) > 2.9.2cvs12.patchset
+( cvs diff -u -r 1.382.2.379 -r 1.382.2.380 src/compose.c;  cvs diff -u -r 1.1.2.17 -r 1.1.2.18 src/prefs_compose_writing.c;  cvs diff -u -r 1.1.2.17 -r 1.1.2.18 src/prefs_quote.c;  cvs diff -u -r 1.12.2.43 -r 1.12.2.44 src/prefs_template.c;  cvs diff -u -r 1.1.16.5 -r 1.1.16.6 src/prefs_template.h;  cvs diff -u -r 1.8.2.16 -r 1.8.2.17 src/quote_fmt.c;  cvs diff -u -r 1.5.12.8 -r 1.5.12.9 src/quote_fmt.h;  cvs diff -u -r 1.8.2.10 -r 1.8.2.11 src/quote_fmt_lex.l;  cvs diff -u -r 1.22.2.31 -r 1.22.2.32 src/quote_fmt_parse.y;  ) > 2.9.2cvs13.patchset
index 57196b9bc65ad6cfbea58207f9bd0544ab6b7051..dc909cb0c851fe4f4ba8ca97044f8e3e690852b7 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=2
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=12
+EXTRA_VERSION=13
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 9cdec9daacbacb4c5def156c1dccaadc05e3beb4..ca4eeb45092d04c7f146ad74a1b7480883228638 100644 (file)
@@ -1081,7 +1081,7 @@ Compose *compose_generic_new(PrefsAccount *account, const gchar *mailto, FolderI
                        compose_quote_fmt(compose, dummyinfo,
                                          prefs_common.compose_body_format,
                                          NULL, tmp, FALSE, TRUE,
-                                                 _("New message body format error."));
+                                                 _("New message body format error at line %d."));
                        quote_fmt_reset_vartable();
 
                        g_free(tmp);
@@ -1443,7 +1443,7 @@ static Compose *compose_generic_reply(MsgInfo *msginfo, gboolean quote,
                compose_quote_fmt(compose, compose->replyinfo,
                                  prefs_common.quotefmt,
                                  qmark, body, FALSE, TRUE,
-                                         _("Message reply format error."));
+                                         _("Message reply format error at line %d."));
                quote_fmt_reset_vartable();
        }
        if (procmime_msginfo_is_encrypted(compose->replyinfo)) {
@@ -1560,7 +1560,7 @@ Compose *compose_forward(PrefsAccount *account, MsgInfo *msginfo,
                compose_quote_fmt(compose, full_msginfo,
                                  prefs_common.fw_quotefmt,
                                  qmark, body, FALSE, TRUE,
-                                         _("Message forward format error."));
+                                         _("Message forward format error at line %d."));
                quote_fmt_reset_vartable();
                compose_attach_parts(compose, msginfo);
 
@@ -2055,7 +2055,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, FALSE,
-                                         _("Message redirect format error."));
+                                         _("Message redirect format error at line %d."));
        quote_fmt_reset_vartable();
        gtk_text_view_set_editable(GTK_TEXT_VIEW(compose->text), FALSE);
 
@@ -2582,7 +2582,10 @@ static gchar *compose_quote_fmt(Compose *compose, MsgInfo *msginfo,
 
                buf = quote_fmt_get_buffer();
                if (buf == NULL) {
-                       alertpanel_error(err_msg);
+                       gint line = quote_fmt_get_line();
+                       gchar *msg = g_strdup_printf(err_msg, line);
+                       alertpanel_error(msg);
+                       g_free(msg);
                        goto error;
                }
        } else
@@ -7063,7 +7066,7 @@ static void compose_template_apply(Compose *compose, Template *tmpl,
        gchar *qmark;
        gchar *parsed_str = NULL;
        gint cursor_pos = 0;
-       const gchar *err_msg = _("Template body format error.");
+       const gchar *err_msg = _("Template body format error at line %d.");
        if (!tmpl) return;
 
        /* process the body */
@@ -9488,7 +9491,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, FALSE,
-                                                 _("Quote format error."));
+                                                 _("Quote format error at line %d."));
                quote_fmt_reset_vartable();
                g_free(new_text);
                g_object_set_data(G_OBJECT(compose->text), "paste_as_quotation",
index 8765bf0dc1c0ded6ca3bdf645dfeb07964a9ba7c..d3b44cc59a615429c1bfd8aaf16c300030a123e9 100644 (file)
@@ -332,6 +332,7 @@ static void prefs_compose_writing_save(PrefsPage *_page)
 {
        GtkWidget *menu;
        GtkWidget *menuitem;
+       gint line = -1;
 
        WritingPage *page = (WritingPage *) _page;
        prefs_common.auto_exteditor = 
@@ -365,12 +366,15 @@ static void prefs_compose_writing_save(PrefsPage *_page)
                gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_compose_with_format));
        prefs_common.compose_subject_format = pref_get_pref_from_entry(
                        GTK_ENTRY(page->entry_subject));
-       if (!prefs_template_string_is_valid(prefs_common.compose_subject_format))
+       if (!prefs_template_string_is_valid(prefs_common.compose_subject_format, NULL))
                alertpanel_error(_("New message subject format error."));
        prefs_common.compose_body_format = pref_get_pref_from_textview(
                        GTK_TEXT_VIEW(page->text_format));
-       if (!prefs_template_string_is_valid(prefs_common.compose_body_format))
-               alertpanel_error(_("New message body format error."));
+       if (!prefs_template_string_is_valid(prefs_common.compose_body_format, &line)) {
+               gchar *msg = g_strdup_printf(_("New message body format error at line %d."), line);
+               alertpanel_error(msg);
+               g_free(msg);
+       }
 }
 
 static void prefs_compose_writing_destroy_widget(PrefsPage *_page)
index 741495a8961960504be2fc65061307c9ef9908ac..568216a8c820db9da44c237ceae8fdb21da1ec0e 100644 (file)
@@ -263,6 +263,7 @@ static void prefs_quote_create_widget(PrefsPage *_page, GtkWindow *window,
 static void prefs_quote_save(PrefsPage *_page)
 {
        QuotePage *page = (QuotePage *) _page;
+       gint line = -1;
        
        g_free(prefs_common.quotefmt); 
        prefs_common.quotefmt = NULL;
@@ -277,13 +278,19 @@ static void prefs_quote_save(PrefsPage *_page)
        
        prefs_common.quotefmt = pref_get_pref_from_textview(
                        GTK_TEXT_VIEW(page->text_quotefmt));
-       if (!prefs_template_string_is_valid(prefs_common.quotefmt))
-               alertpanel_error(_("Message reply format error."));
+       if (!prefs_template_string_is_valid(prefs_common.quotefmt, &line)) {
+               gchar *msg = g_strdup_printf(_("Message reply format error at line %d."), line);
+               alertpanel_error(msg);
+               g_free(msg);
+       }
 
        prefs_common.fw_quotefmt = pref_get_pref_from_textview(
                        GTK_TEXT_VIEW(page->text_fw_quotefmt));
-       if (!prefs_template_string_is_valid(prefs_common.fw_quotefmt))
-               alertpanel_error(_("Message forward format error."));
+       if (!prefs_template_string_is_valid(prefs_common.fw_quotefmt, &line)) {
+               gchar *msg = g_strdup_printf(_("Message forward format error at line %d."), line);
+               alertpanel_error(msg);
+               g_free(msg);
+       }
 
        prefs_common.quotemark = gtk_editable_get_chars(
                        GTK_EDITABLE(page->entry_quotemark), 0, -1);
index 2813d8f55af28f73ba00cc6d3a8319f60d146d89..9d918ac0c0b1fe93136360030257b0fa5d7dbc5c 100644 (file)
@@ -550,7 +550,7 @@ static GSList *prefs_template_get_list(void)
        return tmpl_list;
 }
 
-gboolean prefs_template_string_is_valid(gchar *string)
+gboolean prefs_template_string_is_valid(gchar *string, gint *line)
 {
        if (string && *string != '\0') {
                gchar *parsed_buf;
@@ -565,8 +565,11 @@ gboolean prefs_template_string_is_valid(gchar *string)
                quote_fmt_scan_string(string);
                quote_fmt_parse();
                parsed_buf = quote_fmt_get_buffer();
-               if (!parsed_buf)
+               if (!parsed_buf) {
+                       if (line)
+                               *line = quote_fmt_get_line();
                        return FALSE;
+               }
                quote_fmt_reset_vartable();
        }
        return TRUE;
@@ -585,6 +588,7 @@ static gboolean prefs_template_list_view_set_row(GtkTreeIter *row)
        GtkTextBuffer *buffer;
        GtkTextIter start, end;
        GtkTreeModel *model;
+       gint line;
 
        model = gtk_tree_view_get_model(GTK_TREE_VIEW(templates.list_view));
 
@@ -597,8 +601,12 @@ static gboolean prefs_template_list_view_set_row(GtkTreeIter *row)
                        g_free(value);
                value = NULL;
                }
-       if (!prefs_template_string_is_valid(value)) {
-               alertpanel_error(_("Template body format error."));     
+       if (!prefs_template_string_is_valid(value, &line)) {
+               gchar *msg;
+
+               msg = g_strdup_printf(_("Template body format error at line %d."), line);
+               alertpanel_error(msg);
+               g_free(msg);
                g_free(value);
                return FALSE;
        }
@@ -635,22 +643,22 @@ static gboolean prefs_template_list_view_set_row(GtkTreeIter *row)
                subject = NULL;
        }
 
-       if (!prefs_template_string_is_valid(to)) {
+       if (!prefs_template_string_is_valid(to, NULL)) {
                alertpanel_error(_("Template To format error."));
                g_free(to);
                return FALSE;
        }
-       if (!prefs_template_string_is_valid(cc)) {
+       if (!prefs_template_string_is_valid(cc, NULL)) {
                alertpanel_error(_("Template Cc format error."));       
                g_free(cc);
                return FALSE;
        }
-       if (!prefs_template_string_is_valid(bcc)) {
+       if (!prefs_template_string_is_valid(bcc, NULL)) {
                alertpanel_error(_("Template Bcc format error."));      
                g_free(bcc);
                return FALSE;
        }
-       if (!prefs_template_string_is_valid(subject)) {
+       if (!prefs_template_string_is_valid(subject, NULL)) {
                alertpanel_error(_("Template subject format error."));  
                g_free(subject);
                return FALSE;
index 42e3ed9599fe7f84c7ea9415151533d228216696..985774b00b0860b473cb95374d4187ec386ab650 100644 (file)
@@ -22,6 +22,6 @@
 #define __PREFS_TEMPLATES_H__
 
 void prefs_template_open(void);
-gboolean prefs_template_string_is_valid(gchar *string);
+gboolean prefs_template_string_is_valid(gchar *string, gint *line);
 
 #endif /* __PREFS_TEMPLATES_H__ */
index e0729fb8246c92d59bd21e90b66520df2bac4a22..5b0916927b5236c515a21d21d9c023a5b1297ca6 100644 (file)
  * When adding new lines, remember to put 2 strings for each line
  */
 static gchar *quote_desc_strings[] = {
-       "%D{fmt}",      N_("customized date format (see 'man strftime')"), /* date expression */
-       "%d",           N_("Date"), /* date */
-       "%f",           N_("From"), /* from */
-       "%A",           N_("email address of sender"), /* email address */
-       "%N",           N_("full name of sender"), /* full name */
-       "%F",           N_("first name of sender"), /* first name */
-       "%L",           N_("last name of sender"), /* last name */
-       "%I",           N_("initials of sender"), /* initial of sender */
-       "%s",           N_("Subject"), /* subject */ 
-       "%t",           N_("To"), /* to */ 
-       "%c",           N_("Cc"), /* cc */ 
-       "%n",           N_("Newsgroups"), /* newsgroups */ 
-       "%r",           N_("References"), /* references */ 
-       "%i",           N_("Message-ID"), /* message-id */ 
-       "%M",           N_("message body"), /* message */
-       "%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 */
-       "%T",           N_("current dictionary"), /* current dictionary */
-       "%X",           N_("cursor position"), /* X marks the cursor spot */
-       "%af",          N_("account property: your name"), /* full name in compose account */
-       "%am",          N_("account property: your email address"), /* mail address in compose account */
-       "%an",          N_("account property: account name"), /* compose account name itself */
-       "%ao",          N_("account property: organization"), /* organization in compose account */
-       "%aT",          N_("account property: default dictionary"), /* main dict (if enabled) in account */
-       "%ABc",         N_("address book completion: Cc"), /* completion of 'Cc' from address book */
-       "%ABf",         N_("address book completion: From"), /* completion of 'From' from address book */
-       "%ABt",         N_("address book completion: To"), /* completion of 'To' from address book */
-       "\\%",          N_("literal %"),
-       "\\\\",         N_("literal backslash"),
-       "\\?",          N_("literal question mark"),
-       "\\!",          N_("literal exclamation mark"),
-       "\\|",          N_("literal pipe"),
-       "\\{",          N_("literal opening curly brace"),
-       "\\}",          N_("literal closing curly brace"),
-       "\\t",          N_("tab"),
-       "\\n",          N_("linefeed"),
-       "",             NULL,
-       "?x{expr}\n",   N_("insert expr if x is set\n(where x is one of the dfNFLIstcnriT characters or ad, af, ao, aT, ABc, ABf, ABt)"),
-       "!x{expr}\n",   N_("insert expr if x is not set\n(where x is one of the dfNFLIstcnriT characters or ad, af, ao, aT, ABc, ABf, ABt)"),
-       "|f{sub_expr}\n",       N_("insert file:\nsub_expr is evaluated as a filename to insert"), /* insert file */
-       "|p{sub_expr}\n\n",     N_("insert program output:\nsub_expr is evaluated as a command-line to get\nthe output from"), /* insert program output */
-       "|i{sub_expr}\n\n",     N_("insert user input:\nsub_expr is a variable to be replaced by\nuser-entered text"), /* insert user input */
-       "",             NULL,
-       N_("terms definition:"),        NULL,
-       "expr",                 N_("text that can contain any of the symbols above"),
-       "sub_expr\n",   N_("text that can contain any of the symbols above\nbut ?x{}, !x{}, |f{}, |p{} and |i{}"),
+       N_("<span weight=\"bold\">symbols:</span>"),                            NULL,
+       "%date_fmt{<span style=\"oblique\">fmt</span>} (%D{<span style=\"oblique\">fmt</span>})",       N_("customized date format (see 'man strftime')"), /* date expression */
+       "%date (%d)",                           N_("Date"), /* date */
+       "%from (%f)",                           N_("From"), /* from */
+       "%email (%A)",                          N_("email address of sender"), /* email address */
+       "%fullname (%N)",                       N_("full name of sender"), /* full name */
+       "%firstname (%F)",                      N_("first name of sender"), /* first name */
+       "%lastname (%L)",                       N_("last name of sender"), /* last name */
+       "%initials (%I)",                       N_("initials of sender"), /* initial of sender */
+       "%subject (%s)",                        N_("Subject"), /* subject */ 
+       "%to (%t)",                                     N_("To"), /* to */ 
+       "%cc (%c)",                                     N_("Cc"), /* cc */ 
+       "%newsgroups (%n)",                     N_("Newsgroups"), /* newsgroups */ 
+       "%references (%r)",                     N_("References"), /* references */ 
+       "%messageid (%i)",                      N_("Message-ID"), /* message-id */ 
+       "%msg (%M)",                            N_("message body"), /* message */
+       "%quoted_msg (%Q)",                     N_("quoted message body"), /* quoted message */
+       "%msg_no_sig (%m)",                     N_("message body without signature"), /* message with no signature */
+       "%quoted_msg_no_sig (%q)",      N_("quoted message body without signature"), /* quoted message with no signature */
+       "%dict (%T)",                           N_("current dictionary"), /* current dictionary */
+       "%cursor (%X)",                         N_("cursor position"), /* X marks the cursor spot */
+       "%account_fullname (%af)",      N_("account property: your name"), /* full name in compose account */
+       "%account_email (%ae)",         N_("account property: your email address"), /* mail address in compose account */
+       "%account_name (%an)",          N_("account property: account name"), /* compose account name itself */
+       "%account_org (%ao)",           N_("account property: organization"), /* organization in compose account */
+       "%account_dict (%aT)",          N_("account property: default dictionary"), /* main dict (if enabled) in account */
+       "%addrbook_cc (%ABc)",          N_("address book <span style=\"oblique\">completion</span>: Cc"), /* completion of 'Cc' from address book */
+       "%addrbook_from (%ABf)",        N_("address book <span style=\"oblique\">completion</span>: From"), /* completion of 'From' from address book */
+       "%addrbook_to (%ABt)",          N_("address book <span style=\"oblique\">completion</span>: To"), /* completion of 'To' from address book */
+       "\\%",                          N_("literal %"),
+       "\\\\",                         N_("literal backslash"),
+       "\\?",                          N_("literal question mark"),
+       "\\!",                          N_("literal exclamation mark"),
+       "\\|",                          N_("literal pipe"),
+       "\\{",                          N_("literal opening curly brace"),
+       "\\}",                          N_("literal closing curly brace"),
+       "\\t",                          N_("tab"),
+       "\\n",                          N_("new line"),
+       "",                                     NULL,
+       N_("<span weight=\"bold\">commands:</span>"),           NULL,
+       "?x{<span style=\"oblique\">expr</span>}\n\n",          N_("insert <span style=\"oblique\">expr</span> if x is set, where x is one of\nthe [dfNFLIstcnriT, ad, af, ao, aT, ABc, ABf, ABt]\nsymbols (or their long equivalent)"),
+       "!x{<span style=\"oblique\">expr</span>}\n\n",          N_("insert <span style=\"oblique\">expr</span> if x is not set, where x is one of\nthe [dfNFLIstcnriT, ad, af, ao, aT, ABc, ABf, ABt]\nsymbols (or their long equivalent)"),
+       "|file{<span style=\"oblique\">sub_expr</span>}\n(|f{<span style=\"oblique\">sub_expr</span>})",                N_("insert file:\n<span style=\"oblique\">sub_expr</span> is evaluated as the path of the file to insert"), /* insert file */
+       "|program{<span style=\"oblique\">sub_expr</span>}\n(|p{<span style=\"oblique\">sub_expr</span>})\n",   N_("insert program output:\n<span style=\"oblique\">sub_expr</span> is evaluated as a command-line to get\nthe output from"), /* insert program output */
+       "|input{<span style=\"oblique\">sub_expr</span>}\n(|i{<span style=\"oblique\">sub_expr</span>})\n",             N_("insert user input:\n<span style=\"oblique\">sub_expr</span> is a variable to be replaced by\nuser-entered text"), /* insert user input */
+       "",                                     NULL,
+       N_("<span weight=\"bold\">definition of terms:</span>"),        NULL,
+       "<span style=\"oblique\">expr</span>\n",                        N_("text that can contain any of the symbols or\ncommands above"),
+       "<span style=\"oblique\">sub_expr</span>\n",            N_("text that can contain any of the symbols (no\ncommands) above"),
+       "<span style=\"oblique\">completion</span>\n\n\n",      N_("completion from address book only works with the first\naddress of the header, it outputs the full name\nof the contact if that address matches exactly\none contact in the address book"),
        NULL,NULL
 };
 
@@ -92,7 +95,7 @@ static DescriptionWindow quote_desc_win = {
        NULL,
         2,
         N_("Description of symbols"),
-       N_("The following symbols can be used:"),
+       N_("The following symbols and commands can be used:"),
         quote_desc_strings
 };
 
index 975dfcfa0d5e7f1c7b359dbe5c7812b68592a41a..d99a772d75cb0f0844479ceaca0f6171bc2e2dc8 100644 (file)
@@ -11,6 +11,7 @@
 void quote_fmt_quote_description(void);
 
 gchar *quote_fmt_get_buffer(void);
+gint quote_fmt_get_line(void);
 #ifdef USE_ASPELL
 void quote_fmt_init(MsgInfo *info, const gchar *my_quote_str,
                    const gchar *my_body, gboolean my_dry_run,
index 13ac3fab19145304049d02e72132bf24e81b39ba..b84f1623e60354e479acd2c6ec2d9b9baad0980e 100644 (file)
@@ -70,34 +70,34 @@ int line = -1;
        }       
 %}
 
-<S_NORMAL>"%X" /* cursor pos */ return SET_CURSOR_POS;
-<S_NORMAL>"%A" /* email address */ return SHOW_MAIL_ADDRESS;
-<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>"%f" /* from */ return SHOW_FROM;
-<S_NORMAL>"%F" /* first name */ return SHOW_FIRST_NAME;
-<S_NORMAL>"%i" /* message-id */ return SHOW_MESSAGEID;
-<S_NORMAL>"%I" /* initial of sender */ return SHOW_SENDER_INITIAL;
-<S_NORMAL>"%m" /* message with no signature */ return SHOW_MESSAGE_NO_SIGNATURE;
-<S_NORMAL>"%M" /* message */ return SHOW_MESSAGE;
-<S_NORMAL>"%n" /* newsgroups */ return SHOW_NEWSGROUPS;
-<S_NORMAL>"%N" /* full name */ return SHOW_FULLNAME;
-<S_NORMAL>"%L" /* last name */ return SHOW_LAST_NAME;
-<S_NORMAL>"%r" /* references */ return SHOW_REFERENCES;
-<S_NORMAL>"%s" /* subject */ return SHOW_SUBJECT;
-<S_NORMAL>"%t" /* to */ return SHOW_TO;
-<S_NORMAL>"%T" /* current dictionary */ return SHOW_DICT;
-<S_NORMAL>"%Q" /* quoted message */ return SHOW_QUOTED_MESSAGE;
-<S_NORMAL>"%q" /* quoted message with no signature */ return SHOW_QUOTED_MESSAGE_NO_SIGNATURE;
-<S_NORMAL>"%af" /* full name in compose account */ return SHOW_ACCOUNT_FULL_NAME;
-<S_NORMAL>"%am" /* mail address in compose account */ return SHOW_ACCOUNT_MAIL_ADDRESS;
-<S_NORMAL>"%an" /* compose account name itself */ return SHOW_ACCOUNT_NAME;
-<S_NORMAL>"%ao" /* organization in compose account */ return SHOW_ACCOUNT_ORGANIZATION;
-<S_NORMAL>"%aT" /* main dict (if enabled) in compose account */ return SHOW_ACCOUNT_DICT;
-<S_NORMAL>"%ABc" /* completion of 'Cc' from the address book */ return SHOW_ADDRESSBOOK_COMPLETION_FOR_CC;
-<S_NORMAL>"%ABf" /* completion of 'From' from the address book */ return SHOW_ADDRESSBOOK_COMPLETION_FOR_FROM;
-<S_NORMAL>"%ABt" /* completion of 'To' from the address book */ return SHOW_ADDRESSBOOK_COMPLETION_FOR_TO;
+<S_NORMAL>("%X"|"%cursor") /* cursor pos */ return SET_CURSOR_POS;
+<S_NORMAL>("%A"|"%email") /* email address */ return SHOW_MAIL_ADDRESS;
+<S_NORMAL>("%c"|"%cc") /* cc */ return SHOW_CC;
+<S_NORMAL>("%d"|"%date") /* date */ return SHOW_DATE;
+<S_NORMAL>("%D"|"%date_fmt") /* date */ { BEGIN S_DATE; return SHOW_DATE_EXPR; }
+<S_NORMAL>("%f"|"%from") /* from */ return SHOW_FROM;
+<S_NORMAL>("%F"|"%firstname") /* first name */ return SHOW_FIRST_NAME;
+<S_NORMAL>("%i"|"%messageid") /* message-id */ return SHOW_MESSAGEID;
+<S_NORMAL>("%I"|"%initials") /* initial of sender */ return SHOW_SENDER_INITIAL;
+<S_NORMAL>("%m"|"%msg_no_sig") /* message with no signature */ return SHOW_MESSAGE_NO_SIGNATURE;
+<S_NORMAL>("%M"|"%msg") /* message */ return SHOW_MESSAGE;
+<S_NORMAL>("%n"|"%newsgroups") /* newsgroups */ return SHOW_NEWSGROUPS;
+<S_NORMAL>("%N"|"%fullname") /* full name */ return SHOW_FULLNAME;
+<S_NORMAL>("%L"|"%lastname") /* last name */ return SHOW_LAST_NAME;
+<S_NORMAL>("%r"|"%references") /* references */ return SHOW_REFERENCES;
+<S_NORMAL>("%s"|"%subject") /* subject */ return SHOW_SUBJECT;
+<S_NORMAL>("%t"|"%to") /* to */ return SHOW_TO;
+<S_NORMAL>("%T"|"%dict") /* current dictionary */ return SHOW_DICT;
+<S_NORMAL>("%Q"|"%quoted_msg") /* quoted message */ return SHOW_QUOTED_MESSAGE;
+<S_NORMAL>("%q"|"%quoted_msg_no_sig") /* quoted message with no signature */ return SHOW_QUOTED_MESSAGE_NO_SIGNATURE;
+<S_NORMAL>("%af"|"%account_fullname") /* full name in compose account */ return SHOW_ACCOUNT_FULL_NAME;
+<S_NORMAL>("%am"|"%account_email") /* mail address in compose account */ return SHOW_ACCOUNT_MAIL_ADDRESS;
+<S_NORMAL>("%an"|"%account_name") /* compose account name itself */ return SHOW_ACCOUNT_NAME;
+<S_NORMAL>("%ao"|"%account_org") /* organization in compose account */ return SHOW_ACCOUNT_ORGANIZATION;
+<S_NORMAL>("%aT"|"%account_dict") /* main dict (if enabled) in compose account */ return SHOW_ACCOUNT_DICT;
+<S_NORMAL>("%ABc"|"%addrbook_cc") /* completion of 'Cc' from the address book */ return SHOW_ADDRESSBOOK_COMPLETION_FOR_CC;
+<S_NORMAL>("%ABf"|"%addrbook_from") /* completion of 'From' from the address book */ return SHOW_ADDRESSBOOK_COMPLETION_FOR_FROM;
+<S_NORMAL>("%ABt"|"%addrbook_to") /* completion of 'To' from the address book */ return SHOW_ADDRESSBOOK_COMPLETION_FOR_TO;
 "\\\%" /* % */ return SHOW_PERCENT;
 "\\\\" /* \ */ return SHOW_BACKSLASH;
 "\\t"|"\t" /* tab */ return SHOW_TAB;
@@ -107,41 +107,41 @@ int line = -1;
 "\\|" return SHOW_PIPE;
 "\\{" return SHOW_OPARENT;
 "\\}" return SHOW_CPARENT;
-"?d" /* query date */ return QUERY_DATE;
-"?f" /* query from */ return QUERY_FROM;
-"?N"|"?F"|"?L"|"?I" /* query from name */ return QUERY_FULLNAME;
-"?s" /* query subject */ return QUERY_SUBJECT;
-"?t" /* query to */ return QUERY_TO;
-"?T" /* query current dictionary set and enabled */ return QUERY_DICT;
-"?c" /* query cc */ return QUERY_CC;
-"?n" /* query newsgroups */ return QUERY_NEWSGROUPS;
-"?i" /* query message-id */ return QUERY_MESSAGEID;
-"?r" /* query references */ return QUERY_REFERENCES;
-"?af" /* query full name in compose account */ return QUERY_ACCOUNT_FULL_NAME;
-"?ao" /* query organization in compose account */ return QUERY_ACCOUNT_ORGANIZATION;
-"?aT" /* query account main dict enabled */ return QUERY_ACCOUNT_DICT;
-"?ABc" /* query completion for 'Cc' in address book */ return QUERY_CC_FOUND_IN_ADDRESSBOOK;
-"?ABf" /* query completion for 'From' in address book */ return QUERY_FROM_FOUND_IN_ADDRESSBOOK;
-"?ABt" /* query completion for 'To' in address book */ return QUERY_TO_FOUND_IN_ADDRESSBOOK;
-"|f" /* insert file */ return INSERT_FILE;
-"|p" /* insert program output */ return INSERT_PROGRAMOUTPUT;
-"|i" /* insert user input */ return INSERT_USERINPUT;
-"!d" /* query date */ return QUERY_NOT_DATE;
-"!f" /* query from */ return QUERY_NOT_FROM;
-"!N"|"!F"|"!L"|"!I" /* query not(from name) */ return QUERY_NOT_FULLNAME;
-"!s" /* query not(subject) */ return QUERY_NOT_SUBJECT;
-"!t" /* query not(to) */ return QUERY_NOT_TO;
-"!T" /* query not(current dictionary set and enabled) */ return QUERY_NOT_DICT;
-"!c" /* query not(cc) */ return QUERY_NOT_CC;
-"!n" /* query not(newsgroups) */ return QUERY_NOT_NEWSGROUPS;
-"!i" /* query not(message-id) */ return QUERY_NOT_MESSAGEID;
-"!r" /* query not(references) */ return QUERY_NOT_REFERENCES;
-"!af" /* query not(full name in compose account) */ return QUERY_NOT_ACCOUNT_FULL_NAME;
-"!ao" /* query not(organization in compose account) */ return QUERY_NOT_ACCOUNT_ORGANIZATION;
-"!aT" /* query not(account main dict enabled and set) */ return QUERY_NOT_ACCOUNT_DICT;
-"!ABc" /* query not(completion for 'Cc' in address book) */ return QUERY_NOT_CC_FOUND_IN_ADDRESSBOOK;
-"!ABf" /* query not(completion for 'From' in address book) */ return QUERY_NOT_FROM_FOUND_IN_ADDRESSBOOK;
-"!ABt" /* query not(completion for 'To' in address book) */ return QUERY_NOT_TO_FOUND_IN_ADDRESSBOOK;
+("?d"|"?date") /* query date */ return QUERY_DATE;
+("?f"|"?from") /* query from */ return QUERY_FROM;
+("?N"|"?F"|"?L"|"?I"|"?fullname"|"?firstname"|"?lastname"|"?initials") /* query from name */ return QUERY_FULLNAME;
+("?s"|"?subject") /* query subject */ return QUERY_SUBJECT;
+("?t"|"?to") /* query to */ return QUERY_TO;
+("?T"|"?dict") /* query current dictionary set and enabled */ return QUERY_DICT;
+("?c"|"?cc") /* query cc */ return QUERY_CC;
+("?n"|"?newsgroups") /* query newsgroups */ return QUERY_NEWSGROUPS;
+("?i"|"?messageid") /* query message-id */ return QUERY_MESSAGEID;
+("?r"|"?references") /* query references */ return QUERY_REFERENCES;
+("?af"|"?account_fullname") /* query full name in compose account */ return QUERY_ACCOUNT_FULL_NAME;
+("?ao"|"?account_org") /* query organization in compose account */ return QUERY_ACCOUNT_ORGANIZATION;
+("?aT"|"?account_dict") /* query account main dict enabled */ return QUERY_ACCOUNT_DICT;
+("?ABc"|"?addrbook_cc") /* query completion for 'Cc' in address book */ return QUERY_CC_FOUND_IN_ADDRESSBOOK;
+("?ABf"|"?addrbook_from") /* query completion for 'From' in address book */ return QUERY_FROM_FOUND_IN_ADDRESSBOOK;
+("?ABt"|"%addrbook_to") /* query completion for 'To' in address book */ return QUERY_TO_FOUND_IN_ADDRESSBOOK;
+("!d"|"!date") /* query not(date) */ return QUERY_NOT_DATE;
+("!f"|"!from") /* query not(from) */ return QUERY_NOT_FROM;
+("!N"|"!F"|"!L"|"!I"|"!fullname"|"!firstname"|"!lastname"|"!initials") /* query not(from name) */ return QUERY_NOT_FULLNAME;
+("!s"|"!subject") /* query not(subject) */ return QUERY_NOT_SUBJECT;
+("!t"|"!to") /* query not(to) */ return QUERY_NOT_TO;
+("!T"|"!dict") /* query not(current dictionary set and enabled) */ return QUERY_NOT_DICT;
+("!c"|"!cc") /* query not(cc) */ return QUERY_NOT_CC;
+("!n"|"!newsgroups") /* query not(newsgroups) */ return QUERY_NOT_NEWSGROUPS;
+("!i"|"!messageid") /* query not(message-id) */ return QUERY_NOT_MESSAGEID;
+("!r"|"!references") /* query not(references) */ return QUERY_NOT_REFERENCES;
+("!af"|"!account_fullname") /* query not(full name in compose account) */ return QUERY_NOT_ACCOUNT_FULL_NAME;
+("!ao"|"!account_org") /* query not(organization in compose account) */ return QUERY_NOT_ACCOUNT_ORGANIZATION;
+("!aT"|"!account_dict") /* query not(account main dict enabled and set) */ return QUERY_NOT_ACCOUNT_DICT;
+("!ABc"|"!addrbook_cc") /* query not(completion for 'Cc' in address book) */ return QUERY_NOT_CC_FOUND_IN_ADDRESSBOOK;
+("!ABf"|"!addrbook_from") /* query not(completion for 'From' in address book) */ return QUERY_NOT_FROM_FOUND_IN_ADDRESSBOOK;
+("!ABt"|"!addrbook_to") /* query not(completion for 'To' in address book) */ return QUERY_NOT_TO_FOUND_IN_ADDRESSBOOK;
+("|f"|"!file") /* insert file */ return INSERT_FILE;
+("|p"|"!program") /* insert program output */ return INSERT_PROGRAMOUTPUT;
+("|i"|"!input") /* insert user input */ return INSERT_USERINPUT;
 <S_DATE>"{" return OPARENT;
 <S_DATE>"}" { BEGIN S_NORMAL; return CPARENT; }
 <S_NORMAL>"{" return OPARENT;
index 6d0556af3b4b3d613c1ae8f5442ad3f576000af4..fa72cd9318b97cc3ecaa91bbb6e91a43b0a1192d 100644 (file)
@@ -138,6 +138,11 @@ gchar *quote_fmt_get_buffer(void)
                return current->buffer;
 }
 
+gint quote_fmt_get_line(void)
+{
+       return line;
+}
+
 gint quote_fmt_get_cursor_pos(void)
 {
        return cursor_pos;