diff options
-rw-r--r-- | pico/main.c | 42 | ||||
-rw-r--r-- | pico/pico.c | 11 | ||||
-rw-r--r-- | pith/pine.hlp | 5 |
3 files changed, 56 insertions, 2 deletions
diff --git a/pico/main.c b/pico/main.c index a4f73b1a..33fa3360 100644 --- a/pico/main.c +++ b/pico/main.c @@ -89,6 +89,7 @@ void display_color_codes(void); char args_pico_missing_flag[] = N_("unknown flag \"%c\""); /* TRANSLATORS: error message about command line */ char args_pico_missing_arg[] = N_("missing or empty argument to \"%c\" flag"); +char args_pico_missing_arg_s[] = N_("missing or empty argument to \"%s\" flag"); char args_pico_missing_num[] = N_("non numeric argument for \"%c\" flag"); char args_pico_missing_color[] = N_("missing color for \"%s\" flag"); char args_pico_missing_charset[] = N_("missing character set for \"%s\" flag"); @@ -129,11 +130,13 @@ N_("\t -kcs <keyboard_character_set> \tdefaults to display_character_set"), N_("\t -syscs\t\tuse system-supplied translation routines"), #endif /* ! _WINDOWS */ #ifdef _WINDOWS +N_("\t -dict \"dict1,dict2\" a comma separated list of dictionaries, e.g. en_US, de_DE, es_ES, etc."), N_("\t -cnf color \tforeground color"), N_("\t -cnb color \tbackground color"), N_("\t -crf color \treverse foreground color"), N_("\t -crb color \treverse background color"), #endif /* _WINDOWS */ +#ifndef _WINDOWS N_("\t -color_code \tdisplay number codes for different colors"), N_("\t -ncolors number \tnumber of colors for screen (8, 16, or 256)"), N_("\t -ntfc number \tnumber of color of foreground text"), @@ -158,6 +161,7 @@ N_("\t -q3fc number \tnumber of color of foreground (text) of level three of quo N_("\t -q3bc number \tnumber of color of background of level three of quoted text"), N_("\t -sbfc number \tnumber of color of foreground of signature block text"), N_("\t -sbbc number \tnumber of color of background of signature block text"), +#endif /* !_WINDOWS */ N_("\t +[line#] \tLine - start on line# line, default=1"), N_("\t -v \t\tView - view file"), N_("\t -no_setlocale_collate\tdo not do setlocale(LC_COLLATE)"), @@ -196,6 +200,8 @@ main(int argc, char *argv[]) #ifndef _WINDOWS utf8_parameters(SET_UCS4WIDTH, (void *) pith_ucs4width); +#else /* _WINDOWS */ + chosen_dict = -1; /* do not commit any dictionary when starting */ #endif /* _WINDOWS */ set_input_timeout(600); @@ -772,6 +778,42 @@ Loop: } #endif /* ! _WINDOWS */ #ifdef _WINDOWS + else if(strcmp(*av, "dict") == 0){ + char *cmd = *av; /* save it to use below */ + str = *++av; + if(--ac){ + int i = 0; + char *s; +#define MAX_DICTIONARY 10 + while(str && *str){ + if(dictionary == NULL){ + dictionary = fs_get((MAX_DICTIONARY + 1)*sizeof(char *)); + memset((void *) dictionary, 0, (MAX_DICTIONARY+1)*sizeof(char *)); + if(dictionary == NULL) + goto Loop; /* get out of here */ + } + if((s = strpbrk(str, " ,")) != NULL) + *s++ = '\0'; + dictionary[i] = fs_get(strlen(str) + 1); + strcpy(dictionary[i++], str); + if(s != NULL) + for(; *s && (*s == ' ' || *s == ','); s++); + else + goto Loop; + if(i == MAX_DICTIONARY + 1) + goto Loop; + else + str = s; + } + } + else{ + snprintf(tmp_1k_buf, sizeof(tmp_1k_buf), _(args_pico_missing_arg_s), cmd); + pico_display_args_err(tmp_1k_buf, NULL, 1); + usage++; + } + + goto Loop; + } else if(strcmp(*av, "cnf") == 0 || strcmp(*av, "cnb") == 0 || strcmp(*av, "crf") == 0 diff --git a/pico/pico.c b/pico/pico.c index 9260d34f..9056853a 100644 --- a/pico/pico.c +++ b/pico/pico.c @@ -804,8 +804,17 @@ wquit(int f, int n) } if(s == TRUE){ - if(filewrite(0,1) == TRUE) + if(filewrite(0,1) == TRUE){ +#ifdef _WINDOWS + if(dictionary != NULL){ + int i; + for(i = 0; dictionary[i] != NULL; i++) + fs_give((void **)&dictionary[i]); + fs_give((void **)dictionary); + } +#endif /* _WINDOWS */ wquit(1, 0); + } } else if(s == ABORT){ emlwrite(_("Exit cancelled"), NULL); diff --git a/pith/pine.hlp b/pith/pine.hlp index 8e76ec20..97742813 100644 --- a/pith/pine.hlp +++ b/pith/pine.hlp @@ -140,7 +140,7 @@ with help text for the config screen and the composer that didn't have any reasonable place to be called from. Dummy change to get revision in pine.hlp ============= h_revision ================= -Alpine Commit 222 2017-09-29 23:39:51 +Alpine Commit 223 2017-09-30 11:55:59 ============= h_news ================= <HTML> <HEAD> @@ -182,6 +182,9 @@ Additions include: <UL> <LI> NTLM authentication support with the ntlm library, in Unix systems. Based on code provided by Maciej W. Rozycki. + +<LI> Add -dict option to PC-Pico, which allows users to choose a dictionary +when spelling. Sample usage: -dict "en_US, de_DE, fr_FR". </UL> <P> |