"Fossies" - the Fresh Open Source Software Archive 
Member "tin-2.6.1/src/options_menu.c" (22 Dec 2021, 106704 Bytes) of package /linux/misc/tin-2.6.1.tar.xz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
For more information about "options_menu.c" see the
Fossies "Dox" file reference documentation and the latest
Fossies "Diffs" side-by-side code changes report:
2.6.0_vs_2.6.1.
1 /*
2 * Project : tin - a Usenet reader
3 * Module : options_menu.c
4 * Author : Michael Bienia <michael@vorlon.ping.de>
5 * Created : 2004-09-05
6 * Updated : 2021-07-06
7 * Notes : Split from config.c
8 *
9 * Copyright (c) 2004-2022 Michael Bienia <michael@vorlon.ping.de>
10 * All rights reserved.
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 *
16 * 1. Redistributions of source code must retain the above copyright notice,
17 * this list of conditions and the following disclaimer.
18 *
19 * 2. Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in the
21 * documentation and/or other materials provided with the distribution.
22 *
23 * 3. Neither the name of the copyright holder nor the names of its
24 * contributors may be used to endorse or promote products derived from
25 * this software without specific prior written permission.
26 *
27 * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
31 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37 * POSSIBILITY OF SUCH DAMAGE.
38 */
39
40
41 #ifndef TIN_H
42 # include "tin.h"
43 #endif /* !TIN_H */
44 #ifndef TINCFG_H
45 # include "tincfg.h"
46 #endif /* !TINCFG_H */
47 #ifndef TCURSES_H
48 # include "tcurses.h"
49 #endif /* !TCURSES_H */
50
51
52 #define option_lines_per_page (cLINES - INDEX_TOP - 3)
53
54 #define UPDATE_BOOL_ATTRIBUTES(option) do { \
55 scopes[0].attribute->option = CAST_BOOL(tinrc.option); \
56 changed |= MISC_OPTS; \
57 } while (0)
58
59 #define UPDATE_INT_ATTRIBUTES(option) do { \
60 scopes[0].attribute->option = CAST_BITS(tinrc.option, option); \
61 changed |= MISC_OPTS; \
62 } while (0)
63
64 #define CAO(A, O) A ## O
65
66 #define SET_BOOL_ATTRIBUTE(option) do { \
67 curr_scope->attribute->option = CAST_BOOL(CAO(tinrc.attrib_, option)); \
68 curr_scope->state->option = TRUE; \
69 changed |= MISC_OPTS; \
70 } while (0)
71
72 #define SET_NUM_ATTRIBUTE(option) do { \
73 curr_scope->attribute->option = CAST_BITS(CAO(tinrc.attrib_, option), option); \
74 curr_scope->state->option = TRUE; \
75 changed |= MISC_OPTS; \
76 } while (0)
77
78 #define SET_STRING_ATTRIBUTE(opt) do { \
79 if (!strlen(CAO(tinrc.attrib_, opt))) { \
80 reset_state(option); \
81 redraw_screen(option); \
82 } else { \
83 FreeIfNeeded(curr_scope->attribute->opt); \
84 curr_scope->state->opt = TRUE; \
85 curr_scope->attribute->opt = my_strdup(CAO(tinrc.attrib_, opt)); \
86 } \
87 changed |= MISC_OPTS; \
88 } while (0)
89
90 static enum option_enum first_option_on_screen, last_option_on_screen, last_opt;
91
92 /*
93 * local prototypes
94 */
95 static enum option_enum get_first_opt(void);
96 static enum option_enum move_cursor(enum option_enum cur_option, t_bool down);
97 static enum option_enum next_option(enum option_enum option, t_bool incl_titles);
98 static enum option_enum opt_scroll_down(enum option_enum option);
99 static enum option_enum opt_scroll_up(enum option_enum option);
100 static enum option_enum prev_option(enum option_enum option, t_bool incl_titles);
101 static enum option_enum set_option_num(int num);
102 static int add_new_scope(void);
103 static int find_scope(const char *scope);
104 static int get_option_num(enum option_enum option);
105 static int move_scope(int curr_pos);
106 static t_bool check_state(enum option_enum option);
107 static t_bool delete_scope(int curr_pos);
108 static t_bool option_is_title(enum option_enum option);
109 static t_bool option_on_page(enum option_enum option);
110 static t_bool rename_scope(struct t_scope *scope);
111 static t_bool scope_is_empty(void);
112 static t_function option_left(void);
113 static t_function option_right(void);
114 static t_function scope_left(void);
115 static t_function scope_right(void);
116 static void build_scope_line(int i);
117 static void do_delete_scope(int curr_pos);
118 static void do_move_scope(int from, int to);
119 static void draw_scope_arrow(void);
120 static void free_scopes_and_attributes(void);
121 static void highlight_option(enum option_enum option);
122 static void initialize_attributes(void);
123 static void print_any_option(enum option_enum option);
124 static void redraw_screen(enum option_enum option);
125 static void repaint_option(enum option_enum option);
126 static void reset_state(enum option_enum option);
127 static void scope_page(enum context level);
128 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
129 static void set_art_mark_width(void);
130 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
131 static void set_first_option_on_screen(enum option_enum last_option);
132 static void set_last_opt(void);
133 static void set_last_option_on_screen(enum option_enum first_option);
134 static void show_config_page(void);
135 static void show_scope_page(void);
136 static void unhighlight_option(enum option_enum option);
137 #ifdef USE_CURSES
138 static void do_scroll(int jump);
139 #endif /* USE_CURSES */
140
141 static t_menu scopemenu = { 0, 0, 0, show_scope_page, draw_scope_arrow, build_scope_line };
142 static struct t_scope *curr_scope = NULL;
143
144 /*
145 * returns the row on the screen of an option
146 * note: option should be on this page
147 */
148 int
149 option_row(
150 enum option_enum option)
151 {
152 int i = 0;
153 enum option_enum j = first_option_on_screen;
154
155 while (j < option) {
156 if (option_is_visible(j))
157 i++;
158 j++;
159 }
160
161 return INDEX_TOP + i;
162 }
163
164
165 /*
166 * returns the number of an option
167 */
168 static int
169 get_option_num(
170 enum option_enum option)
171 {
172 enum option_enum i;
173 int result = 0;
174
175 for (i = 0; i < option && result < (int) last_opt; i = next_option(i, FALSE))
176 result++;
177
178 return result;
179 }
180
181
182 /*
183 * returns the option with the given number
184 */
185 static enum option_enum
186 set_option_num(
187 int num)
188 {
189 enum option_enum result = 0;
190
191 while (num > 0 && result < last_opt) {
192 result = next_option(result, FALSE);
193 num--;
194 }
195 return result;
196 }
197
198
199 /*
200 * returns TRUE if an option is visible in the menu
201 */
202 t_bool
203 option_is_visible(
204 enum option_enum option)
205 {
206 switch (option) {
207 #ifdef HAVE_COLOR
208 case OPT_COL_BACK:
209 case OPT_COL_FROM:
210 case OPT_COL_HEAD:
211 case OPT_COL_HELP:
212 case OPT_COL_INVERS_BG:
213 case OPT_COL_INVERS_FG:
214 case OPT_COL_MESSAGE:
215 case OPT_COL_MINIHELP:
216 case OPT_COL_NEWSHEADERS:
217 case OPT_COL_NORMAL:
218 case OPT_COL_QUOTE:
219 case OPT_COL_QUOTE2:
220 case OPT_COL_QUOTE3:
221 case OPT_COL_EXTQUOTE:
222 case OPT_COL_RESPONSE:
223 case OPT_COL_SIGNATURE:
224 case OPT_COL_SUBJECT:
225 case OPT_COL_TEXT:
226 case OPT_COL_TITLE:
227 case OPT_COL_URLS:
228 case OPT_QUOTE_REGEX:
229 case OPT_QUOTE_REGEX2:
230 case OPT_QUOTE_REGEX3:
231 case OPT_EXTQUOTE_HANDLING:
232 return curr_scope ? FALSE : tinrc.use_color;
233
234 case OPT_COL_MARKSTAR:
235 case OPT_COL_MARKDASH:
236 case OPT_COL_MARKSLASH:
237 case OPT_COL_MARKSTROKE:
238 return curr_scope ? FALSE : (tinrc.word_highlight && tinrc.use_color);
239
240 case OPT_COL_VERBATIM:
241 return curr_scope ? FALSE : (tinrc.verbatim_handling && tinrc.use_color);
242
243 case OPT_EXTQUOTE_REGEX:
244 return curr_scope ? FALSE : (tinrc.extquote_handling && tinrc.use_color);
245 #endif /* HAVE_COLOR */
246
247 case OPT_WORD_H_DISPLAY_MARKS:
248 case OPT_SLASHES_REGEX:
249 case OPT_STARS_REGEX:
250 case OPT_STROKES_REGEX:
251 case OPT_UNDERSCORES_REGEX:
252 return curr_scope ? FALSE : tinrc.word_highlight;
253
254 case OPT_MONO_MARKSTAR:
255 case OPT_MONO_MARKDASH:
256 case OPT_MONO_MARKSLASH:
257 case OPT_MONO_MARKSTROKE:
258 #ifdef HAVE_COLOR
259 return curr_scope ? FALSE : (tinrc.word_highlight && !tinrc.use_color);
260 #else
261 return curr_scope ? FALSE : tinrc.word_highlight;
262 #endif /* HAVE_COLOR */
263
264 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
265 case OPT_UTF8_GRAPHICS:
266 return curr_scope ? FALSE : IS_LOCAL_CHARSET("UTF-8");
267 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
268
269 case OPT_VERBATIM_BEGIN_REGEX:
270 case OPT_VERBATIM_END_REGEX:
271 return curr_scope ? FALSE : tinrc.verbatim_handling;
272
273 #ifndef USE_CURSES
274 case OPT_STRIP_BLANKS:
275 #endif /* !USE_CURSES */
276 case OPT_GETART_LIMIT_OPTIONS:
277 return curr_scope ? FALSE : TRUE;
278
279 #ifdef HAVE_COLOR
280 case OPT_COLOR_OPTIONS:
281 return curr_scope ? tinrc.use_color : TRUE;
282 #endif /* HAVE_COLOR */
283
284 case OPT_DISPLAY_OPTIONS:
285 case OPT_FILTERING_OPTIONS:
286 case OPT_SAVING_OPTIONS:
287 case OPT_POSTING_OPTIONS:
288 case OPT_EXPERT_OPTIONS:
289 return TRUE;
290
291 case OPT_ATTRIB_ADD_POSTED_TO_FILTER:
292 case OPT_ATTRIB_ADVERTISING:
293 case OPT_ATTRIB_ALTERNATIVE_HANDLING:
294 case OPT_ATTRIB_ASK_FOR_METAMAIL:
295 case OPT_ATTRIB_AUTO_CC_BCC:
296 case OPT_ATTRIB_AUTO_LIST_THREAD:
297 case OPT_ATTRIB_AUTO_SELECT:
298 case OPT_ATTRIB_BATCH_SAVE:
299 case OPT_ATTRIB_DATE_FORMAT:
300 case OPT_ATTRIB_DELETE_TMP_FILES:
301 case OPT_ATTRIB_EDITOR_FORMAT:
302 case OPT_ATTRIB_FCC:
303 case OPT_ATTRIB_FOLLOWUP_TO:
304 case OPT_ATTRIB_FROM:
305 case OPT_ATTRIB_GROUP_CATCHUP_ON_EXIT:
306 case OPT_ATTRIB_GROUP_FORMAT:
307 #ifdef HAVE_ISPELL
308 case OPT_ATTRIB_ISPELL:
309 #endif /* HAVE_ISPELL */
310 case OPT_ATTRIB_MAILDIR:
311 case OPT_ATTRIB_MAIL_8BIT_HEADER:
312 case OPT_ATTRIB_MAIL_MIME_ENCODING:
313 case OPT_ATTRIB_MAILING_LIST:
314 case OPT_ATTRIB_MARK_IGNORE_TAGS:
315 case OPT_ATTRIB_MARK_SAVED_READ:
316 case OPT_ATTRIB_MIME_FORWARD:
317 case OPT_ATTRIB_MIME_TYPES_TO_SAVE:
318 case OPT_ATTRIB_NEWS_HEADERS_TO_DISPLAY:
319 case OPT_ATTRIB_NEWS_HEADERS_TO_NOT_DISPLAY:
320 case OPT_ATTRIB_NEWS_QUOTE_FORMAT:
321 case OPT_ATTRIB_ORGANIZATION:
322 case OPT_ATTRIB_POST_8BIT_HEADER:
323 case OPT_ATTRIB_POST_MIME_ENCODING:
324 case OPT_ATTRIB_POST_PROCESS_VIEW:
325 case OPT_ATTRIB_POS_FIRST_UNREAD:
326 case OPT_ATTRIB_QUICK_KILL_HEADER:
327 case OPT_ATTRIB_QUICK_KILL_SCOPE:
328 case OPT_ATTRIB_QUICK_KILL_EXPIRE:
329 case OPT_ATTRIB_QUICK_KILL_CASE:
330 case OPT_ATTRIB_QUICK_SELECT_HEADER:
331 case OPT_ATTRIB_QUICK_SELECT_SCOPE:
332 case OPT_ATTRIB_QUICK_SELECT_EXPIRE:
333 case OPT_ATTRIB_QUICK_SELECT_CASE:
334 #ifndef DISABLE_PRINTING
335 case OPT_ATTRIB_PRINT_HEADER:
336 #endif /* !DISABLE_PRINTING */
337 case OPT_ATTRIB_PROCESS_ONLY_UNREAD:
338 case OPT_ATTRIB_PROMPT_FOLLOWUPTO:
339 case OPT_ATTRIB_QUOTE_CHARS:
340 case OPT_ATTRIB_SAVEDIR:
341 case OPT_ATTRIB_SAVEFILE:
342 case OPT_ATTRIB_SHOW_AUTHOR:
343 case OPT_ATTRIB_SHOW_ONLY_UNREAD_ARTS:
344 case OPT_ATTRIB_SHOW_SIGNATURES:
345 case OPT_ATTRIB_SIGDASHES:
346 case OPT_ATTRIB_SIGFILE:
347 case OPT_ATTRIB_SIGNATURE_REPOST:
348 case OPT_ATTRIB_THREAD_ARTICLES:
349 case OPT_ATTRIB_THREAD_CATCHUP_ON_EXIT:
350 case OPT_ATTRIB_THREAD_FORMAT:
351 case OPT_ATTRIB_THREAD_PERC:
352 case OPT_ATTRIB_TRIM_ARTICLE_BODY:
353 case OPT_ATTRIB_TEX2ISO_CONV:
354 case OPT_ATTRIB_SORT_THREADS_TYPE:
355 #ifdef CHARSET_CONVERSION
356 case OPT_ATTRIB_MM_NETWORK_CHARSET:
357 case OPT_ATTRIB_UNDECLARED_CHARSET:
358 #endif /* CHARSET_CONVERSION */
359 case OPT_ATTRIB_VERBATIM_HANDLING:
360 case OPT_ATTRIB_WRAP_ON_NEXT_UNREAD:
361 case OPT_ATTRIB_SORT_ARTICLE_TYPE:
362 case OPT_ATTRIB_POST_PROCESS_TYPE:
363 case OPT_ATTRIB_X_BODY:
364 case OPT_ATTRIB_X_COMMENT_TO:
365 case OPT_ATTRIB_X_HEADERS:
366 return curr_scope ? TRUE : FALSE;
367
368 #ifdef HAVE_COLOR
369 case OPT_ATTRIB_EXTQUOTE_HANDLING:
370 return curr_scope ? tinrc.use_color : FALSE;
371 #endif /* HAVE_COLOR */
372
373 default:
374 return curr_scope ? FALSE : TRUE;
375 }
376 }
377
378
379 /*
380 * returns TRUE if option is OPT_TITLE else FALSE
381 */
382 static t_bool
383 option_is_title(
384 enum option_enum option)
385 {
386 return option_table[option].var_type == OPT_TITLE;
387 }
388
389
390 /*
391 * returns TRUE if option is on the current page else FALSE
392 */
393 static t_bool
394 option_on_page(
395 enum option_enum option)
396 {
397 return ((option >= first_option_on_screen) && (option <= last_option_on_screen));
398 }
399
400
401 char *
402 fmt_option_prompt(
403 char *dst,
404 size_t len,
405 t_bool editing,
406 enum option_enum option)
407 {
408 char *buf;
409 size_t option_width = (size_t) MAX(35, cCOLS / 2 - 9);
410 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
411 wchar_t *wbuf, *wbuf2;
412
413 /* convert the option text to wchar_t */
414 wbuf = char2wchar_t(_(option_table[option].txt->opt));
415 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
416
417 if (!option_is_title(option)) {
418 char flag;
419 int num = get_option_num(option);
420
421 flag = (curr_scope && check_state(option)) ? '+' : ' ';
422 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
423 if (wbuf != NULL) {
424 wbuf2 = wstrunc(wbuf, (int) option_width);
425 if ((buf = wchar_t2char(wbuf2)) == NULL) {
426 /* conversion failed, truncate original string */
427 buf = strunc(_(option_table[option].txt->opt), (int) option_width);
428 snprintf(dst, len, "%s %c%3d %-*.*s: ", editing ? "->" : " ", flag, num, (int) option_width, (int) option_width, buf);
429 } else
430 snprintf(dst, len, "%s %c%3d %-*.*s: ", editing ? "->" : " ", flag, num,
431 (int) (strlen(buf) + option_width - (size_t) wcswidth(wbuf2, option_width + 1)),
432 (int) (strlen(buf) + option_width - (size_t) wcswidth(wbuf2, option_width + 1)), buf);
433 free(wbuf2);
434 } else
435 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
436 {
437 /* truncate original string */
438 buf = strunc(_(option_table[option].txt->opt), (int) option_width);
439 snprintf(dst, len, "%s %c%3d %-*.*s: ", editing ? "->" : " ", flag, num, (int) option_width, (int) option_width, buf);
440 }
441 } else {
442 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
443 if (wbuf != NULL) {
444 wbuf2 = wstrunc(wbuf, cCOLS - 3);
445 if ((buf = wchar_t2char(wbuf2)) == NULL) /* conversion failed, truncate original string */
446 buf = strunc(_(option_table[option].txt->opt), cCOLS - 3);
447 free(wbuf2);
448 } else
449 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
450 buf = strunc(_(option_table[option].txt->opt), cCOLS - 3); /* truncate original string */
451 snprintf(dst, len, " %s", buf);
452 }
453
454 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
455 FreeIfNeeded(wbuf);
456 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
457 FreeIfNeeded(buf);
458 return dst;
459 }
460
461
462 static void
463 print_any_option(
464 enum option_enum option)
465 {
466 constext **list;
467 char temp[LEN], *ptr, *ptr2;
468 int row = option_row(option);
469 size_t len = sizeof(temp) - 1;
470 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE) && defined(USE_CURSES)
471 char *buf;
472 #endif /* MULTIBYTE_ABLE && !NO_LOCALE && USE_CURSES */
473
474 MoveCursor(row, 0);
475
476 ptr = fmt_option_prompt(temp, len, FALSE, option);
477 ptr += strlen(temp);
478 len -= strlen(temp);
479
480 switch (option_table[option].var_type) {
481 case OPT_ON_OFF:
482 /* %-3s to match the length of OFF */
483 snprintf(ptr, len, "%-3s", print_boolean(*OPT_ON_OFF_list[option_table[option].var_index]));
484 break;
485
486 case OPT_LIST:
487 list = option_table[option].opt_list;
488 ptr2 = my_strdup(list[*(option_table[option].variable) + ((strcasecmp(_(list[0]), _(txt_default)) == 0) ? 1 : 0)]);
489 strncpy(ptr, _(ptr2), len);
490 free(ptr2);
491 break;
492
493 case OPT_STRING:
494 strncpy(ptr, OPT_STRING_list[option_table[option].var_index], len);
495 break;
496
497 case OPT_NUM:
498 snprintf(ptr, len, "%d", *(option_table[option].variable));
499 break;
500
501 case OPT_CHAR:
502 snprintf(ptr, len, "%"T_CHAR_FMT, *OPT_CHAR_list[option_table[option].var_index]);
503 break;
504
505 default:
506 break;
507 }
508 #ifdef USE_CURSES
509 # if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
510 if ((buf = spart(temp, cCOLS - 1, FALSE)) != NULL) {
511 my_printf("%s", buf);
512 free(buf);
513 } else
514 # endif /* MULTIBYTE_ABLE && !NO_LOCALE */
515 my_printf("%.*s", cCOLS - 1, temp);
516 {
517 # if 1 /* portable enough? */
518 int x = getcurx(stdscr);
519 # else
520 int y, x;
521
522 getyx(stdscr, y, x);
523 # endif /* 1 */
524 if (x < cCOLS)
525 clrtoeol();
526 }
527 #else
528 my_printf("%.*s", cCOLS - 1, temp);
529 /* draw_arrow_mark() will read this back for repainting */
530 if (tinrc.strip_blanks)
531 strncpy(screen[row - INDEX_TOP].col, temp, (size_t) (cCOLS - 1));
532 else
533 snprintf(screen[row - INDEX_TOP].col, (size_t) cCOLS, "%-*s", cCOLS - 1, temp);
534 #endif /* USE_CURSES */
535 }
536
537
538 static void
539 repaint_option(
540 enum option_enum option)
541 {
542 if (option_on_page(option))
543 print_any_option(option);
544 }
545
546
547 #ifdef USE_CURSES
548 static void
549 do_scroll(
550 int jump)
551 {
552 scrollok(stdscr, TRUE);
553 MoveCursor(INDEX_TOP, 0);
554 SetScrollRegion(INDEX_TOP, INDEX_TOP + option_lines_per_page - 1);
555 ScrollScreen(jump);
556 SetScrollRegion(0, LINES - 1);
557 scrollok(stdscr, FALSE);
558 }
559 #endif /* USE_CURSES */
560
561
562 /*
563 * returns the option after moving 'move' positions up or down
564 * updates also first_option_on_screen and last_option_on screen accordingly
565 */
566 static enum option_enum
567 move_cursor(
568 enum option_enum cur_option,
569 t_bool down)
570 {
571 enum option_enum old_option = cur_option;
572
573 if (down) { /* move down */
574 do {
575 cur_option = next_option(cur_option, TRUE);
576 if (cur_option > last_option_on_screen) {
577 /* move the markers one option down */
578 last_option_on_screen = cur_option;
579 first_option_on_screen = next_option(first_option_on_screen, TRUE);
580 #ifdef USE_CURSES
581 do_scroll(1);
582 print_any_option(cur_option);
583 #else
584 show_config_page();
585 #endif /* USE_CURSES */
586 } else if (cur_option < first_option_on_screen) {
587 /* wrap around: set to begin of option list */
588 first_option_on_screen = cur_option;
589 set_last_option_on_screen(cur_option);
590 show_config_page();
591 }
592 } while (option_is_title(cur_option) && old_option != cur_option);
593 } else { /* move up */
594 do {
595 cur_option = prev_option(cur_option, TRUE);
596 if (cur_option < first_option_on_screen) {
597 /* move the markers one option up */
598 first_option_on_screen = cur_option;
599 set_last_option_on_screen(cur_option);
600 #ifdef USE_CURSES
601 do_scroll(-1);
602 print_any_option(cur_option);
603 #else
604 show_config_page();
605 #endif /* USE_CURSES */
606 } else if (cur_option > last_option_on_screen) {
607 /* wrap around: set to end of option list */
608 last_option_on_screen = cur_option;
609 set_first_option_on_screen(cur_option);
610 show_config_page();
611 }
612 } while (option_is_title(cur_option) && old_option != cur_option);
613 }
614 return cur_option;
615 }
616
617
618 /*
619 * scroll the screen one line down
620 * the selected option is only moved if it is scrolled off the screen
621 */
622 static enum option_enum
623 opt_scroll_down(
624 enum option_enum option)
625 {
626 if (last_option_on_screen < last_opt) {
627 first_option_on_screen = next_option(first_option_on_screen, TRUE);
628 set_last_option_on_screen(first_option_on_screen);
629 #ifdef USE_CURSES
630 do_scroll(1);
631 print_any_option(last_option_on_screen);
632 stow_cursor();
633 #else
634 show_config_page();
635 #endif /* USE_CURSES */
636 if (option < first_option_on_screen) {
637 option = first_option_on_screen;
638 if (option_is_title(option))
639 option = next_option(option, FALSE);
640 #ifdef USE_CURSES
641 highlight_option(option);
642 #endif /* USE_CURSES */
643 }
644 #ifndef USE_CURSES
645 /* in the !USE_CURSES case we must always highlight the option */
646 highlight_option(option);
647 #endif /* !USE_CURSES */
648 }
649 return option;
650 }
651
652
653 /*
654 * scroll the screen one line up
655 * the selected option is only moved if it is scrolled off the screen
656 */
657 static enum option_enum
658 opt_scroll_up(
659 enum option_enum option)
660 {
661 if (first_option_on_screen > 0) {
662 first_option_on_screen = prev_option(first_option_on_screen, TRUE);
663 set_last_option_on_screen(first_option_on_screen);
664 #ifdef USE_CURSES
665 do_scroll(-1);
666 print_any_option(first_option_on_screen);
667 stow_cursor();
668 #else
669 show_config_page();
670 #endif /* USE_CURSES */
671 if (option > last_option_on_screen) {
672 option = last_option_on_screen;
673 if (option_is_title(option))
674 option = prev_option(option, FALSE);
675 #ifdef USE_CURSES
676 highlight_option(option);
677 #endif /* USE_CURSES */
678 }
679 #ifndef USE_CURSES
680 /* in the !USE_CURSES case we must always highlight the option */
681 highlight_option(option);
682 #endif /* !USE_CURSES */
683 }
684 return option;
685 }
686
687
688 /*
689 * returns the next visible option
690 * if 'incl_titles' is TRUE titles are also returned else they are skipped
691 */
692 static enum option_enum
693 next_option(
694 enum option_enum option,
695 t_bool incl_titles)
696 {
697 do {
698 option++;
699 if (option > last_opt)
700 option = 0;
701 } while (!(option_is_visible(option) && (incl_titles || !option_is_title(option))));
702
703 return option;
704 }
705
706
707 /*
708 * returns the previous visible option
709 * if 'incl_titles' is TRUE titles are also returned else they are skipped
710 */
711 static enum option_enum
712 prev_option(
713 enum option_enum option,
714 t_bool incl_titles)
715 {
716 do {
717 if (option == 0)
718 option = last_opt;
719 else
720 option--;
721 } while (!(option_is_visible(option) && (incl_titles || !option_is_title(option))));
722
723 return option;
724 }
725
726
727 /*
728 * set first_option_on_screen in such way that 'last_option' will be
729 * the last option on the screen
730 */
731 static void
732 set_first_option_on_screen(
733 enum option_enum last_option)
734 {
735 int i;
736
737 first_option_on_screen = last_option;
738 for (i = 1; i < option_lines_per_page && first_option_on_screen > 0; i++)
739 first_option_on_screen = prev_option(first_option_on_screen, TRUE);
740
741 /*
742 * make sure that the first page is used completely
743 */
744 if (first_option_on_screen == 0)
745 set_last_option_on_screen(0);
746 }
747
748
749 /*
750 * set last_option_on_screen in such way that 'first_option' will be
751 * the first option on the screen
752 */
753 static void
754 set_last_option_on_screen(
755 enum option_enum first_option)
756 {
757 int i;
758
759 last_option_on_screen = first_option;
760 /*
761 * on last page, there need not be option_lines_per_page options
762 */
763 for (i = 1; i < option_lines_per_page && last_option_on_screen < last_opt; i++)
764 last_option_on_screen = next_option(last_option_on_screen, TRUE);
765 }
766
767
768 static void
769 highlight_option(
770 enum option_enum option)
771 {
772 refresh_config_page(option); /* to keep refresh_config_page():last_option up-to-date */
773 draw_arrow_mark(option_row(option));
774 info_message("%s", _(option_table[option].txt->opt));
775 }
776
777
778 static void
779 unhighlight_option(
780 enum option_enum option)
781 {
782 /* Astonishing hack */
783 t_menu *savemenu = currmenu;
784 t_menu cfgmenu = { 0, 1, 0, NULL, NULL, NULL };
785
786 currmenu = &cfgmenu;
787 currmenu->curr = option_row(option) - INDEX_TOP;
788 erase_arrow();
789 currmenu = savemenu;
790 clear_message();
791 }
792
793
794 /*
795 * Refresh the config page which holds the actual option. If act_option is
796 * smaller zero fall back on the last given option (first option if there was
797 * no last option) and refresh the screen.
798 */
799 void
800 refresh_config_page(
801 enum option_enum act_option)
802 {
803 static enum option_enum last_option = 0;
804 /* t_bool force_redraw = FALSE; */
805
806 if (act_option == SIGNAL_HANDLER) { /* called by signal handler */
807 /* force_redraw = TRUE; */
808 act_option = last_option;
809 set_last_option_on_screen(first_option_on_screen); /* terminal size may have changed */
810 if (!option_on_page(last_option)) {
811 last_option_on_screen = last_option;
812 set_first_option_on_screen(last_option);
813 }
814 redraw_screen(last_option);
815 }
816 last_option = act_option;
817 }
818
819
820 static void
821 redraw_screen(
822 enum option_enum option)
823 {
824 show_config_page();
825 highlight_option(option);
826 }
827
828
829 /*
830 * show_menu_help
831 */
832 void
833 show_menu_help(
834 const char *help_message)
835 {
836 MoveCursor(cLINES - 2, 0);
837 CleartoEOLN();
838 center_line(cLINES - 2, FALSE, _(help_message));
839 }
840
841
842 /*
843 * display current configuration page
844 */
845 static void
846 show_config_page(
847 void)
848 {
849 enum option_enum i;
850
851 signal_context = curr_scope ? cAttrib : cConfig;
852 mark_offset = 0;
853
854 ClearScreen();
855 center_line(0, TRUE, curr_scope ? curr_scope->scope : _(txt_options_menu));
856
857 for (i = first_option_on_screen; i <= last_option_on_screen; i++) {
858 while (!option_is_visible(i))
859 i++;
860 if (i > last_opt)
861 break;
862 print_any_option(i);
863 }
864
865 show_menu_help(txt_select_config_file_option);
866 my_flush();
867 stow_cursor();
868 }
869
870
871 /*
872 * Check if score_kill is <= score_limit_kill and if score_select >= score_limit_select
873 */
874 void
875 check_score_defaults(
876 void)
877 {
878 if (tinrc.score_kill > tinrc.score_limit_kill)
879 tinrc.score_kill = tinrc.score_limit_kill;
880
881 if (tinrc.score_select < tinrc.score_limit_select)
882 tinrc.score_select = tinrc.score_limit_select;
883 }
884
885
886 static t_function
887 option_left(
888 void)
889 {
890 return GLOBAL_QUIT;
891 }
892
893
894 static t_function
895 option_right(
896 void)
897 {
898 return CONFIG_SELECT;
899 }
900
901
902 /*
903 * set last_opt to the last visible option
904 */
905 static void
906 set_last_opt(
907 void)
908 {
909 enum option_enum i;
910
911 for (i = 0; i <= LAST_OPT; i++) {
912 if (option_is_visible(i))
913 last_opt = i;
914 }
915 }
916
917
918 /*
919 * returns the first visible option
920 */
921 static enum option_enum
922 get_first_opt(
923 void)
924 {
925 enum option_enum i;
926
927 for (i = 0; i <= last_opt; i++) {
928 if (option_is_visible(i) && !option_is_title(i))
929 break;
930 }
931 return i;
932 }
933
934
935 /*
936 * options menu so that the user can dynamically change parameters
937 */
938 void
939 config_page(
940 const char *grpname,
941 enum context level)
942 {
943 char key[MAXKEYLEN];
944 enum option_enum option, old_option;
945 enum {
946 NOT_CHANGED = 0,
947 MISC_OPTS = 1 << 0,
948 DISPLAY_OPTS = 1 << 1,
949 SCORE_OPTS = 1 << 2,
950 SHOW_AUTHOR = 1 << 3,
951 SHOW_ONLY_UNREAD = 1 << 4,
952 SORT_OPTS = 1 << 5,
953 THREAD_ARTS = 1 << 6,
954 THREAD_SCORE = 1 << 7
955 } changed = NOT_CHANGED;
956 int i, scope_idx = 0;
957 t_bool change_option = FALSE;
958 t_function func;
959 #ifdef CHARSET_CONVERSION
960 t_bool is_7bit;
961 #endif /* CHARSET_CONVERSION */
962 unsigned old_show_author = 0, old_show_unread = 0, old_thread_arts = 0;
963
964 if (curr_scope)
965 initialize_attributes();
966 if (grpname && curr_group) {
967 /*
968 * These things can be toggled by the user,
969 * keep a copy of the current value to restore
970 * the state if necessary
971 */
972 old_show_author = curr_group->attribute->show_author;
973 old_show_unread = curr_group->attribute->show_only_unread_arts;
974 old_thread_arts = curr_group->attribute->thread_articles;
975 }
976 set_last_opt();
977 option = get_first_opt();
978 first_option_on_screen = 0;
979 set_last_option_on_screen(0);
980
981 redraw_screen(option);
982 set_xclick_off();
983
984 forever {
985 switch ((func = handle_keypad(option_left, option_right, NULL, option_menu_keys))) {
986 case GLOBAL_QUIT:
987 if (grpname) {
988 if (curr_scope && scope_is_empty()) {
989 /*
990 * Called via TAB from Config 'M'enu and all attributes
991 * have default values -> delete scope
992 */
993 do_delete_scope(scope_idx);
994 curr_scope = NULL;
995 }
996 if (changed) {
997 /*
998 * At least one option or attribute has changed,
999 * write config files
1000 */
1001 write_config_file(local_config_file);
1002 write_attributes_file(local_attributes_file);
1003 }
1004 }
1005 /* FALLTHROUGH */
1006 case CONFIG_NO_SAVE:
1007 if (grpname && curr_scope) {
1008 /*
1009 * Called via TAB from Config 'M'enu,
1010 * delete scope if all attributes have default values
1011 */
1012 if (scope_is_empty())
1013 do_delete_scope(scope_idx);
1014 curr_scope = NULL;
1015 }
1016 assign_attributes_to_groups();
1017 if (grpname && curr_group) {
1018 /*
1019 * These things can be toggled by the user,
1020 * restore the cached state if no changes were made
1021 */
1022 if (!(changed & SHOW_AUTHOR))
1023 curr_group->attribute->show_author = CAST_BITS(old_show_author, show_author);
1024 if (!(changed & SHOW_ONLY_UNREAD))
1025 curr_group->attribute->show_only_unread_arts = CAST_BOOL(old_show_unread);
1026 if (!(changed & THREAD_ARTS))
1027 curr_group->attribute->thread_articles = CAST_BITS(old_thread_arts, thread_articles);
1028
1029 if (changed) {
1030 t_bool filtered = FALSE;
1031 t_bool old_keep_in_base = TRUE;
1032
1033 /*
1034 * recook if an article is open
1035 */
1036 if (changed & DISPLAY_OPTS) {
1037 if (pgart.raw)
1038 resize_article(TRUE, &pgart);
1039 }
1040 /*
1041 * Clear art->keep_in_base if switching to !show_only_unread_arts
1042 */
1043 if ((changed & SHOW_ONLY_UNREAD) && !curr_group->attribute->show_only_unread_arts) {
1044 for_each_art(i)
1045 arts[i].keep_in_base = FALSE;
1046 }
1047
1048 if (changed & SCORE_OPTS) {
1049 unfilter_articles(curr_group);
1050 read_filter_file(filter_file);
1051 filtered = filter_articles(curr_group);
1052 }
1053 /*
1054 * If the sorting/threading strategy of threads or filter options have
1055 * changed, fix things so that resorting will occur
1056 *
1057 * If show_only_unread_arts or the scoring of a thread has changed,
1058 * resort base[] (find_base() is called inside make_threads() too, so
1059 * do this only if make_threads() was not called before)
1060 *
1061 * If we were called from page level, keep the current article in
1062 * base[]. This prevents that find_base() removes the current article
1063 * after switching to show_only_unread.
1064 */
1065 if (level == cPage) {
1066 old_keep_in_base = arts[this_resp].keep_in_base;
1067 arts[this_resp].keep_in_base = TRUE;
1068 }
1069 if (changed & (THREAD_ARTS | SORT_OPTS))
1070 make_threads(curr_group, TRUE);
1071 else if (filtered)
1072 make_threads(curr_group, FALSE);
1073 else if (changed & (SHOW_ONLY_UNREAD | THREAD_SCORE))
1074 find_base(curr_group);
1075
1076 if (level == cPage)
1077 arts[this_resp].keep_in_base = CAST_BOOL(old_keep_in_base);
1078 }
1079 }
1080 clear_note_area();
1081 return;
1082
1083 case GLOBAL_BUGREPORT:
1084 bug_report();
1085 redraw_screen(option);
1086 break;
1087
1088 case GLOBAL_HELP:
1089 if (curr_scope)
1090 show_help_page(ATTRIB_LEVEL, _(txt_attrib_menu_com));
1091 else
1092 show_help_page(CONFIG_LEVEL, _(txt_options_menu_com));
1093 redraw_screen(option);
1094 break;
1095
1096 case GLOBAL_LINE_UP:
1097 unhighlight_option(option);
1098 option = move_cursor(option, FALSE);
1099 highlight_option(option);
1100 break;
1101
1102 case GLOBAL_LINE_DOWN:
1103 unhighlight_option(option);
1104 option = move_cursor(option, TRUE);
1105 highlight_option(option);
1106 break;
1107
1108 case GLOBAL_FIRST_PAGE:
1109 unhighlight_option(option);
1110 option = get_first_opt();
1111 first_option_on_screen = 0;
1112 set_last_option_on_screen(0);
1113 redraw_screen(option);
1114 /* highlight_option(option); is already done by redraw_screen() */
1115 break;
1116
1117 case GLOBAL_LAST_PAGE:
1118 unhighlight_option(option);
1119 option = last_opt;
1120 last_option_on_screen = last_opt;
1121 set_first_option_on_screen(last_opt);
1122 redraw_screen(option);
1123 /* highlight_option(option); is already done by redraw_screen() */
1124 break;
1125
1126 case GLOBAL_PAGE_UP:
1127 unhighlight_option(option);
1128 if (option != first_option_on_screen && !(option_is_title(first_option_on_screen) && option == next_option(first_option_on_screen, FALSE))) {
1129 option = first_option_on_screen;
1130 if (option_is_title(option))
1131 option = next_option(option, FALSE);
1132 highlight_option(option);
1133 break;
1134 } else if (tinrc.scroll_lines == -2 && first_option_on_screen != 0) {
1135 i = option_lines_per_page / 2;
1136
1137 for (; i > 0; i--) {
1138 last_option_on_screen = prev_option(last_option_on_screen, TRUE);
1139 if (last_option_on_screen == last_opt) /* end on wrap around */
1140 break;
1141 }
1142 } else
1143 last_option_on_screen = prev_option(first_option_on_screen, TRUE);
1144
1145 set_first_option_on_screen(last_option_on_screen);
1146 if (last_option_on_screen == last_opt)
1147 option = last_option_on_screen;
1148 else
1149 option = first_option_on_screen;
1150 if (option_is_title(option))
1151 option = next_option(option, FALSE);
1152 redraw_screen(option);
1153 /* highlight_option(option); is already done by redraw_screen() */
1154 break;
1155
1156 case GLOBAL_PAGE_DOWN:
1157 unhighlight_option(option);
1158 if (option == last_opt) {
1159 /* wrap around */
1160 first_option_on_screen = 0;
1161 option = 0;
1162 } else {
1163 enum option_enum old_first = first_option_on_screen;
1164
1165 if (tinrc.scroll_lines == -2) {
1166 i = option_lines_per_page / 2;
1167
1168 for (; i > 0; i--) {
1169 first_option_on_screen = next_option(first_option_on_screen, TRUE);
1170 if (first_option_on_screen == 0) /* end on wrap_around */
1171 break;
1172 }
1173 } else
1174 first_option_on_screen = next_option(last_option_on_screen, TRUE);
1175
1176 if (first_option_on_screen == 0) {
1177 first_option_on_screen = old_first;
1178 option = last_opt;
1179 highlight_option(option);
1180 break;
1181 } else
1182 option = first_option_on_screen;
1183 }
1184
1185 set_last_option_on_screen(first_option_on_screen);
1186 if (option_is_title(option))
1187 option = next_option(option, FALSE);
1188 redraw_screen(option);
1189 /* highlight_option(option); is already done by redraw_screen() */
1190 break;
1191
1192 case GLOBAL_SCROLL_UP:
1193 option = opt_scroll_up(option);
1194 break;
1195
1196 case GLOBAL_SCROLL_DOWN:
1197 option = opt_scroll_down(option);
1198 break;
1199
1200 case DIGIT_1:
1201 case DIGIT_2:
1202 case DIGIT_3:
1203 case DIGIT_4:
1204 case DIGIT_5:
1205 case DIGIT_6:
1206 case DIGIT_7:
1207 case DIGIT_8:
1208 case DIGIT_9:
1209 unhighlight_option(option);
1210 option = set_option_num(prompt_num(func_to_key(func, option_menu_keys), _(txt_enter_option_num)));
1211 if (!option_on_page(option)) {
1212 first_option_on_screen = option;
1213 set_last_option_on_screen(option);
1214 redraw_screen(option);
1215 } else
1216 highlight_option(option);
1217 break;
1218
1219 #ifndef NO_SHELL_ESCAPE
1220 case GLOBAL_SHELL_ESCAPE:
1221 shell_escape();
1222 redraw_screen(option);
1223 break;
1224 #endif /* !NO_SHELL_ESCAPE */
1225
1226 case GLOBAL_SEARCH_SUBJECT_FORWARD:
1227 case GLOBAL_SEARCH_SUBJECT_BACKWARD:
1228 case GLOBAL_SEARCH_REPEAT:
1229 if (func == GLOBAL_SEARCH_REPEAT && last_search != GLOBAL_SEARCH_SUBJECT_FORWARD && last_search != GLOBAL_SEARCH_SUBJECT_BACKWARD)
1230 info_message(_(txt_no_prev_search));
1231 else {
1232 old_option = option;
1233 option = search_config((func == GLOBAL_SEARCH_SUBJECT_FORWARD), (func == GLOBAL_SEARCH_REPEAT), option, last_opt);
1234 if (option != old_option) {
1235 unhighlight_option(old_option);
1236 if (!option_on_page(option)) {
1237 first_option_on_screen = option;
1238 set_last_option_on_screen(option);
1239 redraw_screen(option);
1240 } else
1241 highlight_option(option);
1242 }
1243 }
1244 break;
1245
1246 case CONFIG_SCOPE_MENU:
1247 if (!curr_scope) {
1248 scope_page(level);
1249 set_last_opt();
1250 option = get_first_opt();
1251 first_option_on_screen = 0;
1252 set_last_option_on_screen(0);
1253 redraw_screen(option);
1254 }
1255 break;
1256
1257 case CONFIG_RESET_ATTRIB:
1258 if (curr_scope) {
1259 if (curr_scope->global)
1260 info_message(_(txt_scope_operation_not_allowed));
1261 else if (check_state(option)) {
1262 reset_state(option);
1263 changed |= MISC_OPTS;
1264 redraw_screen(option);
1265 }
1266 }
1267 break;
1268
1269 case CONFIG_SELECT:
1270 if (curr_scope && curr_scope->global)
1271 info_message(_(txt_scope_operation_not_allowed));
1272 else
1273 change_option = TRUE;
1274 break;
1275
1276 case CONFIG_TOGGLE_ATTRIB:
1277 if (grpname) {
1278 if (curr_scope) {
1279 if (scope_is_empty()) {
1280 do_delete_scope(scope_idx);
1281 scope_idx = 0;
1282 }
1283 curr_scope = NULL;
1284 } else {
1285 if (!(scope_idx = find_scope(grpname)))
1286 scope_idx = add_scope(grpname);
1287 if (scope_idx) {
1288 curr_scope = &scopes[scope_idx];
1289 initialize_attributes();
1290 }
1291 }
1292 set_last_opt();
1293 option = get_first_opt();
1294 first_option_on_screen = 0;
1295 set_last_option_on_screen(0);
1296 redraw_screen(option);
1297 }
1298 break;
1299
1300 case GLOBAL_REDRAW_SCREEN:
1301 my_retouch();
1302 set_xclick_off();
1303 set_last_option_on_screen(first_option_on_screen);
1304 redraw_screen(option);
1305 break;
1306
1307 case GLOBAL_VERSION:
1308 info_message(cvers);
1309 break;
1310
1311 default:
1312 info_message(_(txt_bad_command), PrintFuncKey(key, GLOBAL_HELP, option_menu_keys));
1313 break;
1314 } /* switch (ch) */
1315
1316 if (change_option) {
1317 switch (option_table[option].var_type) {
1318 case OPT_ON_OFF:
1319 switch (option) {
1320 case OPT_ABBREVIATE_GROUPNAME:
1321 case OPT_AUTO_RECONNECT:
1322 case OPT_CACHE_OVERVIEW_FILES:
1323 case OPT_CATCHUP_READ_GROUPS:
1324 case OPT_FORCE_SCREEN_REDRAW:
1325 case OPT_KEEP_DEAD_ARTICLES:
1326 case OPT_SHOW_ONLY_UNREAD_GROUPS:
1327 case OPT_STRIP_NEWSRC:
1328 #if defined(HAVE_ICONV_OPEN_TRANSLIT) && defined(CHARSET_CONVERSION)
1329 case OPT_TRANSLIT:
1330 #endif /* HAVE_ICONV_OPEN_TRANSLIT && CHARSET_CONVERSION */
1331 case OPT_UNLINK_ARTICLE:
1332 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
1333 case OPT_UTF8_GRAPHICS:
1334 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
1335 case OPT_URL_HIGHLIGHT:
1336 #ifdef HAVE_KEYPAD
1337 case OPT_USE_KEYPAD:
1338 #endif /* HAVE_KEYPAD */
1339 case OPT_USE_MOUSE:
1340 if (prompt_option_on_off(option))
1341 changed |= MISC_OPTS;
1342 break;
1343
1344 case OPT_ADD_POSTED_TO_FILTER:
1345 if (prompt_option_on_off(option))
1346 UPDATE_BOOL_ATTRIBUTES(add_posted_to_filter);
1347 break;
1348
1349 case OPT_ADVERTISING:
1350 if (prompt_option_on_off(option))
1351 UPDATE_BOOL_ATTRIBUTES(advertising);
1352 break;
1353
1354 case OPT_ALTERNATIVE_HANDLING:
1355 if (prompt_option_on_off(option))
1356 UPDATE_BOOL_ATTRIBUTES(alternative_handling);
1357 break;
1358
1359 case OPT_ASK_FOR_METAMAIL:
1360 if (prompt_option_on_off(option))
1361 UPDATE_BOOL_ATTRIBUTES(ask_for_metamail);
1362 break;
1363
1364 case OPT_AUTO_LIST_THREAD:
1365 if (prompt_option_on_off(option))
1366 UPDATE_BOOL_ATTRIBUTES(auto_list_thread);
1367 break;
1368
1369 case OPT_BATCH_SAVE:
1370 if (prompt_option_on_off(option))
1371 UPDATE_BOOL_ATTRIBUTES(batch_save);
1372 break;
1373
1374 #ifdef HAVE_COLOR
1375 case OPT_EXTQUOTE_HANDLING:
1376 /*
1377 * option toggles visibility of other
1378 * options -> needs redraw_screen()
1379 */
1380 if (prompt_option_on_off(option)) {
1381 UPDATE_BOOL_ATTRIBUTES(extquote_handling);
1382 set_last_option_on_screen(first_option_on_screen);
1383 redraw_screen(option);
1384 changed |= DISPLAY_OPTS;
1385 }
1386 break;
1387 #endif /* HAVE_COLOR */
1388
1389 case OPT_GROUP_CATCHUP_ON_EXIT:
1390 if (prompt_option_on_off(option))
1391 UPDATE_BOOL_ATTRIBUTES(group_catchup_on_exit);
1392 break;
1393
1394 case OPT_MARK_IGNORE_TAGS:
1395 if (prompt_option_on_off(option))
1396 UPDATE_BOOL_ATTRIBUTES(mark_ignore_tags);
1397 break;
1398
1399 case OPT_MARK_SAVED_READ:
1400 if (prompt_option_on_off(option))
1401 UPDATE_BOOL_ATTRIBUTES(mark_saved_read);
1402 break;
1403
1404 case OPT_POST_PROCESS_VIEW:
1405 if (prompt_option_on_off(option))
1406 UPDATE_BOOL_ATTRIBUTES(post_process_view);
1407 break;
1408
1409 case OPT_POS_FIRST_UNREAD:
1410 if (prompt_option_on_off(option))
1411 UPDATE_BOOL_ATTRIBUTES(pos_first_unread);
1412 break;
1413
1414 #ifndef DISABLE_PRINTING
1415 case OPT_PRINT_HEADER:
1416 if (prompt_option_on_off(option))
1417 UPDATE_BOOL_ATTRIBUTES(print_header);
1418 break;
1419 #endif /* !DISABLE_PRINTING */
1420
1421 case OPT_PROCESS_ONLY_UNREAD:
1422 if (prompt_option_on_off(option))
1423 UPDATE_BOOL_ATTRIBUTES(process_only_unread);
1424 break;
1425
1426 case OPT_PROMPT_FOLLOWUPTO:
1427 if (prompt_option_on_off(option))
1428 UPDATE_BOOL_ATTRIBUTES(prompt_followupto);
1429 break;
1430
1431 case OPT_SHOW_SIGNATURES:
1432 if (prompt_option_on_off(option))
1433 UPDATE_BOOL_ATTRIBUTES(show_signatures);
1434 break;
1435
1436 case OPT_SIGDASHES:
1437 if (prompt_option_on_off(option))
1438 UPDATE_BOOL_ATTRIBUTES(sigdashes);
1439 break;
1440
1441 case OPT_SIGNATURE_REPOST:
1442 if (prompt_option_on_off(option))
1443 UPDATE_BOOL_ATTRIBUTES(signature_repost);
1444 break;
1445
1446 #ifndef USE_CURSES
1447 case OPT_STRIP_BLANKS:
1448 if (prompt_option_on_off(option)) {
1449 redraw_screen(option);
1450 changed |= MISC_OPTS;
1451 }
1452 break;
1453 #endif /* !USE_CURSES */
1454
1455 case OPT_TEX2ISO_CONV:
1456 if (prompt_option_on_off(option))
1457 UPDATE_BOOL_ATTRIBUTES(tex2iso_conv);
1458 break;
1459
1460 case OPT_THREAD_CATCHUP_ON_EXIT:
1461 if (prompt_option_on_off(option))
1462 UPDATE_BOOL_ATTRIBUTES(thread_catchup_on_exit);
1463 break;
1464
1465 case OPT_WRAP_ON_NEXT_UNREAD:
1466 if (prompt_option_on_off(option))
1467 UPDATE_BOOL_ATTRIBUTES(wrap_on_next_unread);
1468 break;
1469
1470 case OPT_VERBATIM_HANDLING:
1471 /*
1472 * option toggles visibility of other
1473 * options -> needs redraw_screen()
1474 */
1475 if (prompt_option_on_off(option)) {
1476 UPDATE_BOOL_ATTRIBUTES(verbatim_handling);
1477 set_last_option_on_screen(first_option_on_screen);
1478 redraw_screen(option);
1479 }
1480 break;
1481
1482 /* show mini help menu */
1483 case OPT_BEGINNER_LEVEL:
1484 if (prompt_option_on_off(option)) {
1485 set_noteslines(cLINES);
1486 changed |= MISC_OPTS;
1487 }
1488 break;
1489
1490 /* show all arts or just new/unread arts */
1491 case OPT_SHOW_ONLY_UNREAD_ARTS:
1492 if (prompt_option_on_off(option)) {
1493 UPDATE_BOOL_ATTRIBUTES(show_only_unread_arts);
1494 changed |= SHOW_ONLY_UNREAD;
1495 }
1496 break;
1497
1498 /* draw -> / highlighted bar */
1499 case OPT_DRAW_ARROW:
1500 if (prompt_option_on_off(option)) {
1501 unhighlight_option(option);
1502 if (!tinrc.draw_arrow && !tinrc.inverse_okay) {
1503 tinrc.inverse_okay = TRUE;
1504 repaint_option(OPT_INVERSE_OKAY);
1505 center_line(0, TRUE, _(txt_options_menu));
1506 }
1507 changed |= MISC_OPTS;
1508 }
1509 break;
1510
1511 /* draw inversed screen header lines */
1512 /* draw inversed group/article/option line if draw_arrow is OFF */
1513 case OPT_INVERSE_OKAY:
1514 if (prompt_option_on_off(option)) {
1515 unhighlight_option(option);
1516 if (!tinrc.draw_arrow && !tinrc.inverse_okay) {
1517 tinrc.draw_arrow = TRUE; /* we don't want to navigate blindly */
1518 repaint_option(OPT_DRAW_ARROW);
1519 }
1520 center_line(0, TRUE, _(txt_options_menu));
1521 changed |= MISC_OPTS;
1522 }
1523 break;
1524
1525 case OPT_MAIL_8BIT_HEADER:
1526 if (prompt_option_on_off(option)) {
1527 if (tinrc.mail_mime_encoding != MIME_ENCODING_8BIT) {
1528 tinrc.mail_8bit_header = FALSE;
1529 print_any_option(OPT_MAIL_8BIT_HEADER);
1530 }
1531 UPDATE_BOOL_ATTRIBUTES(mail_8bit_header);
1532 }
1533 break;
1534
1535 case OPT_POST_8BIT_HEADER:
1536 if (prompt_option_on_off(option)) {
1537 /* if post_mime_encoding != 8bit, post_8bit_header is disabled */
1538 if (tinrc.post_mime_encoding != MIME_ENCODING_8BIT) {
1539 tinrc.post_8bit_header = FALSE;
1540 print_any_option(OPT_POST_8BIT_HEADER);
1541 }
1542 UPDATE_BOOL_ATTRIBUTES(post_8bit_header);
1543 }
1544 break;
1545
1546 /* show newsgroup description text next to newsgroups */
1547 case OPT_SHOW_DESCRIPTION:
1548 if (prompt_option_on_off(option)) {
1549 show_description = tinrc.show_description;
1550 if (show_description) /* force reread of newgroups file */
1551 read_descriptions(FALSE);
1552 changed |= MISC_OPTS;
1553 }
1554 break;
1555
1556 #ifdef HAVE_COLOR
1557 /* use ANSI color */
1558 case OPT_USE_COLOR:
1559 if (prompt_option_on_off(option)) {
1560 # ifdef USE_CURSES
1561 if (!has_colors())
1562 use_color = FALSE;
1563 else
1564 # endif /* USE_CURSES */
1565 use_color = tinrc.use_color;
1566 set_last_option_on_screen(first_option_on_screen);
1567 redraw_screen(option);
1568 changed |= MISC_OPTS;
1569 }
1570 break;
1571 #endif /* HAVE_COLOR */
1572
1573 #ifdef XFACE_ABLE
1574 /* use slrnface */
1575 case OPT_USE_SLRNFACE:
1576 if (prompt_option_on_off(option)) {
1577 if (!tinrc.use_slrnface)
1578 slrnface_stop();
1579 else
1580 slrnface_start();
1581 changed |= MISC_OPTS;
1582 }
1583 break;
1584 #endif /* XFACE_ABLE */
1585
1586 /* word_highlight */
1587 case OPT_WORD_HIGHLIGHT:
1588 if (prompt_option_on_off(option)) {
1589 word_highlight = tinrc.word_highlight;
1590 set_last_option_on_screen(first_option_on_screen);
1591 redraw_screen(option);
1592 changed |= MISC_OPTS;
1593 }
1594 break;
1595
1596 #if defined(HAVE_LIBICUUC) && defined(MULTIBYTE_ABLE) && defined(HAVE_UNICODE_UBIDI_H) && !defined(NO_LOCALE)
1597 case OPT_RENDER_BIDI:
1598 if (prompt_option_on_off(option))
1599 changed |= MISC_OPTS;
1600 break;
1601 #endif /* HAVE_LIBICUUC && MULTIBYTE_ABLE && HAVE_UNICODE_UBIDI_H && !NO_LOCALE */
1602
1603 case OPT_ATTRIB_ADD_POSTED_TO_FILTER:
1604 if (prompt_option_on_off(option))
1605 SET_BOOL_ATTRIBUTE(add_posted_to_filter);
1606 break;
1607
1608 case OPT_ATTRIB_ADVERTISING:
1609 if (prompt_option_on_off(option))
1610 SET_BOOL_ATTRIBUTE(advertising);
1611 break;
1612
1613 case OPT_ATTRIB_ALTERNATIVE_HANDLING:
1614 if (prompt_option_on_off(option))
1615 SET_BOOL_ATTRIBUTE(alternative_handling);
1616 break;
1617
1618 case OPT_ATTRIB_ASK_FOR_METAMAIL:
1619 if (prompt_option_on_off(option))
1620 SET_BOOL_ATTRIBUTE(ask_for_metamail);
1621 break;
1622
1623 case OPT_ATTRIB_AUTO_LIST_THREAD:
1624 if (prompt_option_on_off(option))
1625 SET_BOOL_ATTRIBUTE(auto_list_thread);
1626 break;
1627
1628 case OPT_ATTRIB_AUTO_SELECT:
1629 if (prompt_option_on_off(option))
1630 SET_BOOL_ATTRIBUTE(auto_select);
1631 break;
1632
1633 case OPT_ATTRIB_BATCH_SAVE:
1634 if (prompt_option_on_off(option))
1635 SET_BOOL_ATTRIBUTE(batch_save);
1636 break;
1637
1638 case OPT_ATTRIB_DELETE_TMP_FILES:
1639 if (prompt_option_on_off(option))
1640 SET_BOOL_ATTRIBUTE(delete_tmp_files);
1641 break;
1642
1643 #ifdef HAVE_COLOR
1644 case OPT_ATTRIB_EXTQUOTE_HANDLING:
1645 if (prompt_option_on_off(option))
1646 SET_BOOL_ATTRIBUTE(extquote_handling);
1647 break;
1648 #endif /* HAVE_COLOR */
1649
1650 case OPT_ATTRIB_GROUP_CATCHUP_ON_EXIT:
1651 if (prompt_option_on_off(option))
1652 SET_BOOL_ATTRIBUTE(group_catchup_on_exit);
1653 break;
1654
1655 case OPT_ATTRIB_MAIL_8BIT_HEADER:
1656 if (prompt_option_on_off(option))
1657 SET_BOOL_ATTRIBUTE(mail_8bit_header);
1658 break;
1659
1660 case OPT_ATTRIB_MARK_IGNORE_TAGS:
1661 if (prompt_option_on_off(option))
1662 SET_BOOL_ATTRIBUTE(mark_ignore_tags);
1663 break;
1664
1665 case OPT_ATTRIB_MARK_SAVED_READ:
1666 if (prompt_option_on_off(option))
1667 SET_BOOL_ATTRIBUTE(mark_saved_read);
1668 break;
1669
1670 case OPT_ATTRIB_MIME_FORWARD:
1671 if (prompt_option_on_off(option))
1672 SET_BOOL_ATTRIBUTE(mime_forward);
1673 break;
1674
1675 case OPT_ATTRIB_POST_8BIT_HEADER:
1676 if (prompt_option_on_off(option))
1677 SET_BOOL_ATTRIBUTE(post_8bit_header);
1678 break;
1679
1680 case OPT_ATTRIB_POST_PROCESS_VIEW:
1681 if (prompt_option_on_off(option))
1682 SET_BOOL_ATTRIBUTE(post_process_view);
1683 break;
1684
1685 case OPT_ATTRIB_POS_FIRST_UNREAD:
1686 if (prompt_option_on_off(option))
1687 SET_BOOL_ATTRIBUTE(pos_first_unread);
1688 break;
1689
1690 #ifndef DISABLE_PRINTING
1691 case OPT_ATTRIB_PRINT_HEADER:
1692 if (prompt_option_on_off(option))
1693 SET_BOOL_ATTRIBUTE(print_header);
1694 break;
1695 #endif /* !DISABLE_PRINTING */
1696
1697 case OPT_ATTRIB_PROCESS_ONLY_UNREAD:
1698 if (prompt_option_on_off(option))
1699 SET_BOOL_ATTRIBUTE(process_only_unread);
1700 break;
1701
1702 case OPT_ATTRIB_PROMPT_FOLLOWUPTO:
1703 if (prompt_option_on_off(option))
1704 SET_BOOL_ATTRIBUTE(prompt_followupto);
1705 break;
1706
1707 case OPT_ATTRIB_QUICK_KILL_CASE:
1708 if (prompt_option_on_off(option))
1709 SET_BOOL_ATTRIBUTE(quick_kill_case);
1710 break;
1711
1712 case OPT_ATTRIB_QUICK_KILL_EXPIRE:
1713 if (prompt_option_on_off(option))
1714 SET_BOOL_ATTRIBUTE(quick_kill_expire);
1715 break;
1716
1717 case OPT_ATTRIB_QUICK_SELECT_CASE:
1718 if (prompt_option_on_off(option))
1719 SET_BOOL_ATTRIBUTE(quick_select_case);
1720 break;
1721
1722 case OPT_ATTRIB_QUICK_SELECT_EXPIRE:
1723 if (prompt_option_on_off(option))
1724 SET_BOOL_ATTRIBUTE(quick_select_expire);
1725 break;
1726
1727 case OPT_ATTRIB_SHOW_ONLY_UNREAD_ARTS:
1728 if (prompt_option_on_off(option)) {
1729 SET_BOOL_ATTRIBUTE(show_only_unread_arts);
1730 changed |= SHOW_ONLY_UNREAD;
1731 }
1732 break;
1733
1734 case OPT_ATTRIB_SHOW_SIGNATURES:
1735 if (prompt_option_on_off(option))
1736 SET_BOOL_ATTRIBUTE(show_signatures);
1737 break;
1738
1739 case OPT_ATTRIB_SIGDASHES:
1740 if (prompt_option_on_off(option))
1741 SET_BOOL_ATTRIBUTE(sigdashes);
1742 break;
1743
1744 case OPT_ATTRIB_SIGNATURE_REPOST:
1745 if (prompt_option_on_off(option))
1746 SET_BOOL_ATTRIBUTE(signature_repost);
1747 break;
1748
1749 case OPT_ATTRIB_TEX2ISO_CONV:
1750 if (prompt_option_on_off(option))
1751 SET_BOOL_ATTRIBUTE(tex2iso_conv);
1752 break;
1753
1754 case OPT_ATTRIB_THREAD_CATCHUP_ON_EXIT:
1755 if (prompt_option_on_off(option))
1756 SET_BOOL_ATTRIBUTE(thread_catchup_on_exit);
1757 break;
1758
1759 case OPT_ATTRIB_VERBATIM_HANDLING:
1760 if (prompt_option_on_off(option))
1761 SET_BOOL_ATTRIBUTE(verbatim_handling);
1762 break;
1763
1764 case OPT_ATTRIB_WRAP_ON_NEXT_UNREAD:
1765 if (prompt_option_on_off(option))
1766 SET_BOOL_ATTRIBUTE(wrap_on_next_unread);
1767 break;
1768
1769 case OPT_ATTRIB_X_COMMENT_TO:
1770 if (prompt_option_on_off(option))
1771 SET_BOOL_ATTRIBUTE(x_comment_to);
1772 break;
1773
1774 default:
1775 break;
1776 } /* switch (option) */
1777 break;
1778
1779 case OPT_LIST:
1780 switch (option) {
1781 #ifdef USE_CANLOCK
1782 case OPT_CANCEL_LOCK_ALGO:
1783 #endif /* USE_CANLOCK */
1784 #ifdef HAVE_COLOR
1785 case OPT_COL_FROM:
1786 case OPT_COL_HEAD:
1787 case OPT_COL_HELP:
1788 case OPT_COL_INVERS_BG:
1789 case OPT_COL_INVERS_FG:
1790 case OPT_COL_MESSAGE:
1791 case OPT_COL_MINIHELP:
1792 case OPT_COL_NEWSHEADERS:
1793 case OPT_COL_QUOTE:
1794 case OPT_COL_QUOTE2:
1795 case OPT_COL_QUOTE3:
1796 case OPT_COL_EXTQUOTE:
1797 case OPT_COL_RESPONSE:
1798 case OPT_COL_SIGNATURE:
1799 case OPT_COL_SUBJECT:
1800 case OPT_COL_TEXT:
1801 case OPT_COL_TITLE:
1802 case OPT_COL_MARKSTAR:
1803 case OPT_COL_MARKDASH:
1804 case OPT_COL_MARKSLASH:
1805 case OPT_COL_MARKSTROKE:
1806 case OPT_COL_URLS:
1807 case OPT_COL_VERBATIM:
1808 #endif /* HAVE_COLOR */
1809 case OPT_CONFIRM_CHOICE:
1810 case OPT_GOTO_NEXT_UNREAD:
1811 case OPT_HIDE_UUE:
1812 case OPT_INTERACTIVE_MAILER:
1813 case OPT_KILL_LEVEL:
1814 case OPT_MAILBOX_FORMAT:
1815 case OPT_MONO_MARKDASH:
1816 case OPT_MONO_MARKSLASH:
1817 case OPT_MONO_MARKSTAR:
1818 case OPT_MONO_MARKSTROKE:
1819 #ifdef HAVE_UNICODE_NORMALIZATION
1820 case OPT_NORMALIZATION_FORM:
1821 #endif /* HAVE_UNICODE_NORMALIZATION */
1822 case OPT_QUOTE_STYLE:
1823 case OPT_STRIP_BOGUS:
1824 case OPT_WILDCARD:
1825 case OPT_WORD_H_DISPLAY_MARKS:
1826 #ifdef USE_HEAPSORT
1827 case OPT_SORT_FUNCTION:
1828 #endif /* USE_HEAPSORT */
1829 if (prompt_option_list(option))
1830 changed |= MISC_OPTS;
1831 break;
1832
1833 #ifdef HAVE_COLOR
1834 case OPT_COL_BACK:
1835 case OPT_COL_NORMAL:
1836 if (prompt_option_list(option)) {
1837 redraw_screen(option);
1838 changed |= MISC_OPTS;
1839 }
1840 break;
1841 #endif /* HAVE_COLOR */
1842
1843 case OPT_AUTO_CC_BCC:
1844 if (prompt_option_list(option))
1845 UPDATE_INT_ATTRIBUTES(auto_cc_bcc);
1846 break;
1847
1848 case OPT_THREAD_ARTICLES:
1849 if (prompt_option_list(option)) {
1850 UPDATE_INT_ATTRIBUTES(thread_articles);
1851 changed |= THREAD_ARTS;
1852 }
1853 break;
1854
1855 case OPT_SORT_ARTICLE_TYPE:
1856 if (prompt_option_list(option)) {
1857 UPDATE_INT_ATTRIBUTES(sort_article_type);
1858 changed |= SORT_OPTS;
1859 }
1860 break;
1861
1862 case OPT_SORT_THREADS_TYPE:
1863 if (prompt_option_list(option)) {
1864 UPDATE_INT_ATTRIBUTES(sort_threads_type);
1865 changed |= SORT_OPTS;
1866 }
1867 break;
1868
1869 case OPT_THREAD_SCORE:
1870 if (prompt_option_list(option))
1871 changed |= THREAD_SCORE;
1872 break;
1873
1874 case OPT_TRIM_ARTICLE_BODY:
1875 if (prompt_option_list(option))
1876 UPDATE_INT_ATTRIBUTES(trim_article_body);
1877 break;
1878
1879 case OPT_POST_PROCESS_TYPE:
1880 if (prompt_option_list(option))
1881 UPDATE_INT_ATTRIBUTES(post_process_type);
1882 break;
1883
1884 case OPT_SHOW_AUTHOR:
1885 if (prompt_option_list(option)) {
1886 UPDATE_INT_ATTRIBUTES(show_author);
1887 changed |= SHOW_AUTHOR;
1888 }
1889 break;
1890
1891 case OPT_MAIL_MIME_ENCODING:
1892 if (prompt_option_list(option)) {
1893 #ifdef CHARSET_CONVERSION
1894 /*
1895 * check if we have selected a !7bit encoding but a 7bit network charset
1896 * or a !8bit encoding but a 8bit network charset, update encoding if needed
1897 */
1898 is_7bit = FALSE;
1899 for (i = 0; txt_mime_7bit_charsets[i] != NULL; i++) {
1900 if (!strcasecmp(txt_mime_charsets[tinrc.mm_network_charset], txt_mime_7bit_charsets[i])) {
1901 is_7bit = TRUE;
1902 break;
1903 }
1904 }
1905 if (is_7bit) {
1906 if (tinrc.mail_mime_encoding != MIME_ENCODING_7BIT) {
1907 tinrc.mail_mime_encoding = MIME_ENCODING_7BIT;
1908 repaint_option(OPT_MAIL_MIME_ENCODING);
1909 }
1910 } else {
1911 if (tinrc.mail_mime_encoding == MIME_ENCODING_7BIT) {
1912 tinrc.mail_mime_encoding = MIME_ENCODING_QP;
1913 repaint_option(OPT_MAIL_MIME_ENCODING);
1914 }
1915 }
1916 #endif /* CHARSET_CONVERSION */
1917 UPDATE_INT_ATTRIBUTES(mail_mime_encoding);
1918 /* do not use 8 bit headers if mime encoding is not 8bit */
1919 if (tinrc.mail_mime_encoding != MIME_ENCODING_8BIT) {
1920 tinrc.mail_8bit_header = FALSE;
1921 repaint_option(OPT_MAIL_8BIT_HEADER);
1922 UPDATE_BOOL_ATTRIBUTES(mail_8bit_header);
1923 }
1924 }
1925 break;
1926
1927 case OPT_POST_MIME_ENCODING:
1928 if (prompt_option_list(option)) {
1929 #ifdef CHARSET_CONVERSION
1930 /*
1931 * check if we have selected a !7bit encoding but a 7bit network charset
1932 * or a !8bit encoding but a 8bit network charset, update encoding if needed
1933 */
1934 is_7bit = FALSE;
1935 for (i = 0; txt_mime_7bit_charsets[i] != NULL; i++) {
1936 if (!strcasecmp(txt_mime_charsets[tinrc.mm_network_charset], txt_mime_7bit_charsets[i])) {
1937 is_7bit = TRUE;
1938 break;
1939 }
1940 }
1941 if (is_7bit) {
1942 if (tinrc.post_mime_encoding != MIME_ENCODING_7BIT) {
1943 tinrc.post_mime_encoding = MIME_ENCODING_7BIT;
1944 repaint_option(OPT_POST_MIME_ENCODING);
1945 }
1946 } else {
1947 if (tinrc.post_mime_encoding == MIME_ENCODING_7BIT) {
1948 tinrc.post_mime_encoding = MIME_ENCODING_8BIT;
1949 repaint_option(OPT_POST_MIME_ENCODING);
1950 }
1951 }
1952 #endif /* CHARSET_CONVERSION */
1953 UPDATE_INT_ATTRIBUTES(post_mime_encoding);
1954 /* do not use 8 bit headers if mime encoding is not 8bit */
1955 if (tinrc.post_mime_encoding != MIME_ENCODING_8BIT) {
1956 tinrc.post_8bit_header = FALSE;
1957 repaint_option(OPT_POST_8BIT_HEADER);
1958 UPDATE_BOOL_ATTRIBUTES(post_8bit_header);
1959 }
1960 }
1961 break;
1962
1963 #ifdef CHARSET_CONVERSION
1964 case OPT_MM_NETWORK_CHARSET:
1965 if (prompt_option_list(option)) {
1966 /*
1967 * check if we have selected a 7bit charset but a !7bit encoding
1968 * or a 8bit charset but a !8bit encoding, update encoding if needed
1969 *
1970 * if (mail|post)_mime_encoding != 8bit, disable (mail|post)_8bit_header
1971 */
1972 is_7bit = FALSE;
1973 UPDATE_INT_ATTRIBUTES(mm_network_charset);
1974 for (i = 0; txt_mime_7bit_charsets[i] != NULL; i++) {
1975 if (!strcasecmp(txt_mime_charsets[tinrc.mm_network_charset], txt_mime_7bit_charsets[i])) {
1976 is_7bit = TRUE;
1977 break;
1978 }
1979 }
1980 if (is_7bit) {
1981 if (tinrc.mail_mime_encoding != MIME_ENCODING_7BIT) {
1982 tinrc.mail_mime_encoding = MIME_ENCODING_7BIT;
1983 tinrc.mail_8bit_header = FALSE;
1984 repaint_option(OPT_MAIL_MIME_ENCODING);
1985 repaint_option(OPT_MAIL_8BIT_HEADER);
1986 UPDATE_INT_ATTRIBUTES(mail_mime_encoding);
1987 UPDATE_BOOL_ATTRIBUTES(mail_8bit_header);
1988 }
1989 if (tinrc.post_mime_encoding != MIME_ENCODING_7BIT) {
1990 tinrc.post_mime_encoding = MIME_ENCODING_7BIT;
1991 tinrc.post_8bit_header = FALSE;
1992 repaint_option(OPT_POST_MIME_ENCODING);
1993 repaint_option(OPT_POST_8BIT_HEADER);
1994 UPDATE_INT_ATTRIBUTES(post_mime_encoding);
1995 UPDATE_BOOL_ATTRIBUTES(post_8bit_header);
1996 }
1997 } else {
1998 if (tinrc.mail_mime_encoding == MIME_ENCODING_7BIT) {
1999 tinrc.mail_mime_encoding = MIME_ENCODING_QP;
2000 repaint_option(OPT_MAIL_MIME_ENCODING);
2001 UPDATE_INT_ATTRIBUTES(mail_mime_encoding);
2002 }
2003 if (tinrc.post_mime_encoding == MIME_ENCODING_7BIT) {
2004 tinrc.post_mime_encoding = MIME_ENCODING_8BIT;
2005 repaint_option(OPT_POST_MIME_ENCODING);
2006 UPDATE_INT_ATTRIBUTES(post_mime_encoding);
2007 }
2008 }
2009 }
2010 break;
2011 #endif /* CHARSET_CONVERSION */
2012
2013 case OPT_ATTRIB_AUTO_CC_BCC:
2014 if (prompt_option_list(option))
2015 SET_NUM_ATTRIBUTE(auto_cc_bcc);
2016 break;
2017
2018 case OPT_ATTRIB_MAIL_MIME_ENCODING:
2019 if (prompt_option_list(option))
2020 SET_NUM_ATTRIBUTE(mail_mime_encoding);
2021 break;
2022
2023 #ifdef CHARSET_CONVERSION
2024 case OPT_ATTRIB_MM_NETWORK_CHARSET:
2025 if (prompt_option_list(option))
2026 SET_NUM_ATTRIBUTE(mm_network_charset);
2027 break;
2028 #endif /* CHARSET_CONVERSION */
2029
2030 case OPT_ATTRIB_POST_MIME_ENCODING:
2031 if (prompt_option_list(option))
2032 SET_NUM_ATTRIBUTE(post_mime_encoding);
2033 break;
2034
2035 case OPT_ATTRIB_POST_PROCESS_TYPE:
2036 if (prompt_option_list(option))
2037 SET_NUM_ATTRIBUTE(post_process_type);
2038 break;
2039
2040 case OPT_ATTRIB_QUICK_KILL_HEADER:
2041 if (prompt_option_list(option))
2042 SET_NUM_ATTRIBUTE(quick_kill_header);
2043 break;
2044
2045 case OPT_ATTRIB_QUICK_SELECT_HEADER:
2046 if (prompt_option_list(option))
2047 SET_NUM_ATTRIBUTE(quick_select_header);
2048 break;
2049
2050 case OPT_ATTRIB_SHOW_AUTHOR:
2051 if (prompt_option_list(option)) {
2052 SET_NUM_ATTRIBUTE(show_author);
2053 changed |= SHOW_AUTHOR;
2054 }
2055 break;
2056
2057 case OPT_ATTRIB_SORT_ARTICLE_TYPE:
2058 if (prompt_option_list(option)) {
2059 SET_NUM_ATTRIBUTE(sort_article_type);
2060 changed |= SORT_OPTS;
2061 }
2062 break;
2063
2064 case OPT_ATTRIB_SORT_THREADS_TYPE:
2065 if (prompt_option_list(option)) {
2066 SET_NUM_ATTRIBUTE(sort_threads_type);
2067 changed |= SORT_OPTS;
2068 }
2069 break;
2070
2071 case OPT_ATTRIB_THREAD_ARTICLES:
2072 if (prompt_option_list(option)) {
2073 SET_NUM_ATTRIBUTE(thread_articles);
2074 changed |= THREAD_ARTS;
2075 }
2076 break;
2077
2078 case OPT_ATTRIB_TRIM_ARTICLE_BODY:
2079 if (prompt_option_list(option))
2080 SET_NUM_ATTRIBUTE(trim_article_body);
2081 break;
2082
2083 default:
2084 break;
2085 } /* switch (option) */
2086 break;
2087
2088 case OPT_STRING:
2089 switch (option) {
2090 case OPT_INEWS_PROG:
2091 case OPT_MAILDIR:
2092 case OPT_MAILER_FORMAT:
2093 case OPT_MAIL_ADDRESS:
2094 case OPT_MAIL_QUOTE_FORMAT:
2095 case OPT_METAMAIL_PROG:
2096 case OPT_NEWS_QUOTE_FORMAT:
2097 case OPT_SAVEDIR:
2098 case OPT_SIGFILE:
2099 #ifndef DISABLE_PRINTING
2100 case OPT_PRINTER:
2101 #endif /* !DISABLE_PRINTING */
2102 case OPT_QUOTE_CHARS:
2103 case OPT_SPAMTRAP_WARNING_ADDRESSES:
2104 case OPT_URL_HANDLER:
2105 case OPT_XPOST_QUOTE_FORMAT:
2106 if (prompt_option_string(option))
2107 changed |= MISC_OPTS;
2108 break;
2109
2110 case OPT_EDITOR_FORMAT:
2111 if (prompt_option_string(option)) {
2112 if (!strlen(tinrc.editor_format))
2113 STRCPY(tinrc.editor_format, TIN_EDITOR_FMT);
2114 changed |= MISC_OPTS;
2115 }
2116 break;
2117
2118 case OPT_GROUP_FORMAT:
2119 if (prompt_option_string(option)) {
2120 if (!strlen(tinrc.group_format))
2121 STRCPY(tinrc.group_format, DEFAULT_GROUP_FORMAT);
2122 changed |= MISC_OPTS;
2123 }
2124 break;
2125
2126 case OPT_ATTRIB_GROUP_FORMAT:
2127 if (prompt_option_string(option))
2128 SET_STRING_ATTRIBUTE(group_format);
2129 break;
2130
2131 #ifndef CHARSET_CONVERSION
2132 case OPT_MM_CHARSET:
2133 if (prompt_option_string(option)) {
2134 /*
2135 * No charset conversion available, assume local charset
2136 * to be network charset.
2137 */
2138 STRCPY(tinrc.mm_local_charset, tinrc.mm_charset);
2139 changed |= MISC_OPTS;
2140 }
2141 break;
2142 #else
2143 # ifdef NO_LOCALE
2144 case OPT_MM_LOCAL_CHARSET:
2145 if (prompt_option_string(option))
2146 /* no locales -> can't guess local charset */
2147 changed |= MISC_OPTS;
2148 break;
2149
2150 # endif /* NO_LOCALE */
2151 #endif /* !CHARSET_CONVERSION */
2152
2153 case OPT_NEWS_HEADERS_TO_DISPLAY:
2154 if (prompt_option_string(option)) {
2155 build_news_headers_array(scopes[0].attribute, TRUE);
2156 changed |= MISC_OPTS;
2157 }
2158 break;
2159
2160 case OPT_NEWS_HEADERS_TO_NOT_DISPLAY:
2161 if (prompt_option_string(option)) {
2162 build_news_headers_array(scopes[0].attribute, FALSE);
2163 changed |= MISC_OPTS;
2164 }
2165 break;
2166
2167 case OPT_POSTED_ARTICLES_FILE:
2168 if (prompt_option_string(option)) /* no expansion here, will be done in post_loop() */
2169 changed |= MISC_OPTS;
2170 break;
2171
2172 #ifdef HAVE_COLOR
2173 case OPT_QUOTE_REGEX:
2174 if (prompt_option_string(option)) {
2175 FreeIfNeeded(quote_regex.re);
2176 FreeIfNeeded(quote_regex.extra);
2177 if (!strlen(tinrc.quote_regex))
2178 STRCPY(tinrc.quote_regex, DEFAULT_QUOTE_REGEX);
2179 compile_regex(tinrc.quote_regex, "e_regex, PCRE_CASELESS);
2180 changed |= DISPLAY_OPTS;
2181 }
2182 break;
2183
2184 case OPT_QUOTE_REGEX2:
2185 if (prompt_option_string(option)) {
2186 FreeIfNeeded(quote_regex2.re);
2187 FreeIfNeeded(quote_regex2.extra);
2188 if (!strlen(tinrc.quote_regex2))
2189 STRCPY(tinrc.quote_regex2, DEFAULT_QUOTE_REGEX2);
2190 compile_regex(tinrc.quote_regex2, "e_regex2, PCRE_CASELESS);
2191 changed |= DISPLAY_OPTS;
2192 }
2193 break;
2194
2195 case OPT_QUOTE_REGEX3:
2196 if (prompt_option_string(option)) {
2197 FreeIfNeeded(quote_regex3.re);
2198 FreeIfNeeded(quote_regex3.extra);
2199 if (!strlen(tinrc.quote_regex3))
2200 STRCPY(tinrc.quote_regex3, DEFAULT_QUOTE_REGEX3);
2201 compile_regex(tinrc.quote_regex3, "e_regex3, PCRE_CASELESS);
2202 changed |= DISPLAY_OPTS;
2203 }
2204 break;
2205
2206 case OPT_EXTQUOTE_REGEX:
2207 if (prompt_option_string(option)) {
2208 FreeIfNeeded(extquote_regex.re);
2209 FreeIfNeeded(extquote_regex.extra);
2210 if (!strlen(tinrc.extquote_regex))
2211 STRCPY(tinrc.extquote_regex, DEFAULT_EXTQUOTE_REGEX);
2212 compile_regex(tinrc.extquote_regex, &extquote_regex, PCRE_CASELESS);
2213 changed |= DISPLAY_OPTS;
2214 }
2215 break;
2216 #endif /* HAVE_COLOR */
2217
2218 case OPT_SELECT_FORMAT:
2219 if (prompt_option_string(option)) {
2220 if (!strlen(tinrc.select_format))
2221 STRCPY(tinrc.select_format, DEFAULT_SELECT_FORMAT);
2222 changed |= MISC_OPTS;
2223 }
2224 break;
2225
2226 case OPT_SLASHES_REGEX:
2227 if (prompt_option_string(option)) {
2228 FreeIfNeeded(slashes_regex.re);
2229 FreeIfNeeded(slashes_regex.extra);
2230 if (!strlen(tinrc.slashes_regex))
2231 STRCPY(tinrc.slashes_regex, DEFAULT_SLASHES_REGEX);
2232 compile_regex(tinrc.slashes_regex, &slashes_regex, PCRE_CASELESS);
2233 changed |= DISPLAY_OPTS;
2234 }
2235 break;
2236
2237 case OPT_STARS_REGEX:
2238 if (prompt_option_string(option)) {
2239 FreeIfNeeded(stars_regex.re);
2240 FreeIfNeeded(stars_regex.extra);
2241 if (!strlen(tinrc.stars_regex))
2242 STRCPY(tinrc.stars_regex, DEFAULT_STARS_REGEX);
2243 compile_regex(tinrc.stars_regex, &stars_regex, PCRE_CASELESS);
2244 changed |= DISPLAY_OPTS;
2245 }
2246 break;
2247
2248 case OPT_STROKES_REGEX:
2249 if (prompt_option_string(option)) {
2250 FreeIfNeeded(strokes_regex.re);
2251 FreeIfNeeded(strokes_regex.extra);
2252 if (!strlen(tinrc.strokes_regex))
2253 STRCPY(tinrc.strokes_regex, DEFAULT_STROKES_REGEX);
2254 compile_regex(tinrc.strokes_regex, &strokes_regex, PCRE_CASELESS);
2255 changed |= DISPLAY_OPTS;
2256 }
2257 break;
2258
2259 case OPT_UNDERSCORES_REGEX:
2260 if (prompt_option_string(option)) {
2261 FreeIfNeeded(underscores_regex.re);
2262 FreeIfNeeded(underscores_regex.extra);
2263 if (!strlen(tinrc.underscores_regex))
2264 STRCPY(tinrc.underscores_regex, DEFAULT_UNDERSCORES_REGEX);
2265 compile_regex(tinrc.underscores_regex, &underscores_regex, PCRE_CASELESS);
2266 changed |= DISPLAY_OPTS;
2267 }
2268 break;
2269
2270 case OPT_STRIP_RE_REGEX:
2271 if (prompt_option_string(option)) {
2272 FreeIfNeeded(strip_re_regex.re);
2273 FreeIfNeeded(strip_re_regex.extra);
2274 if (!strlen(tinrc.strip_re_regex))
2275 STRCPY(tinrc.strip_re_regex, DEFAULT_STRIP_RE_REGEX);
2276 compile_regex(tinrc.strip_re_regex, &strip_re_regex, PCRE_ANCHORED);
2277 changed |= MISC_OPTS;
2278 }
2279 break;
2280
2281 case OPT_STRIP_WAS_REGEX:
2282 if (prompt_option_string(option)) {
2283 FreeIfNeeded(strip_was_regex.re);
2284 FreeIfNeeded(strip_was_regex.extra);
2285 if (!strlen(tinrc.strip_was_regex)) {
2286 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
2287 if (IS_LOCAL_CHARSET("UTF-8") && utf8_pcre())
2288 STRCPY(tinrc.strip_was_regex, DEFAULT_U8_STRIP_WAS_REGEX);
2289 else
2290 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
2291 STRCPY(tinrc.strip_was_regex, DEFAULT_STRIP_WAS_REGEX);
2292 }
2293 compile_regex(tinrc.strip_was_regex, &strip_was_regex, 0);
2294 changed |= MISC_OPTS;
2295 }
2296 break;
2297
2298 case OPT_THREAD_FORMAT:
2299 if (prompt_option_string(option)) {
2300 if (!strlen(tinrc.thread_format))
2301 STRCPY(tinrc.thread_format, DEFAULT_THREAD_FORMAT);
2302 changed |= MISC_OPTS;
2303 }
2304 break;
2305
2306 case OPT_ATTRIB_THREAD_FORMAT:
2307 if (prompt_option_string(option))
2308 SET_STRING_ATTRIBUTE(thread_format);
2309 break;
2310
2311 case OPT_VERBATIM_BEGIN_REGEX:
2312 if (prompt_option_string(option)) {
2313 FreeIfNeeded(verbatim_begin_regex.re);
2314 FreeIfNeeded(verbatim_begin_regex.extra);
2315 if (!strlen(tinrc.verbatim_begin_regex))
2316 STRCPY(tinrc.verbatim_begin_regex, DEFAULT_VERBATIM_BEGIN_REGEX);
2317 compile_regex(tinrc.verbatim_begin_regex, &verbatim_begin_regex, PCRE_ANCHORED);
2318 changed |= DISPLAY_OPTS;
2319 }
2320 break;
2321
2322 case OPT_VERBATIM_END_REGEX:
2323 if (prompt_option_string(option)) {
2324 FreeIfNeeded(verbatim_end_regex.re);
2325 FreeIfNeeded(verbatim_end_regex.extra);
2326 if (!strlen(tinrc.verbatim_end_regex))
2327 STRCPY(tinrc.verbatim_end_regex, DEFAULT_VERBATIM_END_REGEX);
2328 compile_regex(tinrc.verbatim_end_regex, &verbatim_end_regex, PCRE_ANCHORED);
2329 changed |= DISPLAY_OPTS;
2330 }
2331 break;
2332
2333 case OPT_DATE_FORMAT:
2334 if (prompt_option_string(option)) {
2335 if (!strlen(tinrc.date_format))
2336 STRCPY(tinrc.date_format, DEFAULT_DATE_FORMAT);
2337 changed |= MISC_OPTS;
2338 }
2339 break;
2340
2341 case OPT_ATTRIB_DATE_FORMAT:
2342 if (prompt_option_string(option))
2343 SET_STRING_ATTRIBUTE(date_format);
2344 break;
2345
2346 case OPT_ATTRIB_EDITOR_FORMAT:
2347 if (prompt_option_string(option))
2348 SET_STRING_ATTRIBUTE(editor_format);
2349 break;
2350
2351 case OPT_ATTRIB_FCC:
2352 if (prompt_option_string(option))
2353 SET_STRING_ATTRIBUTE(fcc);
2354 break;
2355
2356 case OPT_ATTRIB_FOLLOWUP_TO:
2357 if (prompt_option_string(option))
2358 SET_STRING_ATTRIBUTE(followup_to);
2359 break;
2360
2361 case OPT_ATTRIB_FROM:
2362 if (prompt_option_string(option))
2363 SET_STRING_ATTRIBUTE(from);
2364 break;
2365
2366 #ifdef HAVE_ISPELL
2367 case OPT_ATTRIB_ISPELL:
2368 if (prompt_option_string(option))
2369 SET_STRING_ATTRIBUTE(ispell);
2370 break;
2371 #endif /* HAVE_ISPELL */
2372
2373 case OPT_ATTRIB_MAILDIR:
2374 if (prompt_option_string(option))
2375 SET_STRING_ATTRIBUTE(maildir);
2376 break;
2377
2378 case OPT_ATTRIB_MAILING_LIST:
2379 if (prompt_option_string(option))
2380 SET_STRING_ATTRIBUTE(mailing_list);
2381 break;
2382
2383 case OPT_ATTRIB_MIME_TYPES_TO_SAVE:
2384 if (prompt_option_string(option))
2385 SET_STRING_ATTRIBUTE(mime_types_to_save);
2386 break;
2387
2388 case OPT_ATTRIB_NEWS_HEADERS_TO_DISPLAY:
2389 if (prompt_option_string(option)) {
2390 SET_STRING_ATTRIBUTE(news_headers_to_display);
2391 build_news_headers_array(curr_scope->attribute, TRUE);
2392 changed |= DISPLAY_OPTS;
2393 }
2394 break;
2395
2396 case OPT_ATTRIB_NEWS_HEADERS_TO_NOT_DISPLAY:
2397 if (prompt_option_string(option)) {
2398 SET_STRING_ATTRIBUTE(news_headers_to_not_display);
2399 build_news_headers_array(curr_scope->attribute, FALSE);
2400 changed |= DISPLAY_OPTS;
2401 }
2402 break;
2403
2404 case OPT_ATTRIB_NEWS_QUOTE_FORMAT:
2405 if (prompt_option_string(option))
2406 SET_STRING_ATTRIBUTE(news_quote_format);
2407 break;
2408
2409 case OPT_ATTRIB_ORGANIZATION:
2410 if (prompt_option_string(option))
2411 SET_STRING_ATTRIBUTE(organization);
2412 break;
2413
2414 case OPT_ATTRIB_QUICK_KILL_SCOPE:
2415 if (prompt_option_string(option))
2416 SET_STRING_ATTRIBUTE(quick_kill_scope);
2417 break;
2418
2419 case OPT_ATTRIB_QUICK_SELECT_SCOPE:
2420 if (prompt_option_string(option))
2421 SET_STRING_ATTRIBUTE(quick_select_scope);
2422 break;
2423
2424 case OPT_ATTRIB_QUOTE_CHARS:
2425 if (prompt_option_string(option))
2426 SET_STRING_ATTRIBUTE(quote_chars);
2427 break;
2428
2429 case OPT_ATTRIB_SAVEDIR:
2430 if (prompt_option_string(option))
2431 SET_STRING_ATTRIBUTE(savedir);
2432 break;
2433
2434 case OPT_ATTRIB_SAVEFILE:
2435 if (prompt_option_string(option))
2436 SET_STRING_ATTRIBUTE(savefile);
2437 break;
2438
2439 case OPT_ATTRIB_SIGFILE:
2440 if (prompt_option_string(option))
2441 SET_STRING_ATTRIBUTE(sigfile);
2442 break;
2443
2444 #ifdef CHARSET_CONVERSION
2445 case OPT_ATTRIB_UNDECLARED_CHARSET:
2446 if (prompt_option_string(option))
2447 SET_STRING_ATTRIBUTE(undeclared_charset);
2448 break;
2449
2450 #endif /* CHARSET_CONVERSION */
2451 case OPT_ATTRIB_X_BODY:
2452 if (prompt_option_string(option))
2453 SET_STRING_ATTRIBUTE(x_body);
2454 break;
2455
2456 case OPT_ATTRIB_X_HEADERS:
2457 if (prompt_option_string(option))
2458 SET_STRING_ATTRIBUTE(x_headers);
2459 break;
2460
2461 default:
2462 break;
2463 } /* switch (option) */
2464
2465 break;
2466
2467 case OPT_NUM:
2468 switch (option) {
2469 case OPT_GETART_LIMIT:
2470 case OPT_SCROLL_LINES:
2471 if (prompt_option_num(option))
2472 changed |= MISC_OPTS;
2473 break;
2474
2475 #if defined(HAVE_ALARM) && defined(SIGALRM)
2476 case OPT_NNTP_READ_TIMEOUT_SECS:
2477 if (prompt_option_num(option)) {
2478 if (tinrc.nntp_read_timeout_secs < 0)
2479 tinrc.nntp_read_timeout_secs = 0;
2480 changed |= MISC_OPTS;
2481 }
2482 break;
2483 #endif /* HAVE_ALARM && SIGALRM */
2484
2485 case OPT_REREAD_ACTIVE_FILE_SECS:
2486 if (prompt_option_num(option)) {
2487 if (tinrc.reread_active_file_secs < 0)
2488 tinrc.reread_active_file_secs = 0;
2489 changed |= MISC_OPTS;
2490 }
2491 break;
2492
2493 case OPT_RECENT_TIME:
2494 if (prompt_option_num(option)) {
2495 if (tinrc.recent_time < 0)
2496 tinrc.recent_time = 0;
2497 changed |= MISC_OPTS;
2498 }
2499 break;
2500
2501 case OPT_FILTER_DAYS:
2502 if (prompt_option_num(option)) {
2503 if (tinrc.filter_days <= 0)
2504 tinrc.filter_days = 1;
2505 changed |= MISC_OPTS;
2506 }
2507 break;
2508
2509 case OPT_SCORE_LIMIT_KILL:
2510 case OPT_SCORE_KILL:
2511 case OPT_SCORE_LIMIT_SELECT:
2512 case OPT_SCORE_SELECT:
2513 if (prompt_option_num(option)) {
2514 check_score_defaults();
2515 redraw_screen(option);
2516 changed |= SCORE_OPTS;
2517 }
2518 break;
2519
2520 case OPT_THREAD_PERC:
2521 if (prompt_option_num(option)) {
2522 if (tinrc.thread_perc < 0 || tinrc.thread_perc > 100)
2523 tinrc.thread_perc = THREAD_PERC_DEFAULT;
2524 UPDATE_INT_ATTRIBUTES(thread_perc);
2525 }
2526 break;
2527
2528 case OPT_WRAP_COLUMN:
2529 if (prompt_option_num(option))
2530 changed |= DISPLAY_OPTS;
2531 break;
2532
2533 case OPT_ATTRIB_THREAD_PERC:
2534 if (prompt_option_num(option))
2535 SET_NUM_ATTRIBUTE(thread_perc);
2536 break;
2537
2538 default:
2539 break;
2540 } /* switch (option) */
2541 break;
2542
2543 case OPT_CHAR:
2544 switch (option) {
2545 /*
2546 * TODO: do DASH_TO_SPACE/SPACE_TO_DASH conversion here?
2547 */
2548 case OPT_ART_MARKED_DELETED:
2549 case OPT_ART_MARKED_INRANGE:
2550 case OPT_ART_MARKED_RETURN:
2551 case OPT_ART_MARKED_SELECTED:
2552 case OPT_ART_MARKED_RECENT:
2553 case OPT_ART_MARKED_UNREAD:
2554 case OPT_ART_MARKED_READ:
2555 case OPT_ART_MARKED_KILLED:
2556 case OPT_ART_MARKED_READ_SELECTED:
2557 if (prompt_option_char(option)) {
2558 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
2559 set_art_mark_width();
2560 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
2561 changed |= MISC_OPTS;
2562 }
2563 break;
2564
2565 default:
2566 break;
2567 } /* switch (option) */
2568 break;
2569
2570 default:
2571 break;
2572 } /* switch (option_table[option].var_type) */
2573 change_option = FALSE;
2574 show_menu_help(txt_select_config_file_option);
2575 repaint_option(option);
2576 highlight_option(option);
2577 } /* if (change_option) */
2578 } /* forever */
2579 /* NOTREACHED */
2580 return;
2581 }
2582
2583
2584 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
2585 static void
2586 set_art_mark_width(
2587 void)
2588 {
2589 art_mark_width = 1;
2590
2591 if (wcwidth(tinrc.art_marked_deleted) > art_mark_width)
2592 art_mark_width = wcwidth(tinrc.art_marked_deleted);
2593 if (wcwidth(tinrc.art_marked_inrange) > art_mark_width)
2594 art_mark_width = wcwidth(tinrc.art_marked_inrange);
2595 if (wcwidth(tinrc.art_marked_return) > art_mark_width)
2596 art_mark_width = wcwidth(tinrc.art_marked_return);
2597 if (wcwidth(tinrc.art_marked_selected) > art_mark_width)
2598 art_mark_width = wcwidth(tinrc.art_marked_selected);
2599 if (wcwidth(tinrc.art_marked_recent) > art_mark_width)
2600 art_mark_width = wcwidth(tinrc.art_marked_recent);
2601 if (wcwidth(tinrc.art_marked_unread) > art_mark_width)
2602 art_mark_width = wcwidth(tinrc.art_marked_unread);
2603 if (wcwidth(tinrc.art_marked_read) > art_mark_width)
2604 art_mark_width = wcwidth(tinrc.art_marked_read);
2605 if (wcwidth(tinrc.art_marked_killed) > art_mark_width)
2606 art_mark_width = wcwidth(tinrc.art_marked_killed);
2607 if (wcwidth(tinrc.art_marked_read_selected) > art_mark_width)
2608 art_mark_width = wcwidth(tinrc.art_marked_read_selected);
2609 }
2610 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
2611
2612
2613 /*
2614 * scopes and attributes menu
2615 */
2616
2617 static t_function
2618 scope_left(
2619 void)
2620 {
2621 return GLOBAL_QUIT;
2622 }
2623
2624
2625 static t_function
2626 scope_right(
2627 void)
2628 {
2629 return SCOPE_SELECT;
2630 }
2631
2632
2633 static void
2634 show_scope_page(
2635 void)
2636 {
2637 int i;
2638
2639 signal_context = cScope;
2640 currmenu = &scopemenu;
2641 mark_offset = 0;
2642
2643 if (scopemenu.curr < 0)
2644 scopemenu.curr = 0;
2645
2646 scopemenu.max = num_scope - 1;
2647
2648 ClearScreen();
2649 set_first_screen_item();
2650 center_line(0, TRUE, _(txt_scopes_menu));
2651
2652 for (i = scopemenu.first; i < scopemenu.first + NOTESLINES && i < scopemenu.max; ++i)
2653 build_scope_line(i);
2654
2655 show_mini_help(SCOPE_LEVEL);
2656
2657 if (scopemenu.max <= 0) {
2658 info_message(_(txt_no_scopes));
2659 return;
2660 }
2661
2662 draw_scope_arrow();
2663 }
2664
2665
2666 static void
2667 scope_page(
2668 enum context level)
2669 {
2670 char key[MAXKEYLEN];
2671 int i;
2672 t_bool changed = FALSE;
2673 t_function func;
2674 t_menu *oldmenu = NULL;
2675
2676 if (currmenu)
2677 oldmenu = currmenu;
2678 scopemenu.curr = 0;
2679 clear_note_area();
2680 show_scope_page();
2681 set_xclick_off();
2682
2683 forever {
2684 switch ((func = handle_keypad(scope_left, scope_right, NULL, scope_keys))) {
2685 case GLOBAL_QUIT:
2686 if (changed)
2687 write_attributes_file(local_attributes_file);
2688 clear_note_area();
2689 if (oldmenu)
2690 currmenu = oldmenu;
2691 return;
2692
2693 case DIGIT_1:
2694 case DIGIT_2:
2695 case DIGIT_3:
2696 case DIGIT_4:
2697 case DIGIT_5:
2698 case DIGIT_6:
2699 case DIGIT_7:
2700 case DIGIT_8:
2701 case DIGIT_9:
2702 if (scopemenu.max)
2703 prompt_item_num(func_to_key(func, scope_keys), _(txt_scope_select));
2704 break;
2705
2706 #ifndef NO_SHELL_ESCAPE
2707 case GLOBAL_SHELL_ESCAPE:
2708 do_shell_escape();
2709 break;
2710 #endif /* !NO_SHELL_ESCAPE */
2711
2712 case GLOBAL_HELP:
2713 show_help_page(SCOPE_LEVEL, _(txt_scopes_menu_com));
2714 show_scope_page();
2715 break;
2716
2717 case GLOBAL_FIRST_PAGE:
2718 top_of_list();
2719 break;
2720
2721 case GLOBAL_LAST_PAGE:
2722 end_of_list();
2723 break;
2724
2725 case GLOBAL_REDRAW_SCREEN:
2726 my_retouch();
2727 set_xclick_off();
2728 show_scope_page();
2729 break;
2730
2731 case GLOBAL_LINE_DOWN:
2732 move_down();
2733 break;
2734
2735 case GLOBAL_LINE_UP:
2736 move_up();
2737 break;
2738
2739 case GLOBAL_PAGE_DOWN:
2740 page_down();
2741 break;
2742
2743 case GLOBAL_PAGE_UP:
2744 page_up();
2745 break;
2746
2747 case GLOBAL_SCROLL_DOWN:
2748 scroll_down();
2749 break;
2750
2751 case GLOBAL_SCROLL_UP:
2752 scroll_up();
2753 break;
2754
2755 case GLOBAL_TOGGLE_HELP_DISPLAY:
2756 toggle_mini_help(SCOPE_LEVEL);
2757 show_scope_page();
2758 break;
2759
2760 case SCOPE_ADD:
2761 if ((i = add_new_scope())) {
2762 changed = TRUE;
2763 scopemenu.curr = i;
2764 show_scope_page();
2765 }
2766 break;
2767
2768 case SCOPE_DELETE:
2769 if (scopemenu.max) {
2770 if (scopes[scopemenu.curr + 1].global)
2771 info_message(_(txt_scope_operation_not_allowed));
2772 else if (delete_scope(scopemenu.curr + 1)) {
2773 changed = TRUE;
2774 show_scope_page();
2775 }
2776 }
2777 break;
2778
2779 case SCOPE_EDIT_ATTRIBUTES_FILE:
2780 if (changed)
2781 write_attributes_file(local_attributes_file);
2782 if (!invoke_editor(local_attributes_file, attrib_file_offset, NULL))
2783 break;
2784 free_scopes_and_attributes();
2785 read_attributes_file(FALSE);
2786 assign_attributes_to_groups();
2787 changed = FALSE;
2788 scopemenu.curr = 0;
2789 show_scope_page();
2790 break;
2791
2792 case SCOPE_MOVE:
2793 if (scopemenu.max > 1) {
2794 if (scopes[scopemenu.curr + 1].global)
2795 info_message(_(txt_scope_operation_not_allowed));
2796 else if ((i = move_scope(scopemenu.curr + 1))) {
2797 changed = TRUE;
2798 scopemenu.curr = i - 1;
2799 show_scope_page();
2800 }
2801 }
2802 break;
2803
2804 case SCOPE_RENAME:
2805 if (scopemenu.max) {
2806 if (scopes[scopemenu.curr + 1].global)
2807 info_message(_(txt_scope_operation_not_allowed));
2808 else if (rename_scope(&scopes[scopemenu.curr + 1])) {
2809 changed = TRUE;
2810 show_scope_page();
2811 }
2812 }
2813 break;
2814
2815 case SCOPE_SELECT:
2816 if (scopemenu.max) {
2817 curr_scope = &scopes[scopemenu.curr + 1];
2818 config_page(NULL, level);
2819 if (!curr_scope->global && scope_is_empty())
2820 do_delete_scope(scopemenu.curr + 1);
2821 curr_scope = NULL;
2822 changed = TRUE;
2823 show_scope_page();
2824 }
2825 break;
2826
2827 default:
2828 info_message(_(txt_bad_command), PrintFuncKey(key, GLOBAL_HELP, scope_keys));
2829 break;
2830 }
2831 }
2832 }
2833
2834
2835 static void
2836 draw_scope_arrow(
2837 void)
2838 {
2839 draw_arrow_mark(INDEX_TOP + scopemenu.curr - scopemenu.first);
2840 if (scopemenu.curr == scopemenu.max - 1)
2841 info_message(_(txt_end_of_scopes));
2842 }
2843
2844
2845 static void
2846 build_scope_line(
2847 int i)
2848 {
2849 char *sptr;
2850 int len = cCOLS - 11;
2851
2852 #ifdef USE_CURSES
2853 /*
2854 * Allocate line buffer
2855 * make it the same size like in !USE_CURSES case to simplify some code
2856 */
2857 sptr = my_malloc(cCOLS + 2);
2858 #else
2859 sptr = screen[INDEX2SNUM(i)].col;
2860 #endif /* USE_CURSES */
2861
2862 snprintf(sptr, (size_t) cCOLS, " %c %s %-*.*s%s", (scopes[i + 1].global ? '!' : ' '), tin_ltoa(i + 1, 4), len, len, scopes[i + 1].scope, cCRLF);
2863
2864 #ifndef USE_CURSES
2865 if (tinrc.strip_blanks)
2866 strcat(strip_line(sptr), cCRLF);
2867 #endif /* !USE_CURSES */
2868
2869 WriteLine(INDEX2LNUM(i), sptr);
2870
2871 #ifdef USE_CURSES
2872 free(sptr);
2873 #endif /* USE_CURSES */
2874 }
2875
2876
2877 /*
2878 * add a new scope and return the index
2879 */
2880 static int
2881 add_new_scope(
2882 void)
2883 {
2884 char buf[LEN];
2885 int new_pos = 0;
2886
2887 if (prompt_default_string(_(txt_scope_enter), buf, sizeof(buf), (char *) NULL, HIST_OTHER))
2888 new_pos = add_scope(buf);
2889
2890 return new_pos;
2891 }
2892
2893
2894 /*
2895 * returns TRUE if the given scope was deleted
2896 */
2897 static t_bool
2898 delete_scope(
2899 int curr_pos)
2900 {
2901 if (prompt_yn(_(txt_scope_delete), FALSE) == 1) {
2902 do_delete_scope(curr_pos);
2903 return TRUE;
2904 }
2905
2906 return FALSE;
2907 }
2908
2909
2910 static void
2911 do_delete_scope(
2912 int curr_pos)
2913 {
2914 do_move_scope(curr_pos, num_scope - 1);
2915 free_scope(--num_scope);
2916 }
2917
2918
2919 /*
2920 * returns TRUE if scope was renamed
2921 */
2922 static t_bool
2923 rename_scope(
2924 struct t_scope *scope)
2925 {
2926 char buf[LEN];
2927
2928 if (prompt_default_string(_(txt_scope_rename), buf, sizeof(buf), scope->scope, HIST_OTHER)) {
2929 if (buf[0] == '\0')
2930 return FALSE;
2931 FreeIfNeeded(scope->scope);
2932 scope->scope = my_strdup(buf);
2933 return TRUE;
2934 }
2935
2936 return FALSE;
2937 }
2938
2939
2940 /*
2941 * look if an entry with the given scope exists and return the index
2942 */
2943 static int
2944 find_scope(
2945 const char *scope)
2946 {
2947 int i;
2948
2949 if (!scope || !*scope)
2950 return 0;
2951
2952 for (i = 1; i < num_scope; i++) {
2953 if (!scopes[i].global && strcasecmp(scope, scopes[i].scope) == 0)
2954 return i;
2955 }
2956
2957 return 0;
2958 }
2959
2960
2961 /*
2962 * returns the new position of the moved scope or 0 if repositioning
2963 * is not possible
2964 */
2965 static int
2966 move_scope(
2967 int curr_pos)
2968 {
2969 char *p;
2970 int new_pos;
2971
2972 clear_message();
2973 if ((p = tin_getline(_(txt_scope_new_position), 1, NULL, 0, FALSE, HIST_OTHER)) != NULL)
2974 new_pos = atoi(p);
2975 else
2976 new_pos = curr_pos;
2977 clear_message();
2978
2979 if (new_pos == curr_pos || new_pos == 0)
2980 return 0;
2981
2982 if (new_pos >= num_scope)
2983 new_pos = num_scope - 1;
2984
2985 if (scopes[new_pos].global) {
2986 info_message(_(txt_scope_new_position_is_global));
2987 return 0;
2988 }
2989
2990 do_move_scope(curr_pos, new_pos);
2991
2992 return new_pos;
2993 }
2994
2995
2996 /*
2997 * repositions a scope into scopes[]
2998 */
2999 static void
3000 do_move_scope(
3001 int from,
3002 int to)
3003 {
3004 struct t_scope tmp;
3005
3006 if (from == to)
3007 return;
3008
3009 tmp = scopes[from];
3010
3011 if (from > to) {
3012 while (from-- > to)
3013 scopes[from + 1] = scopes[from];
3014 } else {
3015 while (from++ < to)
3016 scopes[from - 1] = scopes[from];
3017 }
3018 scopes[to] = tmp;
3019 }
3020
3021
3022 /*
3023 * free all group->attribute arrays and all scopes which are
3024 * not marked as global
3025 */
3026 static void
3027 free_scopes_and_attributes(
3028 void)
3029 {
3030 int i;
3031
3032 for_each_group(i) {
3033 if (active[i].attribute && !active[i].attribute->global) {
3034 free(active[i].attribute);
3035 active[i].attribute = (struct t_attribute *) 0;
3036 }
3037 }
3038
3039 while (num_scope > 1 && !scopes[num_scope - 1].global)
3040 free_scope(--num_scope);
3041 }
3042
3043
3044 /*
3045 * returns TRUE if no attribute in curr_scope has state == TRUE
3046 */
3047 static t_bool
3048 scope_is_empty(
3049 void)
3050 {
3051 enum option_enum i;
3052
3053 for (i = 0; i <= last_opt; i++) {
3054 if (option_is_visible(i) && !option_is_title(i) && check_state(i))
3055 return FALSE;
3056 }
3057
3058 return TRUE;
3059 }
3060
3061
3062 /*
3063 * returns the state of the given attribute
3064 */
3065 static t_bool
3066 check_state(
3067 enum option_enum option)
3068 {
3069 switch (option) {
3070 case OPT_ATTRIB_ADD_POSTED_TO_FILTER:
3071 return curr_scope->state->add_posted_to_filter;
3072 case OPT_ATTRIB_ADVERTISING:
3073 return curr_scope->state->advertising;
3074 case OPT_ATTRIB_ALTERNATIVE_HANDLING:
3075 return curr_scope->state->alternative_handling;
3076 case OPT_ATTRIB_ASK_FOR_METAMAIL:
3077 return curr_scope->state->ask_for_metamail;
3078 case OPT_ATTRIB_AUTO_CC_BCC:
3079 return curr_scope->state->auto_cc_bcc;
3080 case OPT_ATTRIB_AUTO_LIST_THREAD:
3081 return curr_scope->state->auto_list_thread;
3082 case OPT_ATTRIB_AUTO_SELECT:
3083 return curr_scope->state->auto_select;
3084 case OPT_ATTRIB_BATCH_SAVE:
3085 return curr_scope->state->batch_save;
3086 case OPT_ATTRIB_DATE_FORMAT:
3087 return curr_scope->state->date_format;
3088 case OPT_ATTRIB_DELETE_TMP_FILES:
3089 return curr_scope->state->delete_tmp_files;
3090 case OPT_ATTRIB_EDITOR_FORMAT:
3091 return curr_scope->state->editor_format;
3092 #ifdef HAVE_COLOR
3093 case OPT_ATTRIB_EXTQUOTE_HANDLING:
3094 return curr_scope->state->extquote_handling;
3095 #endif /* HAVE_COLOR */
3096 case OPT_ATTRIB_FCC:
3097 return curr_scope->state->fcc;
3098 case OPT_ATTRIB_FOLLOWUP_TO:
3099 return curr_scope->state->followup_to;
3100 case OPT_ATTRIB_FROM:
3101 return curr_scope->state->from;
3102 case OPT_ATTRIB_GROUP_CATCHUP_ON_EXIT:
3103 return curr_scope->state->group_catchup_on_exit;
3104 case OPT_ATTRIB_GROUP_FORMAT:
3105 return curr_scope->state->group_format;
3106 #ifdef HAVE_ISPELL
3107 case OPT_ATTRIB_ISPELL:
3108 return curr_scope->state->ispell;
3109 #endif /* HAVE_ISPELL */
3110 case OPT_ATTRIB_MAILDIR:
3111 return curr_scope->state->maildir;
3112 case OPT_ATTRIB_MAIL_8BIT_HEADER:
3113 return curr_scope->state->mail_8bit_header;
3114 case OPT_ATTRIB_MAIL_MIME_ENCODING:
3115 return curr_scope->state->mail_mime_encoding;
3116 case OPT_ATTRIB_MAILING_LIST:
3117 return curr_scope->state->mailing_list;
3118 case OPT_ATTRIB_MARK_IGNORE_TAGS:
3119 return curr_scope->state->mark_ignore_tags;
3120 case OPT_ATTRIB_MARK_SAVED_READ:
3121 return curr_scope->state->mark_saved_read;
3122 case OPT_ATTRIB_MIME_FORWARD:
3123 return curr_scope->state->mime_forward;
3124 case OPT_ATTRIB_MIME_TYPES_TO_SAVE:
3125 return curr_scope->state->mime_types_to_save;
3126 case OPT_ATTRIB_NEWS_HEADERS_TO_DISPLAY:
3127 return curr_scope->state->news_headers_to_display;
3128 case OPT_ATTRIB_NEWS_HEADERS_TO_NOT_DISPLAY:
3129 return curr_scope->state->news_headers_to_not_display;
3130 case OPT_ATTRIB_NEWS_QUOTE_FORMAT:
3131 return curr_scope->state->news_quote_format;
3132 case OPT_ATTRIB_ORGANIZATION:
3133 return curr_scope->state->organization;
3134 case OPT_ATTRIB_POST_8BIT_HEADER:
3135 return curr_scope->state->post_8bit_header;
3136 case OPT_ATTRIB_POST_MIME_ENCODING:
3137 return curr_scope->state->post_mime_encoding;
3138 case OPT_ATTRIB_POST_PROCESS_VIEW:
3139 return curr_scope->state->post_process_view;
3140 case OPT_ATTRIB_POS_FIRST_UNREAD:
3141 return curr_scope->state->pos_first_unread;
3142 #ifndef DISABLE_PRINTING
3143 case OPT_ATTRIB_PRINT_HEADER:
3144 return curr_scope->state->print_header;
3145 #endif /* !DISABLE_PRINTING */
3146 case OPT_ATTRIB_PROCESS_ONLY_UNREAD:
3147 return curr_scope->state->process_only_unread;
3148 case OPT_ATTRIB_PROMPT_FOLLOWUPTO:
3149 return curr_scope->state->prompt_followupto;
3150 case OPT_ATTRIB_QUICK_KILL_SCOPE:
3151 return curr_scope->state->quick_kill_scope;
3152 case OPT_ATTRIB_QUICK_KILL_HEADER:
3153 return curr_scope->state->quick_kill_header;
3154 case OPT_ATTRIB_QUICK_KILL_CASE:
3155 return curr_scope->state->quick_kill_case;
3156 case OPT_ATTRIB_QUICK_KILL_EXPIRE:
3157 return curr_scope->state->quick_kill_expire;
3158 case OPT_ATTRIB_QUICK_SELECT_SCOPE:
3159 return curr_scope->state->quick_select_scope;
3160 case OPT_ATTRIB_QUICK_SELECT_HEADER:
3161 return curr_scope->state->quick_select_header;
3162 case OPT_ATTRIB_QUICK_SELECT_CASE:
3163 return curr_scope->state->quick_select_case;
3164 case OPT_ATTRIB_QUICK_SELECT_EXPIRE:
3165 return curr_scope->state->quick_select_expire;
3166 case OPT_ATTRIB_QUOTE_CHARS:
3167 return curr_scope->state->quote_chars;
3168 case OPT_ATTRIB_SAVEDIR:
3169 return curr_scope->state->savedir;
3170 case OPT_ATTRIB_SAVEFILE:
3171 return curr_scope->state->savefile;
3172 case OPT_ATTRIB_SHOW_AUTHOR:
3173 return curr_scope->state->show_author;
3174 case OPT_ATTRIB_SHOW_ONLY_UNREAD_ARTS:
3175 return curr_scope->state->show_only_unread_arts;
3176 case OPT_ATTRIB_SHOW_SIGNATURES:
3177 return curr_scope->state->show_signatures;
3178 case OPT_ATTRIB_SIGDASHES:
3179 return curr_scope->state->sigdashes;
3180 case OPT_ATTRIB_SIGFILE:
3181 return curr_scope->state->sigfile;
3182 case OPT_ATTRIB_SIGNATURE_REPOST:
3183 return curr_scope->state->signature_repost;
3184 case OPT_ATTRIB_THREAD_ARTICLES:
3185 return curr_scope->state->thread_articles;
3186 case OPT_ATTRIB_THREAD_CATCHUP_ON_EXIT:
3187 return curr_scope->state->thread_catchup_on_exit;
3188 case OPT_ATTRIB_THREAD_FORMAT:
3189 return curr_scope->state->thread_format;
3190 case OPT_ATTRIB_THREAD_PERC:
3191 return curr_scope->state->thread_perc;
3192 case OPT_ATTRIB_TRIM_ARTICLE_BODY:
3193 return curr_scope->state->trim_article_body;
3194 case OPT_ATTRIB_TEX2ISO_CONV:
3195 return curr_scope->state->tex2iso_conv;
3196 case OPT_ATTRIB_SORT_THREADS_TYPE:
3197 return curr_scope->state->sort_threads_type;
3198 #ifdef CHARSET_CONVERSION
3199 case OPT_ATTRIB_MM_NETWORK_CHARSET:
3200 return curr_scope->state->mm_network_charset;
3201 case OPT_ATTRIB_UNDECLARED_CHARSET:
3202 return curr_scope->state->undeclared_charset;
3203 #endif /* CHARSET_CONVERSION */
3204 case OPT_ATTRIB_VERBATIM_HANDLING:
3205 return curr_scope->state->verbatim_handling;
3206 case OPT_ATTRIB_WRAP_ON_NEXT_UNREAD:
3207 return curr_scope->state->wrap_on_next_unread;
3208 case OPT_ATTRIB_SORT_ARTICLE_TYPE:
3209 return curr_scope->state->sort_article_type;
3210 case OPT_ATTRIB_POST_PROCESS_TYPE:
3211 return curr_scope->state->post_process_type;
3212 case OPT_ATTRIB_X_BODY:
3213 return curr_scope->state->x_body;
3214 case OPT_ATTRIB_X_COMMENT_TO:
3215 return curr_scope->state->x_comment_to;
3216 case OPT_ATTRIB_X_HEADERS:
3217 return curr_scope->state->x_headers;
3218
3219 default:
3220 return FALSE;
3221 }
3222 }
3223
3224
3225 /*
3226 * set the state of the given attribute to FALSE and the corresponding
3227 * tinrc.attrib_* to a default value
3228 */
3229 static void
3230 reset_state(
3231 enum option_enum option)
3232 {
3233 struct t_scope *default_scope = &scopes[0];
3234
3235 switch (option) {
3236 case OPT_ATTRIB_ADD_POSTED_TO_FILTER:
3237 curr_scope->state->add_posted_to_filter = FALSE;
3238 tinrc.attrib_add_posted_to_filter = default_scope->attribute->add_posted_to_filter;
3239 break;
3240 case OPT_ATTRIB_ADVERTISING:
3241 curr_scope->state->advertising = FALSE;
3242 tinrc.attrib_advertising = default_scope->attribute->advertising;
3243 break;
3244 case OPT_ATTRIB_ALTERNATIVE_HANDLING:
3245 curr_scope->state->alternative_handling = FALSE;
3246 tinrc.attrib_alternative_handling = default_scope->attribute->alternative_handling;
3247 break;
3248 case OPT_ATTRIB_ASK_FOR_METAMAIL:
3249 curr_scope->state->ask_for_metamail = FALSE;
3250 tinrc.attrib_ask_for_metamail = default_scope->attribute->ask_for_metamail;
3251 break;
3252 case OPT_ATTRIB_AUTO_CC_BCC:
3253 curr_scope->state->auto_cc_bcc = FALSE;
3254 tinrc.attrib_auto_cc_bcc = default_scope->attribute->auto_cc_bcc;
3255 break;
3256 case OPT_ATTRIB_AUTO_LIST_THREAD:
3257 curr_scope->state->auto_list_thread = FALSE;
3258 tinrc.attrib_auto_list_thread = default_scope->attribute->auto_list_thread;
3259 break;
3260 case OPT_ATTRIB_AUTO_SELECT:
3261 curr_scope->state->auto_select = FALSE;
3262 tinrc.attrib_auto_select = default_scope->attribute->auto_select;
3263 break;
3264 case OPT_ATTRIB_BATCH_SAVE:
3265 curr_scope->state->batch_save = FALSE;
3266 tinrc.attrib_batch_save = default_scope->attribute->batch_save;
3267 break;
3268 case OPT_ATTRIB_DATE_FORMAT:
3269 FreeAndNull(curr_scope->attribute->date_format);
3270 curr_scope->state->date_format = FALSE;
3271 snprintf(tinrc.attrib_date_format, sizeof(tinrc.attrib_date_format), "%s", BlankIfNull(default_scope->attribute->date_format));
3272 break;
3273 case OPT_ATTRIB_DELETE_TMP_FILES:
3274 curr_scope->state->delete_tmp_files = FALSE;
3275 tinrc.attrib_delete_tmp_files = default_scope->attribute->delete_tmp_files;
3276 break;
3277 case OPT_ATTRIB_EDITOR_FORMAT:
3278 FreeAndNull(curr_scope->attribute->editor_format);
3279 curr_scope->state->editor_format = FALSE;
3280 snprintf(tinrc.attrib_editor_format, sizeof(tinrc.attrib_editor_format), "%s", BlankIfNull(default_scope->attribute->editor_format));
3281 break;
3282 #ifdef HAVE_COLOR
3283 case OPT_ATTRIB_EXTQUOTE_HANDLING:
3284 curr_scope->state->extquote_handling = FALSE;
3285 tinrc.attrib_extquote_handling = default_scope->attribute->extquote_handling;
3286 break;
3287 #endif /* HAVE_COLOR */
3288 case OPT_ATTRIB_FCC:
3289 FreeAndNull(curr_scope->attribute->fcc);
3290 curr_scope->state->fcc = FALSE;
3291 snprintf(tinrc.attrib_fcc, sizeof(tinrc.attrib_fcc), "%s", BlankIfNull(default_scope->attribute->fcc));
3292 break;
3293 case OPT_ATTRIB_FOLLOWUP_TO:
3294 FreeAndNull(curr_scope->attribute->followup_to);
3295 curr_scope->state->followup_to = FALSE;
3296 snprintf(tinrc.attrib_followup_to, sizeof(tinrc.attrib_followup_to), "%s", BlankIfNull(default_scope->attribute->followup_to));
3297 break;
3298 case OPT_ATTRIB_FROM:
3299 FreeAndNull(curr_scope->attribute->from);
3300 curr_scope->state->from = FALSE;
3301 snprintf(tinrc.attrib_from, sizeof(tinrc.attrib_from), "%s", BlankIfNull(default_scope->attribute->from));
3302 break;
3303 case OPT_ATTRIB_GROUP_CATCHUP_ON_EXIT:
3304 curr_scope->state->group_catchup_on_exit = FALSE;
3305 tinrc.attrib_group_catchup_on_exit = default_scope->attribute->group_catchup_on_exit;
3306 break;
3307 case OPT_ATTRIB_GROUP_FORMAT:
3308 FreeAndNull(curr_scope->attribute->group_format);
3309 curr_scope->state->group_format = FALSE;
3310 snprintf(tinrc.attrib_group_format, sizeof(tinrc.attrib_group_format), "%s", BlankIfNull(default_scope->attribute->group_format));
3311 break;
3312 #ifdef HAVE_ISPELL
3313 case OPT_ATTRIB_ISPELL:
3314 FreeAndNull(curr_scope->attribute->ispell);
3315 curr_scope->state->ispell = FALSE;
3316 snprintf(tinrc.attrib_ispell, sizeof(tinrc.attrib_ispell), "%s", BlankIfNull(default_scope->attribute->ispell));
3317 break;
3318 #endif /* HAVE_ISPELL */
3319 case OPT_ATTRIB_MAILDIR:
3320 FreeAndNull(curr_scope->attribute->maildir);
3321 curr_scope->state->maildir = FALSE;
3322 snprintf(tinrc.attrib_maildir, sizeof(tinrc.attrib_maildir), "%s", BlankIfNull(default_scope->attribute->maildir));
3323 break;
3324 case OPT_ATTRIB_MAIL_8BIT_HEADER:
3325 curr_scope->state->mail_8bit_header = FALSE;
3326 tinrc.attrib_mail_8bit_header = default_scope->attribute->mail_8bit_header;
3327 break;
3328 case OPT_ATTRIB_MAIL_MIME_ENCODING:
3329 curr_scope->state->mail_mime_encoding = FALSE;
3330 tinrc.attrib_mail_mime_encoding = default_scope->attribute->mail_mime_encoding;
3331 break;
3332 case OPT_ATTRIB_MAILING_LIST:
3333 FreeAndNull(curr_scope->attribute->mailing_list);
3334 curr_scope->state->mailing_list = FALSE;
3335 snprintf(tinrc.attrib_mailing_list, sizeof(tinrc.attrib_mailing_list), "%s", BlankIfNull(default_scope->attribute->mailing_list));
3336 break;
3337 case OPT_ATTRIB_MARK_IGNORE_TAGS:
3338 curr_scope->state->mark_ignore_tags = FALSE;
3339 tinrc.attrib_mark_ignore_tags = default_scope->attribute->mark_ignore_tags;
3340 break;
3341 case OPT_ATTRIB_MARK_SAVED_READ:
3342 curr_scope->state->mark_saved_read = FALSE;
3343 tinrc.attrib_mark_saved_read = default_scope->attribute->mark_saved_read;
3344 break;
3345 case OPT_ATTRIB_MIME_FORWARD:
3346 curr_scope->state->mime_forward = FALSE;
3347 tinrc.attrib_mime_forward = default_scope->attribute->mime_forward;
3348 break;
3349 case OPT_ATTRIB_MIME_TYPES_TO_SAVE:
3350 FreeAndNull(curr_scope->attribute->mime_types_to_save);
3351 curr_scope->state->mime_types_to_save = FALSE;
3352 snprintf(tinrc.attrib_mime_types_to_save, sizeof(tinrc.attrib_mime_types_to_save), "%s", BlankIfNull(default_scope->attribute->mime_types_to_save));
3353 break;
3354 case OPT_ATTRIB_NEWS_HEADERS_TO_DISPLAY:
3355 FreeAndNull(curr_scope->attribute->news_headers_to_display);
3356 build_news_headers_array(curr_scope->attribute, TRUE);
3357 curr_scope->state->news_headers_to_display = FALSE;
3358 snprintf(tinrc.attrib_news_headers_to_display, sizeof(tinrc.attrib_news_headers_to_display), "%s", BlankIfNull(default_scope->attribute->news_headers_to_display));
3359 break;
3360 case OPT_ATTRIB_NEWS_HEADERS_TO_NOT_DISPLAY:
3361 FreeAndNull(curr_scope->attribute->news_headers_to_not_display);
3362 build_news_headers_array(curr_scope->attribute, FALSE);
3363 curr_scope->state->news_headers_to_not_display = FALSE;
3364 snprintf(tinrc.attrib_news_headers_to_not_display, sizeof(tinrc.attrib_news_headers_to_not_display), "%s", BlankIfNull(default_scope->attribute->news_headers_to_not_display));
3365 break;
3366 case OPT_ATTRIB_QUICK_KILL_SCOPE:
3367 FreeAndNull(curr_scope->attribute->quick_kill_scope);
3368 curr_scope->state->quick_kill_scope = FALSE;
3369 snprintf(tinrc.attrib_quick_kill_scope, sizeof(tinrc.attrib_quick_kill_scope), "%s", BlankIfNull(default_scope->attribute->quick_kill_scope));
3370 break;
3371 case OPT_ATTRIB_QUICK_KILL_HEADER:
3372 curr_scope->state->quick_kill_header = FALSE;
3373 tinrc.attrib_quick_kill_header = default_scope->attribute->quick_kill_header;
3374 break;
3375 case OPT_ATTRIB_QUICK_KILL_CASE:
3376 curr_scope->state->quick_kill_case = FALSE;
3377 tinrc.attrib_quick_kill_case = default_scope->attribute->quick_kill_case;
3378 break;
3379 case OPT_ATTRIB_QUICK_KILL_EXPIRE:
3380 curr_scope->state->quick_kill_expire = FALSE;
3381 tinrc.attrib_quick_kill_expire = default_scope->attribute->quick_kill_expire;
3382 break;
3383 case OPT_ATTRIB_QUICK_SELECT_SCOPE:
3384 FreeAndNull(curr_scope->attribute->quick_select_scope);
3385 curr_scope->state->quick_select_scope = FALSE;
3386 snprintf(tinrc.attrib_quick_select_scope, sizeof(tinrc.attrib_quick_select_scope), "%s", BlankIfNull(default_scope->attribute->quick_select_scope));
3387 break;
3388 case OPT_ATTRIB_QUICK_SELECT_HEADER:
3389 curr_scope->state->quick_select_header = FALSE;
3390 tinrc.attrib_quick_select_header = default_scope->attribute->quick_select_header;
3391 break;
3392 case OPT_ATTRIB_QUICK_SELECT_CASE:
3393 curr_scope->state->quick_select_case = FALSE;
3394 tinrc.attrib_quick_select_case = default_scope->attribute->quick_select_case;
3395 break;
3396 case OPT_ATTRIB_QUICK_SELECT_EXPIRE:
3397 curr_scope->state->quick_select_expire = FALSE;
3398 tinrc.attrib_quick_select_expire = default_scope->attribute->quick_select_expire;
3399 break;
3400 case OPT_ATTRIB_NEWS_QUOTE_FORMAT:
3401 FreeAndNull(curr_scope->attribute->news_quote_format);
3402 curr_scope->state->news_quote_format = FALSE;
3403 snprintf(tinrc.attrib_news_quote_format, sizeof(tinrc.attrib_news_quote_format), "%s", BlankIfNull(default_scope->attribute->news_quote_format));
3404 break;
3405 case OPT_ATTRIB_ORGANIZATION:
3406 FreeAndNull(curr_scope->attribute->organization);
3407 curr_scope->state->organization = FALSE;
3408 snprintf(tinrc.attrib_organization, sizeof(tinrc.attrib_organization), "%s", BlankIfNull(default_scope->attribute->organization));
3409 break;
3410 case OPT_ATTRIB_POST_8BIT_HEADER:
3411 curr_scope->state->post_8bit_header = FALSE;
3412 tinrc.attrib_post_8bit_header = default_scope->attribute->post_8bit_header;
3413 break;
3414 case OPT_ATTRIB_POST_MIME_ENCODING:
3415 curr_scope->state->post_mime_encoding = FALSE;
3416 tinrc.attrib_post_mime_encoding = default_scope->attribute->post_mime_encoding;
3417 break;
3418 case OPT_ATTRIB_POST_PROCESS_VIEW:
3419 curr_scope->state->post_process_view = FALSE;
3420 tinrc.attrib_post_process_view = default_scope->attribute->post_process_view;
3421 break;
3422 case OPT_ATTRIB_POS_FIRST_UNREAD:
3423 curr_scope->state->pos_first_unread = FALSE;
3424 tinrc.attrib_pos_first_unread = default_scope->attribute->pos_first_unread;
3425 break;
3426 #ifndef DISABLE_PRINTING
3427 case OPT_ATTRIB_PRINT_HEADER:
3428 curr_scope->state->print_header = FALSE;
3429 tinrc.attrib_print_header = default_scope->attribute->print_header;
3430 break;
3431 #endif /* !DISABLE_PRINTING */
3432 case OPT_ATTRIB_PROCESS_ONLY_UNREAD:
3433 curr_scope->state->process_only_unread = FALSE;
3434 tinrc.attrib_process_only_unread = default_scope->attribute->process_only_unread;
3435 break;
3436 case OPT_ATTRIB_PROMPT_FOLLOWUPTO:
3437 curr_scope->state->prompt_followupto = FALSE;
3438 tinrc.attrib_prompt_followupto = default_scope->attribute->prompt_followupto;
3439 break;
3440 case OPT_ATTRIB_QUOTE_CHARS:
3441 FreeAndNull(curr_scope->attribute->quote_chars);
3442 curr_scope->state->quote_chars = FALSE;
3443 snprintf(tinrc.attrib_quote_chars, sizeof(tinrc.attrib_quote_chars), "%s", BlankIfNull(default_scope->attribute->quote_chars));
3444 break;
3445 case OPT_ATTRIB_SAVEDIR:
3446 FreeAndNull(curr_scope->attribute->savedir);
3447 curr_scope->state->savedir = FALSE;
3448 snprintf(tinrc.attrib_savedir, sizeof(tinrc.attrib_savedir), "%s", BlankIfNull(default_scope->attribute->savedir));
3449 break;
3450 case OPT_ATTRIB_SAVEFILE:
3451 FreeAndNull(curr_scope->attribute->savefile);
3452 curr_scope->state->savefile = FALSE;
3453 snprintf(tinrc.attrib_savefile, sizeof(tinrc.attrib_savefile), "%s", BlankIfNull(default_scope->attribute->savefile));
3454 break;
3455 case OPT_ATTRIB_SHOW_AUTHOR:
3456 curr_scope->state->show_author = FALSE;
3457 tinrc.attrib_show_author = default_scope->attribute->show_author;
3458 break;
3459 case OPT_ATTRIB_SHOW_ONLY_UNREAD_ARTS:
3460 curr_scope->state->show_only_unread_arts = FALSE;
3461 tinrc.attrib_show_only_unread_arts = default_scope->attribute->show_only_unread_arts;
3462 break;
3463 case OPT_ATTRIB_SHOW_SIGNATURES:
3464 curr_scope->state->show_signatures = FALSE;
3465 tinrc.attrib_show_signatures = default_scope->attribute->show_signatures;
3466 break;
3467 case OPT_ATTRIB_SIGDASHES:
3468 curr_scope->state->sigdashes = FALSE;
3469 tinrc.attrib_sigdashes = default_scope->attribute->sigdashes;
3470 break;
3471 case OPT_ATTRIB_SIGFILE:
3472 FreeAndNull(curr_scope->attribute->sigfile);
3473 curr_scope->state->sigfile = FALSE;
3474 snprintf(tinrc.attrib_sigfile, sizeof(tinrc.attrib_sigfile), "%s", BlankIfNull(default_scope->attribute->sigfile));
3475 break;
3476 case OPT_ATTRIB_SIGNATURE_REPOST:
3477 curr_scope->state->signature_repost = FALSE;
3478 tinrc.attrib_signature_repost = default_scope->attribute->signature_repost;
3479 break;
3480 case OPT_ATTRIB_THREAD_ARTICLES:
3481 curr_scope->state->thread_articles = FALSE;
3482 tinrc.attrib_thread_articles = default_scope->attribute->thread_articles;
3483 break;
3484 case OPT_ATTRIB_THREAD_CATCHUP_ON_EXIT:
3485 curr_scope->state->thread_catchup_on_exit = FALSE;
3486 tinrc.attrib_thread_catchup_on_exit = default_scope->attribute->thread_catchup_on_exit;
3487 break;
3488 case OPT_ATTRIB_THREAD_FORMAT:
3489 FreeAndNull(curr_scope->attribute->thread_format);
3490 curr_scope->state->thread_format = FALSE;
3491 snprintf(tinrc.attrib_thread_format, sizeof(tinrc.attrib_thread_format), "%s", BlankIfNull(default_scope->attribute->thread_format));
3492 break;
3493 case OPT_ATTRIB_THREAD_PERC:
3494 curr_scope->state->thread_perc = FALSE;
3495 tinrc.attrib_thread_perc = default_scope->attribute->thread_perc;
3496 break;
3497 case OPT_ATTRIB_TRIM_ARTICLE_BODY:
3498 curr_scope->state->trim_article_body = FALSE;
3499 tinrc.attrib_trim_article_body = default_scope->attribute->trim_article_body;
3500 break;
3501 case OPT_ATTRIB_TEX2ISO_CONV:
3502 curr_scope->state->tex2iso_conv = FALSE;
3503 tinrc.attrib_tex2iso_conv = default_scope->attribute->tex2iso_conv;
3504 break;
3505 case OPT_ATTRIB_SORT_THREADS_TYPE:
3506 curr_scope->state->sort_threads_type = FALSE;
3507 tinrc.attrib_sort_threads_type = default_scope->attribute->sort_threads_type;
3508 break;
3509 #ifdef CHARSET_CONVERSION
3510 case OPT_ATTRIB_MM_NETWORK_CHARSET:
3511 curr_scope->state->mm_network_charset = FALSE;
3512 tinrc.attrib_mm_network_charset = default_scope->attribute->mm_network_charset;
3513 break;
3514 case OPT_ATTRIB_UNDECLARED_CHARSET:
3515 FreeAndNull(curr_scope->attribute->undeclared_charset);
3516 curr_scope->state->undeclared_charset = FALSE;
3517 snprintf(tinrc.attrib_undeclared_charset, sizeof(tinrc.attrib_undeclared_charset), "%s", BlankIfNull(default_scope->attribute->undeclared_charset));
3518 break;
3519 #endif /* CHARSET_CONVERSION */
3520 case OPT_ATTRIB_VERBATIM_HANDLING:
3521 curr_scope->state->verbatim_handling = FALSE;
3522 tinrc.attrib_verbatim_handling = default_scope->attribute->verbatim_handling;
3523 break;
3524 case OPT_ATTRIB_WRAP_ON_NEXT_UNREAD:
3525 curr_scope->state->wrap_on_next_unread = FALSE;
3526 tinrc.attrib_wrap_on_next_unread = default_scope->attribute->wrap_on_next_unread;
3527 break;
3528 case OPT_ATTRIB_SORT_ARTICLE_TYPE:
3529 curr_scope->state->sort_article_type = FALSE;
3530 tinrc.attrib_sort_article_type = default_scope->attribute->sort_article_type;
3531 break;
3532 case OPT_ATTRIB_POST_PROCESS_TYPE:
3533 curr_scope->state->post_process_type = FALSE;
3534 tinrc.attrib_post_process_type = default_scope->attribute->post_process_type;
3535 break;
3536 case OPT_ATTRIB_X_BODY:
3537 FreeAndNull(curr_scope->attribute->x_body);
3538 curr_scope->state->x_body = FALSE;
3539 snprintf(tinrc.attrib_x_body, sizeof(tinrc.attrib_x_body), "%s", BlankIfNull(default_scope->attribute->x_body));
3540 break;
3541 case OPT_ATTRIB_X_COMMENT_TO:
3542 curr_scope->state->x_comment_to = FALSE;
3543 tinrc.attrib_x_comment_to = default_scope->attribute->x_comment_to;
3544 break;
3545 case OPT_ATTRIB_X_HEADERS:
3546 FreeAndNull(curr_scope->attribute->x_headers);
3547 curr_scope->state->x_headers = FALSE;
3548 snprintf(tinrc.attrib_x_headers, sizeof(tinrc.attrib_x_headers), "%s", BlankIfNull(default_scope->attribute->x_headers));
3549 break;
3550
3551 default:
3552 break;
3553 }
3554 }
3555
3556
3557 #define INITIALIZE_STRING_ATTRIBUTE(option) do { \
3558 if (curr_scope->state->option) \
3559 snprintf(CAO(tinrc.attrib_, option), sizeof(CAO(tinrc.attrib_, option)), "%s", curr_scope->attribute->option); \
3560 else \
3561 snprintf(CAO(tinrc.attrib_, option), sizeof(CAO(tinrc.attrib_, option)), "%s", BlankIfNull(default_scope->attribute->option)); \
3562 } while (0)
3563 #define INITIALIZE_NUM_ATTRIBUTE(option) do { \
3564 if (curr_scope->state->option) \
3565 CAO(tinrc.attrib_, option) = curr_scope->attribute->option; \
3566 else \
3567 CAO(tinrc.attrib_, option) = default_scope->attribute->option; \
3568 } while (0)
3569
3570 static void
3571 initialize_attributes(
3572 void)
3573 {
3574 struct t_scope *default_scope = &scopes[0];
3575
3576 INITIALIZE_NUM_ATTRIBUTE(add_posted_to_filter);
3577 INITIALIZE_NUM_ATTRIBUTE(advertising);
3578 INITIALIZE_NUM_ATTRIBUTE(alternative_handling);
3579 INITIALIZE_NUM_ATTRIBUTE(ask_for_metamail);
3580 INITIALIZE_NUM_ATTRIBUTE(auto_cc_bcc);
3581 INITIALIZE_NUM_ATTRIBUTE(auto_list_thread);
3582 INITIALIZE_NUM_ATTRIBUTE(auto_select);
3583 INITIALIZE_NUM_ATTRIBUTE(batch_save);
3584 INITIALIZE_NUM_ATTRIBUTE(delete_tmp_files);
3585 #ifdef HAVE_COLOR
3586 INITIALIZE_NUM_ATTRIBUTE(extquote_handling);
3587 #endif /* HAVE_COLOR */
3588 INITIALIZE_NUM_ATTRIBUTE(group_catchup_on_exit);
3589 INITIALIZE_NUM_ATTRIBUTE(mail_8bit_header);
3590 INITIALIZE_NUM_ATTRIBUTE(mail_mime_encoding);
3591 INITIALIZE_NUM_ATTRIBUTE(mark_ignore_tags);
3592 INITIALIZE_NUM_ATTRIBUTE(mark_saved_read);
3593 INITIALIZE_NUM_ATTRIBUTE(mime_forward);
3594 INITIALIZE_NUM_ATTRIBUTE(pos_first_unread);
3595 INITIALIZE_NUM_ATTRIBUTE(post_8bit_header);
3596 INITIALIZE_NUM_ATTRIBUTE(post_mime_encoding);
3597 INITIALIZE_NUM_ATTRIBUTE(post_process_view);
3598 #ifndef DISABLE_PRINTING
3599 INITIALIZE_NUM_ATTRIBUTE(print_header);
3600 #endif /* !DISABLE_PRINTING */
3601 INITIALIZE_NUM_ATTRIBUTE(process_only_unread);
3602 INITIALIZE_NUM_ATTRIBUTE(prompt_followupto);
3603 INITIALIZE_NUM_ATTRIBUTE(quick_kill_header);
3604 INITIALIZE_NUM_ATTRIBUTE(quick_kill_case);
3605 INITIALIZE_NUM_ATTRIBUTE(quick_kill_expire);
3606 INITIALIZE_NUM_ATTRIBUTE(quick_select_header);
3607 INITIALIZE_NUM_ATTRIBUTE(quick_select_case);
3608 INITIALIZE_NUM_ATTRIBUTE(quick_select_expire);
3609 INITIALIZE_NUM_ATTRIBUTE(show_author);
3610 INITIALIZE_NUM_ATTRIBUTE(show_only_unread_arts);
3611 INITIALIZE_NUM_ATTRIBUTE(show_signatures);
3612 INITIALIZE_NUM_ATTRIBUTE(sigdashes);
3613 INITIALIZE_NUM_ATTRIBUTE(signature_repost);
3614 INITIALIZE_NUM_ATTRIBUTE(thread_articles);
3615 INITIALIZE_NUM_ATTRIBUTE(thread_catchup_on_exit);
3616 INITIALIZE_NUM_ATTRIBUTE(thread_perc);
3617 INITIALIZE_NUM_ATTRIBUTE(trim_article_body);
3618 INITIALIZE_NUM_ATTRIBUTE(tex2iso_conv);
3619 INITIALIZE_NUM_ATTRIBUTE(verbatim_handling);
3620 INITIALIZE_NUM_ATTRIBUTE(wrap_on_next_unread);
3621 INITIALIZE_NUM_ATTRIBUTE(sort_article_type);
3622 INITIALIZE_NUM_ATTRIBUTE(sort_threads_type);
3623 INITIALIZE_NUM_ATTRIBUTE(post_process_type);
3624 INITIALIZE_NUM_ATTRIBUTE(x_comment_to);
3625 INITIALIZE_STRING_ATTRIBUTE(date_format);
3626 INITIALIZE_STRING_ATTRIBUTE(editor_format);
3627 INITIALIZE_STRING_ATTRIBUTE(fcc);
3628 INITIALIZE_STRING_ATTRIBUTE(followup_to);
3629 INITIALIZE_STRING_ATTRIBUTE(from);
3630 INITIALIZE_STRING_ATTRIBUTE(group_format);
3631 #ifdef HAVE_ISPELL
3632 INITIALIZE_STRING_ATTRIBUTE(ispell);
3633 #endif /* HAVE_ISPELL */
3634 INITIALIZE_STRING_ATTRIBUTE(maildir);
3635 INITIALIZE_STRING_ATTRIBUTE(mailing_list);
3636 INITIALIZE_STRING_ATTRIBUTE(mime_types_to_save);
3637 INITIALIZE_STRING_ATTRIBUTE(news_headers_to_display);
3638 INITIALIZE_STRING_ATTRIBUTE(news_headers_to_not_display);
3639 INITIALIZE_STRING_ATTRIBUTE(news_quote_format);
3640 INITIALIZE_STRING_ATTRIBUTE(organization);
3641 INITIALIZE_STRING_ATTRIBUTE(quick_kill_scope);
3642 INITIALIZE_STRING_ATTRIBUTE(quick_select_scope);
3643 INITIALIZE_STRING_ATTRIBUTE(quote_chars);
3644 INITIALIZE_STRING_ATTRIBUTE(savedir);
3645 INITIALIZE_STRING_ATTRIBUTE(savefile);
3646 INITIALIZE_STRING_ATTRIBUTE(sigfile);
3647 INITIALIZE_STRING_ATTRIBUTE(thread_format);
3648 #ifdef CHARSET_CONVERSION
3649 INITIALIZE_NUM_ATTRIBUTE(mm_network_charset);
3650 INITIALIZE_STRING_ATTRIBUTE(undeclared_charset);
3651 #endif /* CHARSET_CONVERSION */
3652 INITIALIZE_STRING_ATTRIBUTE(x_body);
3653 INITIALIZE_STRING_ATTRIBUTE(x_headers);
3654 }