add Last Name placeholder for quoting
authorPaul Mangan <paul@claws-mail.org>
Mon, 25 Mar 2002 10:27:52 +0000 (10:27 +0000)
committerPaul Mangan <paul@claws-mail.org>
Mon, 25 Mar 2002 10:27:52 +0000 (10:27 +0000)
AUTHORS
ChangeLog.claws
configure.in
src/quote_fmt.c
src/quote_fmt_lex.l
src/quote_fmt_parse.y

diff --git a/AUTHORS b/AUTHORS
index 269ad2f..9304e5e 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -137,3 +137,4 @@ contributors (beside the above; based on Changelog)
        Bob Woodside
        Stefaan Eeckels
        Pascal Jermini
+       Thorsten Thielen
index c90e57b..86a62dd 100644 (file)
@@ -1,3 +1,12 @@
+2002-03-25 [paul]      0.7.4claws42
+
+       * src/quote_fmt.c
+         src/quote_fmt_lex.l
+         src/quote_fmt_parse.y
+               add Last name (%L) placeholder for quoting. 
+               patch submitted by Thorsten Thielen 
+               <thth@user.sourceforge.net>
+
 2002-03-25 [paul]      0.7.4claws41
 
        * src/utils.c
index 42ef687..2f72a99 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=7
 MICRO_VERSION=4
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws41
+EXTRA_VERSION=claws42
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 10c2830..45779cf 100644 (file)
@@ -40,6 +40,7 @@ static gchar *symbol_table[][2] =
        {"%f",          N_("From")}, /* from */
        {"%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 */ 
index cac97e2..e1a083f 100644 (file)
@@ -12,6 +12,7 @@
 "%f" /* from */ return SHOW_FROM;
 "%N" /* full name */ return SHOW_FULLNAME;
 "%F" /* first name */ return SHOW_FIRST_NAME;
+"%L" /* last name */ return SHOW_LAST_NAME;
 "%I" /* initial of sender */ return SHOW_SENDER_INITIAL;
 "%s" /* subject */ return SHOW_SUBJECT;
 "%t" /* to */ return SHOW_TO;
index c8d97aa..59b8d04 100644 (file)
@@ -131,7 +131,7 @@ static int isseparator(char ch)
 }
 
 %token SHOW_NEWSGROUPS
-%token SHOW_DATE SHOW_FROM SHOW_FULLNAME SHOW_FIRST_NAME
+%token SHOW_DATE SHOW_FROM SHOW_FULLNAME SHOW_FIRST_NAME SHOW_LAST_NAME
 %token SHOW_SENDER_INITIAL SHOW_SUBJECT SHOW_TO SHOW_MESSAGEID
 %token SHOW_PERCENT SHOW_CC SHOW_REFERENCES SHOW_MESSAGE
 %token SHOW_QUOTED_MESSAGE SHOW_BACKSLASH SHOW_TAB
@@ -222,6 +222,37 @@ special:
                        }
                }
        }
+       | SHOW_LAST_NAME
+        {
+                /* This probably won't work together very well with Middle
+                 names and the like - thth */
+               if (msginfo->fromname) {
+                       gchar *p;
+                       gchar *str;
+
+                       str = alloca(strlen(msginfo->fromname) + 1);
+                       if (str != NULL) {
+                               strcpy(str, msginfo->fromname);
+                                p = str;
+                                while (*p && !isspace(*p)) p++;
+                                if (*p) {
+                                   /* We found a space. Get first none-space char and
+                                    insert rest of string from there. */
+                                   while (*p && isspace(*p)) p++;
+                                    if (*p) {
+                                       INSERT(p);
+                                   } else {
+                                       /* If there is no none-space char, just insert
+                                        whole fromname. */
+                                       INSERT(str);
+                                   }
+                               } else {
+                                   /* If there is no space, just insert whole fromname. */
+                                   INSERT(str);
+                               }
+                       }
+               }
+       }
        | SHOW_SENDER_INITIAL
        {
 #define MAX_SENDER_INITIAL 20