2 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3 * Copyright (C) 1999-2007 Hiroyuki Yamamoto and the Claws Mail Team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25 #include <glib/gi18n.h>
33 #include "procheader.h"
34 #include "addr_compl.h"
35 #include "gtk/inputdialog.h"
37 #include "quote_fmt.h"
38 #include "quote_fmt_lex.h"
40 #include "file-utils.h"
45 bison -p quote_fmt quote_fmt.y
50 static MsgInfo *msginfo = NULL;
51 static PrefsAccount *account = NULL;
53 static gchar default_dictionary[BUFFSIZE];
55 static gboolean *visible = NULL;
56 static gboolean dry_run = FALSE;
57 static gint maxsize = 0;
58 static gint stacksize = 0;
59 static GHashTable *var_table = NULL;
60 static GList *attachments = NULL;
62 typedef struct st_buffer
69 static struct st_buffer main_expr = { NULL, 0, 0 };
70 static struct st_buffer sub_expr = { NULL, 0, 0 };
71 static struct st_buffer* current = NULL;
73 static const gchar *quote_str = NULL;
74 static const gchar *body = NULL;
75 static gint error = 0;
77 static gint cursor_pos = -1;
79 extern int quote_fmt_firsttime;
81 extern int escaped_string;
83 static void add_visibility(gboolean val)
86 if (maxsize < stacksize) {
88 visible = g_realloc(visible, maxsize * sizeof(gboolean));
93 visible[stacksize - 1] = val;
96 static void remove_visibility(void)
100 g_warning("Error: visibility stack underflow");
105 static void add_buffer(const gchar *s)
113 if (current->bufsize + len + 1 > current->bufmax) {
114 if (current->bufmax == 0)
115 current->bufmax = 128;
116 while (current->bufsize + len + 1 > current->bufmax)
117 current->bufmax *= 2;
118 current->buffer = g_realloc(current->buffer, current->bufmax);
120 strcpy(current->buffer + current->bufsize, s);
121 current->bufsize += len;
124 static void clear_buffer(void)
127 *current->buffer = '\0';
129 /* force to an empty string, as buffer should not be left unallocated */
131 current->bufsize = 0;
134 gchar *quote_fmt_get_buffer(void)
136 if (current != &main_expr)
137 g_warning("Error: parser still in sub-expr mode");
142 return current->buffer;
145 GList *quote_fmt_get_attachments_list(void)
150 gint quote_fmt_get_line(void)
155 gint quote_fmt_get_cursor_pos(void)
160 #define INSERT(buf) \
161 if (stacksize != 0 && visible[stacksize - 1])\
164 #define INSERT_CHARACTER(chr) \
165 if (stacksize != 0 && visible[stacksize - 1]) { \
172 void quote_fmt_reset_vartable(void)
175 g_hash_table_destroy(var_table);
179 GList *cur = attachments;
182 cur = g_list_next(cur);
184 g_list_free(attachments);
190 void quote_fmt_init(MsgInfo *info, const gchar *my_quote_str,
191 const gchar *my_body, gboolean my_dry_run,
192 PrefsAccount *compose_account,
193 gboolean string_is_escaped,
194 GtkAspell *compose_gtkaspell)
196 void quote_fmt_init(MsgInfo *info, const gchar *my_quote_str,
197 const gchar *my_body, gboolean my_dry_run,
198 PrefsAccount *compose_account,
199 gboolean string_is_escaped)
202 quote_str = my_quote_str;
205 account = compose_account;
207 gchar *dict = gtkaspell_get_default_dictionary(compose_gtkaspell);
209 strncpy2(default_dictionary, dict, sizeof(default_dictionary));
211 *default_dictionary = '\0';
213 dry_run = my_dry_run;
215 add_visibility(TRUE);
216 main_expr.bufmax = 0;
218 current = &main_expr;
222 escaped_string = string_is_escaped;
225 var_table = g_hash_table_new_full(g_str_hash, g_str_equal,
229 * force LEX initialization
231 quote_fmt_firsttime = 1;
235 void quote_fmterror(char *str)
237 g_warning("Error: %s at line %d", str, line);
241 int quote_fmtwrap(void)
246 static int isseparator(int ch)
248 return g_ascii_isspace(ch) || ch == '.' || ch == '-';
252 * Search for glibc extended strftime timezone specs within haystack.
253 * If not found NULL is returned and the integer pointed by tzspeclen is
255 * If found a pointer to the start of the specification within haystack
256 * is returned and the integer pointed by tzspeclen is set to the lenght
259 static const char* strtzspec(const char *haystack, int *tzspeclen)
261 const char *p = NULL;
262 const char *q = NULL;
263 const char *r = NULL;
265 p = strstr(haystack, "%");
268 if (!*q) return NULL;
269 r = strchr("_-0^#", *q); /* skip flags */
272 if (!*q) return NULL;
274 while (*q >= '0' && *q <= '9') ++q; /* skip width */
275 if (!*q) return NULL;
276 if (*q == 'z' || *q == 'Z') { /* numeric or name */
277 *tzspeclen = 1 + (q - p);
285 static void quote_fmt_show_date(const MsgInfo *msginfo, const gchar *format)
298 * ALF - GNU C's strftime() has a nice format specifier
299 * for time zone offset (%z). Non-standard however, so
303 #define RLEFT (sizeof result) - (rptr - result)
307 if (procheader_date_parse_to_tm(msginfo->date, <, zone)) {
309 * break up format string in tiny bits delimited by valid %z's and
310 * feed it to strftime(). don't forget that '%%z' mean literal '%z'.
312 for (rptr = result, fptr = format; fptr && *fptr && rptr < &result[sizeof result - 1];) {
317 if (NULL != (zptr = strtzspec(fptr, &zlen))) {
319 * count nr. of prepended percent chars
321 for (perc = 0, p = zptr; p && p >= format && *p == '%'; p--, perc++)
326 tmp = g_strndup(fptr, zptr - fptr + (perc % 2 ? 0 : zlen));
328 rptr += strftime(rptr, RLEFT, tmp, <);
332 * append time zone offset
334 if (zone[0] && perc % 2)
335 rptr += g_snprintf(rptr, RLEFT, "%s", zone);
338 rptr += strftime(rptr, RLEFT, fptr, <);
343 if (g_utf8_validate(result, -1, NULL)) {
346 gchar *utf = conv_codeset_strdup(result,
347 conv_get_locale_charset_str_no_utf8(),
350 !g_utf8_validate(utf, -1, NULL)) {
352 utf = g_malloc(strlen(result)*2+1);
353 conv_localetodisp(utf,
354 strlen(result)*2+1, result);
356 if (g_utf8_validate(utf, -1, NULL)) {
365 static void quote_fmt_show_first_name(const MsgInfo *msginfo)
370 if (!msginfo->fromname)
373 p = (guchar*)strchr(msginfo->fromname, ',');
375 /* fromname is like "Duck, Donald" */
377 while (*p && isspace(*p)) p++;
378 str = alloca(strlen((char *)p) + 1);
380 strcpy(str, (char *)p);
384 /* fromname is like "Donald Duck" */
385 str = alloca(strlen(msginfo->fromname) + 1);
387 strcpy(str, msginfo->fromname);
389 while (*p && !isspace(*p)) p++;
396 static void quote_fmt_show_last_name(const MsgInfo *msginfo)
401 /* This probably won't work together very well with Middle
402 names and the like - thth */
403 if (!msginfo->fromname)
406 str = alloca(strlen(msginfo->fromname) + 1);
408 strcpy(str, msginfo->fromname);
409 p = strchr(str, ',');
411 /* fromname is like "Duck, Donald" */
415 /* fromname is like "Donald Duck" */
417 while (*p && !isspace(*p)) p++;
419 /* We found a space. Get first
420 none-space char and insert
421 rest of string from there. */
422 while (*p && isspace(*p)) p++;
426 /* If there is no none-space
427 char, just insert whole
432 /* If there is no space, just
433 insert whole fromname. */
440 static void quote_fmt_show_sender_initial(const MsgInfo *msginfo)
442 #define MAX_SENDER_INITIAL 20
443 gchar tmp[MAX_SENDER_INITIAL];
448 if (!msginfo->fromname)
451 p = (guchar *)msginfo->fromname;
454 if (*p && g_utf8_validate((gchar *)p, 1, NULL)) {
458 if (len >= MAX_SENDER_INITIAL - 1)
462 while (*p && !isseparator(*p)) p++;
463 while (*p && isseparator(*p)) p++;
469 static void quote_fmt_show_msg(MsgInfo *msginfo, const gchar *body,
470 gboolean quoted, gboolean signature,
471 const gchar *quote_str)
476 if (!(msginfo->folder || body))
480 fp = str_open_as_stream(body);
482 if (MSG_IS_ENCRYPTED(msginfo->flags))
483 fp = procmime_get_first_encrypted_text_content(msginfo);
485 fp = procmime_get_first_text_content(msginfo);
489 g_warning("Can't get text part");
491 account_signatures_matchlist_create();
492 while (fgets(buf, sizeof(buf), fp) != NULL) {
495 if (!signature && account_signatures_matchlist_nchar_found(buf, "%s\n"))
498 if (quoted && quote_str)
503 account_signatures_matchlist_delete();
508 static void quote_fmt_insert_file(const gchar *filename)
513 if ((file = g_fopen(filename, "rb")) != NULL) {
514 while (fgets(buffer, sizeof(buffer), file)) {
522 static void quote_fmt_insert_program_output(const gchar *progname)
527 if ((file = popen(progname, "r")) != NULL) {
528 while (fgets(buffer, sizeof(buffer), file)) {
535 static void quote_fmt_insert_user_input(const gchar *varname)
543 if ((text = g_hash_table_lookup(var_table, varname)) == NULL) {
544 buf = g_strdup_printf(_("Enter text to replace '%s'"), varname);
545 text = input_dialog(_("Enter variable"), buf, "");
549 g_hash_table_insert(var_table, g_strdup(varname), g_strdup(text));
551 /* don't free the one in hashtable at the end */
552 text = g_strdup(text);
561 static void quote_fmt_attach_file(const gchar *filename)
563 attachments = g_list_append(attachments, g_strdup(filename));
566 static void quote_fmt_attach_file_program_output(const gchar *progname)
569 char buffer[PATH_MAX];
571 if ((file = popen(progname, "r")) != NULL) {
572 /* get first line only */
573 if (fgets(buffer, sizeof(buffer), file)) {
574 /* trim trailing CR/LF */
576 attachments = g_list_append(attachments, g_strdup(buffer));
582 static gchar *quote_fmt_complete_address(const gchar *addr)
585 gchar *res, *tmp, *email_addr;
588 debug_print("quote_fmt_complete_address: %s\n", addr);
592 /* if addr is a list of message, try the 1st element only */
593 split = g_strsplit(addr, ",", -1);
594 if (!split || !split[0] || *split[0] == '\0') {
599 Xstrdup_a(email_addr, split[0], return NULL);
600 extract_address(email_addr);
607 start_address_completion(NULL);
608 if (1 < (count = complete_address(email_addr))) {
609 tmp = get_complete_address(1);
610 res = procheader_get_fromname(tmp);
613 end_address_completion();
616 debug_print("quote_fmt_complete_address: matched %s\n", res);
628 %token SHOW_NEWSGROUPS
629 %token SHOW_DATE SHOW_FROM SHOW_FULLNAME SHOW_FIRST_NAME SHOW_LAST_NAME
630 %token SHOW_SENDER_INITIAL SHOW_SUBJECT SHOW_TO SHOW_MESSAGEID
631 %token SHOW_PERCENT SHOW_CC SHOW_REFERENCES SHOW_MESSAGE
632 %token SHOW_QUOTED_MESSAGE SHOW_BACKSLASH SHOW_TAB SHOW_MAIL_ADDRESS
633 %token SHOW_QUOTED_MESSAGE_NO_SIGNATURE SHOW_MESSAGE_NO_SIGNATURE
634 %token SHOW_EOL SHOW_QUESTION_MARK SHOW_EXCLAMATION_MARK SHOW_PIPE SHOW_OPARENT SHOW_CPARENT
635 %token SHOW_ACCOUNT_FULL_NAME SHOW_ACCOUNT_MAIL_ADDRESS SHOW_ACCOUNT_NAME SHOW_ACCOUNT_ORGANIZATION
636 %token SHOW_ACCOUNT_DICT SHOW_ACCOUNT_SIG SHOW_ACCOUNT_SIGPATH
637 %token SHOW_DICT SHOW_TAGS
638 %token SHOW_ADDRESSBOOK_COMPLETION_FOR_CC
639 %token SHOW_ADDRESSBOOK_COMPLETION_FOR_FROM
640 %token SHOW_ADDRESSBOOK_COMPLETION_FOR_TO
642 %token QUERY_DATE QUERY_FROM
643 %token QUERY_FULLNAME QUERY_SUBJECT QUERY_TO QUERY_NEWSGROUPS
644 %token QUERY_MESSAGEID QUERY_CC QUERY_REFERENCES
645 %token QUERY_ACCOUNT_FULL_NAME QUERY_ACCOUNT_ORGANIZATION QUERY_ACCOUNT_DICT
646 %token QUERY_ACCOUNT_SIG QUERY_ACCOUNT_SIGPATH
648 %token QUERY_CC_FOUND_IN_ADDRESSBOOK
649 %token QUERY_FROM_FOUND_IN_ADDRESSBOOK
650 %token QUERY_TO_FOUND_IN_ADDRESSBOOK
651 /* tokens QUERY_NOT */
652 %token QUERY_NOT_DATE QUERY_NOT_FROM
653 %token QUERY_NOT_FULLNAME QUERY_NOT_SUBJECT QUERY_NOT_TO QUERY_NOT_NEWSGROUPS
654 %token QUERY_NOT_MESSAGEID QUERY_NOT_CC QUERY_NOT_REFERENCES
655 %token QUERY_NOT_ACCOUNT_FULL_NAME QUERY_NOT_ACCOUNT_ORGANIZATION QUERY_NOT_ACCOUNT_DICT
656 %token QUERY_NOT_ACCOUNT_SIG QUERY_NOT_ACCOUNT_SIGPATH
657 %token QUERY_NOT_DICT
658 %token QUERY_NOT_CC_FOUND_IN_ADDRESSBOOK
659 %token QUERY_NOT_FROM_FOUND_IN_ADDRESSBOOK
660 %token QUERY_NOT_TO_FOUND_IN_ADDRESSBOOK
662 %token INSERT_FILE INSERT_PROGRAMOUTPUT INSERT_USERINPUT
663 %token ATTACH_FILE ATTACH_PROGRAMOUTPUT
664 %token OPARENT CPARENT
666 %token SHOW_DATE_EXPR
667 %token SET_CURSOR_POS
671 %type <chr> CHARACTER
672 %type <chr> character
678 character_or_special_or_insert_or_query_list ;
681 character_or_special_list ;
683 character_or_special_or_insert_or_query_list:
684 character_or_special_or_insert_or_query character_or_special_or_insert_or_query_list
685 | character_or_special_or_insert_or_query ;
687 character_or_special_list:
688 character_or_special character_or_special_list
689 | character_or_special ;
691 character_or_special_or_insert_or_query:
698 character_or_special:
702 INSERT_CHARACTER($1);
719 strncpy($$, $1, sizeof($$));
720 $$[sizeof($$) - 1] = '\0';
722 if (len + 1 < sizeof($$)) {
731 if (msginfo->newsgroups)
732 INSERT(msginfo->newsgroups);
734 | SHOW_DATE_EXPR OPARENT string CPARENT
736 quote_fmt_show_date(msginfo, $3);
741 INSERT(msginfo->date);
746 INSERT(msginfo->from);
751 gchar *stripped_address = g_strdup(msginfo->from);
752 extract_address(stripped_address);
753 INSERT(stripped_address);
754 g_free(stripped_address);
759 if (msginfo->fromname)
760 INSERT(msginfo->fromname);
764 quote_fmt_show_first_name(msginfo);
768 quote_fmt_show_last_name(msginfo);
770 | SHOW_SENDER_INITIAL
772 quote_fmt_show_sender_initial(msginfo);
776 if (msginfo->subject)
777 INSERT(msginfo->subject);
787 INSERT(msginfo->msgid);
802 INSERT(msginfo->inreplyto);
803 for (item = msginfo->references; item != NULL; item = g_slist_next(item))
809 quote_fmt_show_msg(msginfo, body, FALSE, TRUE, quote_str);
811 | SHOW_QUOTED_MESSAGE
813 quote_fmt_show_msg(msginfo, body, TRUE, TRUE, quote_str);
815 | SHOW_MESSAGE_NO_SIGNATURE
817 quote_fmt_show_msg(msginfo, body, FALSE, FALSE, quote_str);
819 | SHOW_QUOTED_MESSAGE_NO_SIGNATURE
821 quote_fmt_show_msg(msginfo, body, TRUE, FALSE, quote_str);
823 | SHOW_ACCOUNT_FULL_NAME
825 if (account && account->name)
826 INSERT(account->name);
828 | SHOW_ACCOUNT_MAIL_ADDRESS
830 if (account && account->address)
831 INSERT(account->address);
835 if (account && account->account_name)
836 INSERT(account->account_name);
838 | SHOW_ACCOUNT_ORGANIZATION
840 if (account && account->organization)
841 INSERT(account->organization);
845 gchar *str = account_get_signature_str(account);
849 | SHOW_ACCOUNT_SIGPATH
851 if (account && account->sig_path)
852 INSERT(account->sig_path);
857 if (account && account->enable_default_dictionary) {
858 gchar *dictname = g_path_get_basename(account->default_dictionary);
867 INSERT(default_dictionary);
872 gchar *tags = procmsg_msginfo_get_tags_str(msginfo);
894 | SHOW_EXCLAMATION_MARK
913 cursor_pos = g_utf8_strlen(current->buffer, -1);
917 | SHOW_ADDRESSBOOK_COMPLETION_FOR_CC
919 gchar *tmp = quote_fmt_complete_address(msginfo->cc);
925 | SHOW_ADDRESSBOOK_COMPLETION_FOR_FROM
927 gchar *tmp = quote_fmt_complete_address(msginfo->from);
933 | SHOW_ADDRESSBOOK_COMPLETION_FOR_TO
935 gchar *tmp = quote_fmt_complete_address(msginfo->to);
945 add_visibility(msginfo->date != NULL);
947 OPARENT quote_fmt CPARENT
953 add_visibility(msginfo->from != NULL);
955 OPARENT quote_fmt CPARENT
961 add_visibility(msginfo->fromname != NULL);
963 OPARENT quote_fmt CPARENT
969 add_visibility(msginfo->subject != NULL);
971 OPARENT quote_fmt CPARENT
977 add_visibility(msginfo->to != NULL);
979 OPARENT quote_fmt CPARENT
985 add_visibility(msginfo->newsgroups != NULL);
987 OPARENT quote_fmt CPARENT
993 add_visibility(msginfo->msgid != NULL);
995 OPARENT quote_fmt CPARENT
1001 add_visibility(msginfo->cc != NULL);
1003 OPARENT quote_fmt CPARENT
1005 remove_visibility();
1012 found = (msginfo->inreplyto != NULL);
1013 for (item = msginfo->references; found == FALSE && item != NULL; item = g_slist_next(item))
1016 add_visibility(found == TRUE);
1018 OPARENT quote_fmt CPARENT
1020 remove_visibility();
1022 | QUERY_ACCOUNT_FULL_NAME
1024 add_visibility(account != NULL && account->name != NULL);
1026 OPARENT quote_fmt CPARENT
1028 remove_visibility();
1030 | QUERY_ACCOUNT_ORGANIZATION
1032 add_visibility(account != NULL && account->organization != NULL);
1034 OPARENT quote_fmt CPARENT
1036 remove_visibility();
1040 gchar *str = account_get_signature_str(account);
1041 add_visibility(str != NULL && * str != '\0');
1044 OPARENT quote_fmt CPARENT
1046 remove_visibility();
1048 | QUERY_ACCOUNT_SIGPATH
1050 add_visibility(account != NULL && account->sig_path != NULL
1051 && *account->sig_path != '\0');
1053 OPARENT quote_fmt CPARENT
1055 remove_visibility();
1057 | QUERY_ACCOUNT_DICT
1060 add_visibility(account != NULL && account->enable_default_dictionary == TRUE &&
1061 account->default_dictionary != NULL && *account->default_dictionary != '\0');
1063 add_visibility(FALSE);
1066 OPARENT quote_fmt CPARENT
1068 remove_visibility();
1073 add_visibility(*default_dictionary != '\0');
1075 add_visibility(FALSE);
1078 OPARENT quote_fmt CPARENT
1080 remove_visibility();
1082 | QUERY_CC_FOUND_IN_ADDRESSBOOK
1084 gchar *tmp = quote_fmt_complete_address(msginfo->cc);
1085 add_visibility(tmp != NULL && *tmp != '\0');
1088 OPARENT quote_fmt CPARENT
1090 remove_visibility();
1092 | QUERY_FROM_FOUND_IN_ADDRESSBOOK
1094 gchar *tmp = quote_fmt_complete_address(msginfo->from);
1095 add_visibility(tmp != NULL && *tmp != '\0');
1098 OPARENT quote_fmt CPARENT
1100 remove_visibility();
1102 | QUERY_TO_FOUND_IN_ADDRESSBOOK
1104 gchar *tmp = quote_fmt_complete_address(msginfo->to);
1105 add_visibility(tmp != NULL && *tmp != '\0');
1108 OPARENT quote_fmt CPARENT
1110 remove_visibility();
1116 add_visibility(msginfo->date == NULL);
1118 OPARENT quote_fmt CPARENT
1120 remove_visibility();
1124 add_visibility(msginfo->from == NULL);
1126 OPARENT quote_fmt CPARENT
1128 remove_visibility();
1130 | QUERY_NOT_FULLNAME
1132 add_visibility(msginfo->fromname == NULL);
1134 OPARENT quote_fmt CPARENT
1136 remove_visibility();
1140 add_visibility(msginfo->subject == NULL);
1142 OPARENT quote_fmt CPARENT
1144 remove_visibility();
1148 add_visibility(msginfo->to == NULL);
1150 OPARENT quote_fmt CPARENT
1152 remove_visibility();
1154 | QUERY_NOT_NEWSGROUPS
1156 add_visibility(msginfo->newsgroups == NULL);
1158 OPARENT quote_fmt CPARENT
1160 remove_visibility();
1162 | QUERY_NOT_MESSAGEID
1164 add_visibility(msginfo->msgid == NULL);
1166 OPARENT quote_fmt CPARENT
1168 remove_visibility();
1172 add_visibility(msginfo->cc == NULL);
1174 OPARENT quote_fmt CPARENT
1176 remove_visibility();
1178 | QUERY_NOT_REFERENCES
1183 found = (msginfo->inreplyto != NULL);
1184 for (item = msginfo->references; found == FALSE && item != NULL; item = g_slist_next(item))
1187 add_visibility(found == FALSE);
1189 OPARENT quote_fmt CPARENT
1191 remove_visibility();
1193 | QUERY_NOT_ACCOUNT_FULL_NAME
1195 add_visibility(account == NULL || account->name == NULL);
1197 OPARENT quote_fmt CPARENT
1199 remove_visibility();
1201 | QUERY_NOT_ACCOUNT_ORGANIZATION
1203 add_visibility(account == NULL || account->organization == NULL);
1205 OPARENT quote_fmt CPARENT
1207 remove_visibility();
1209 | QUERY_NOT_ACCOUNT_SIG
1211 gchar *str = account_get_signature_str(account);
1212 add_visibility(str == NULL || *str == '\0');
1215 OPARENT quote_fmt CPARENT
1217 remove_visibility();
1219 | QUERY_NOT_ACCOUNT_SIGPATH
1221 add_visibility(account == NULL || account->sig_path == NULL
1222 || *account->sig_path == '\0');
1224 OPARENT quote_fmt CPARENT
1226 remove_visibility();
1228 | QUERY_NOT_ACCOUNT_DICT
1231 add_visibility(account == NULL || account->enable_default_dictionary == FALSE
1232 || *account->default_dictionary == '\0');
1234 add_visibility(FALSE);
1237 OPARENT quote_fmt CPARENT
1239 remove_visibility();
1244 add_visibility(*default_dictionary == '\0');
1246 add_visibility(FALSE);
1249 OPARENT quote_fmt CPARENT
1251 remove_visibility();
1253 | QUERY_NOT_CC_FOUND_IN_ADDRESSBOOK
1255 gchar *tmp = quote_fmt_complete_address(msginfo->cc);
1256 add_visibility(tmp == NULL || *tmp == '\0');
1259 OPARENT quote_fmt CPARENT
1261 remove_visibility();
1263 | QUERY_NOT_FROM_FOUND_IN_ADDRESSBOOK
1265 gchar *tmp = quote_fmt_complete_address(msginfo->from);
1266 add_visibility(tmp == NULL || *tmp == '\0');
1269 OPARENT quote_fmt CPARENT
1271 remove_visibility();
1273 | QUERY_NOT_TO_FOUND_IN_ADDRESSBOOK
1275 gchar *tmp = quote_fmt_complete_address(msginfo->to);
1276 add_visibility(tmp == NULL || *tmp == '\0');
1279 OPARENT quote_fmt CPARENT
1281 remove_visibility();
1287 current = &sub_expr;
1290 OPARENT sub_expr CPARENT
1292 current = &main_expr;
1294 quote_fmt_insert_file(sub_expr.buffer);
1297 | INSERT_PROGRAMOUTPUT
1299 current = &sub_expr;
1302 OPARENT sub_expr CPARENT
1304 current = &main_expr;
1306 quote_fmt_insert_program_output(sub_expr.buffer);
1311 current = &sub_expr;
1314 OPARENT sub_expr CPARENT
1316 current = &main_expr;
1318 quote_fmt_insert_user_input(sub_expr.buffer);
1325 current = &sub_expr;
1328 OPARENT sub_expr CPARENT
1330 current = &main_expr;
1332 quote_fmt_attach_file(sub_expr.buffer);
1335 | ATTACH_PROGRAMOUTPUT
1337 current = &sub_expr;
1340 OPARENT sub_expr CPARENT
1342 current = &main_expr;
1344 quote_fmt_attach_file_program_output(sub_expr.buffer);