]> granicus.if.org Git - vim/commitdiff
patch 8.2.3987: error messages are spread out v8.2.3987
authorBram Moolenaar <Bram@vim.org>
Sun, 2 Jan 2022 21:26:16 +0000 (21:26 +0000)
committerBram Moolenaar <Bram@vim.org>
Sun, 2 Jan 2022 21:26:16 +0000 (21:26 +0000)
Problem:    Error messages are spread out.
Solution:   Move more error messages to errors.h.

19 files changed:
src/digraph.c
src/errors.h
src/ex_eval.c
src/gui.c
src/hardcopy.c
src/if_cscope.c
src/if_tcl.c
src/if_xcmdsrv.c
src/mbyte.c
src/misc2.c
src/netbeans.c
src/option.c
src/optionstr.c
src/quickfix.c
src/regexp.c
src/tag.c
src/term.c
src/version.c
src/viminfo.c

index a9fcba54105c83868ef19bf816ef49db98eb8822..391b64a91fb95563e86669fd056f60f3e1f912ed 100644 (file)
@@ -2596,7 +2596,7 @@ keymap_init(void)
            if (source_runtime(buf, 0) == FAIL)
            {
                vim_free(buf);
-               return N_("E544: Keymap file not found");
+               return N_(e_keymap_file_not_found);
            }
        }
        vim_free(buf);
index a7b19326dc8adeab9bf5ce772cfdd100d27bb5f9..592cd6c5e5776b715f8793c58935299dbd8c7f43 100644 (file)
@@ -1203,20 +1203,157 @@ EXTERN char e_no_buffers_were_deleted[]
        INIT(= N_("E516: No buffers were deleted"));
 EXTERN char e_no_buffers_were_wiped_out[]
        INIT(= N_("E517: No buffers were wiped out"));
-
+EXTERN char e_unknown_option[]
+       INIT(= N_("E518: Unknown option"));
+EXTERN char e_option_not_supported[]
+       INIT(= N_("E519: Option not supported"));
+EXTERN char e_not_allowed_in_modeline[]
+       INIT(= N_("E520: Not allowed in a modeline"));
+EXTERN char e_number_required_after_equal[]
+       INIT(= N_("E521: Number required after ="));
+EXTERN char e_number_required_after_str_equal_str[]
+       INIT(= N_("E521: Number required: &%s = '%s'"));
+EXTERN char e_not_found_in_termcap[]
+       INIT(= N_("E522: Not found in termcap"));
 EXTERN char e_not_allowed_here[]
        INIT(= N_("E523: Not allowed here"));
+EXTERN char e_missing_colon[]
+       INIT(= N_("E524: Missing colon"));
+EXTERN char e_zero_length_string[]
+       INIT(= N_("E525: Zero length string"));
+EXTERN char e_missing_number_after_angle_str_angle[]
+       INIT(= N_("E526: Missing number after <%s>"));
+EXTERN char e_missing_comma[]
+       INIT(= N_("E527: Missing comma"));
+EXTERN char e_must_specify_a_value[]
+       INIT(= N_("E528: Must specify a ' value"));
+EXTERN char e_cannot_set_term_to_empty_string[]
+       INIT(= N_("E529: Cannot set 'term' to empty string"));
+EXTERN char e_cannot_change_term_in_GUI[]
+       INIT(= N_("E530: Cannot change 'term' in the GUI"));
+EXTERN char e_use_gui_to_start_GUI[]
+       INIT(= N_("E531: Use \":gui\" to start the GUI"));
+#ifdef FEAT_NETBEANS_INTG
+EXTERN char e_highlighting_color_name_too_long_in_defineAnnoType[]
+       INIT(= N_("E532: highlighting color name too long in defineAnnoType"));
+#endif
+EXTERN char e_cant_select_wide_font[]
+       INIT(= N_("E533: can't select wide font"));
+EXTERN char e_invalid_wide_font[]
+       INIT(= N_("E534: Invalid wide font"));
+EXTERN char e_illegal_character_after_chr[]
+       INIT(= N_("E535: Illegal character after <%c>"));
+EXTERN char e_comma_required[]
+       INIT(= N_("E536: comma required"));
+EXTERN char e_commentstring_must_be_empty_or_contain_str[]
+       INIT(= N_("E537: 'commentstring' must be empty or contain %s"));
+// E538 unused (perhaps 538.nl ?)
+EXTERN char e_illegal_character_str[]
+       INIT(= N_("E539: Illegal character <%s>"));
+EXTERN char e_unclosed_expression_sequence[]
+       INIT(= N_("E540: Unclosed expression sequence"));
+// E541 unused
+EXTERN char e_unbalanced_groups[]
+       INIT(= N_("E542: unbalanced groups"));
+#ifdef MSWIN
+EXTERN char e_not_valid_codepage[]
+       INIT(= N_("E543: Not a valid codepage"));
+#endif
+EXTERN char e_keymap_file_not_found[]
+       INIT(= N_("E544: Keymap file not found"));
+EXTERN char e_missing_colon_2[]
+#ifdef CURSOR_SHAPE
+       INIT(= N_("E545: Missing colon"));
+EXTERN char e_illegal_mode[]
+       INIT(= N_("E546: Illegal mode"));
+#endif
+#ifdef FEAT_MOUSESHAPE
+EXTERN char e_illegal_mouseshape[]
+       INIT(= N_("E547: Illegal mouseshape"));
+#endif
+EXTERN char e_digit_expected[]
+       INIT(= N_("E548: digit expected"));
+EXTERN char e_illegal_percentage[]
+       INIT(= N_("E549: Illegal percentage"));
+EXTERN char e_missing_colon_3[]
+       INIT(= N_("E550: Missing colon"));
+EXTERN char e_illegal_component[]
+       INIT(= N_("E551: Illegal component"));
+EXTERN char e_digit_expected_2[]
+       INIT(= N_("E552: digit expected"));
+EXTERN char e_no_more_items[]
+       INIT(= N_("E553: No more items"));
+EXTERN char e_syntax_error_in_str_curlies[]
+       INIT(= N_("E554: Syntax error in %s{...}"));
+EXTERN char e_at_bottom_of_tag_stack[]
+       INIT(= N_("E555: at bottom of tag stack"));
+EXTERN char e_at_top_of_tag_stack[]
+       INIT(= N_("E556: at top of tag stack"));
+EXTERN char e_cannot_open_termcap_file[]
+       INIT(= N_("E557: Cannot open termcap file"));
+EXTERN char e_terminal_entry_not_found_in_terminfo[]
+       INIT(= N_("E558: Terminal entry not found in terminfo"));
+EXTERN char e_terminal_entry_not_found_in_termcap[]
+       INIT(= N_("E559: Terminal entry not found in termcap"));
+EXTERN char e_usage_cscope_str[]
+       INIT(= N_("E560: Usage: cs[cope] %s"));
+EXTERN char e_unknown_cscope_search_type[]
+       INIT(= N_("E561: unknown cscope search type"));
+EXTERN char e_usage_cstag_ident[]
+       INIT(= N_("E562: Usage: cstag <ident>"));
+EXTERN char e_stat_str_error_nr[]
+       INIT(= N_("E563: stat(%s) error: %d"));
+EXTERN char e_str_is_not_directory_or_valid_cscope_database[]
+       INIT(= N_("E564: %s is not a directory or a valid cscope database"));
 EXTERN char e_not_allowed_to_change_text_or_change_window[]
        INIT(= N_("E565: Not allowed to change text or change window"));
+EXTERN char e_could_not_create_cscope_pipes[]
+       INIT(= N_("E566: Could not create cscope pipes"));
+EXTERN char e_no_cscope_connections[]
+       INIT(= N_("E567: no cscope connections"));
+EXTERN char e_duplicate_cscope_database_not_added[]
+       INIT(= N_("E568: duplicate cscope database not added"));
+// E569 unused
+EXTERN char e_fatal_error_in_cs_manage_matches[]
+       INIT(= N_("E570: fatal error in cs_manage_matches"));
+#ifdef DYNAMIC_TCL
+EXTERN char e_sorry_this_command_is_disabled_tcl_library_could_not_be_loaded[]
+       INIT(= N_("E571: Sorry, this command is disabled: the Tcl library could not be loaded."));
+#endif
+EXTERN char e_exit_code_nr[]
+       INIT(= N_("E572: exit code %d"));
+EXTERN char e_invalid_server_id_used_str[]
+       INIT(= N_("E573: Invalid server id used: %s"));
+EXTERN char e_unknown_register_type_nr[]
+       INIT(= N_("E574: Unknown register type %d"));
+       // E575
+EXTERN char e_illegal_starting_char[]
+       INIT(= N_("Illegal starting char"));
+       // E576
+EXTERN char e_nonr_missing_gt[]
+       INIT(= N_("Missing '>'"));
+       // E577
+EXTERN char e_illegal_register_name[]
+       INIT(= N_("Illegal register name"));
 EXTERN char e_not_allowed_to_change_text_here[]
        INIT(= N_("E578: Not allowed to change text here"));
 #ifdef FEAT_EVAL
+EXTERN char e_if_nesting_too_deep[]
+       INIT(= N_("E579: :if nesting too deep"));
+EXTERN char e_block_nesting_too_deep[]
+       INIT(= N_("E579: block nesting too deep"));
 EXTERN char e_endif_without_if[]
        INIT(= N_("E580: :endif without :if"));
 EXTERN char e_else_without_if[]
        INIT(= N_("E581: :else without :if"));
 EXTERN char e_elseif_without_if[]
        INIT(= N_("E582: :elseif without :if"));
+EXTERN char e_multiple_else[]
+       INIT(= N_("E583: multiple :else"));
+EXTERN char e_elseif_after_else[]
+       INIT(= N_("E584: :elseif after :else"));
+EXTERN char e_while_for_nesting_too_deep[]
+       INIT(= N_("E585: :while/:for nesting too deep"));
 EXTERN char e_continue_without_while_or_for[]
        INIT(= N_("E586: :continue without :while or :for"));
 EXTERN char e_break_without_while_or_for[]
@@ -1226,14 +1363,32 @@ EXTERN char e_endwhile_without_while[]
 EXTERN char e_endfor_without_for[]
        INIT(= N_("E588: :endfor without :for"));
 #endif
+EXTERN char e_backupext_and_patchmode_are_equal[]
+       INIT(= N_("E589: 'backupext' and 'patchmode' are equal"));
+EXTERN char e_preview_window_already_exists[]
+       INIT(= N_("E590: A preview window already exists"));
 EXTERN char e_winheight_cannot_be_smaller_than_winminheight[]
        INIT(= N_("E591: 'winheight' cannot be smaller than 'winminheight'"));
 EXTERN char e_winwidth_cannot_be_smaller_than_winminwidth[]
        INIT(= N_("E592: 'winwidth' cannot be smaller than 'winminwidth'"));
-
+EXTERN char e_need_at_least_nr_lines[]
+       INIT(= N_("E593: Need at least %d lines"));
+EXTERN char e_need_at_least_nr_columns[]
+       INIT(= N_("E594: Need at least %d columns"));
+EXTERN char e_showbreak_contains_unprintable_or_wide_character[]
+       INIT(= N_("E595: 'showbreak' contains unprintable or wide character"));
+EXTERN char e_invalid_fonts[]
+       INIT(= N_("E596: Invalid font(s)"));
+EXTERN char e_cant_select_fontset[]
+       INIT(= N_("E597: can't select fontset"));
+EXTERN char e_invalid_fontset[]
+       INIT(= N_("E598: Invalid fontset"));
+EXTERN char e_value_of_imactivatekey_is_invalid[]
+       INIT(= N_("E599: Value of 'imactivatekey' is invalid"));
 #ifdef FEAT_EVAL
 EXTERN char e_missing_endtry[]
        INIT(= N_("E600: Missing :endtry"));
+
 EXTERN char e_endtry_without_try[]
        INIT(= N_("E602: :endtry without :try"));
 EXTERN char e_catch_without_try[]
index 9a4780232c187a5c79d5fad510ad1cf6eddc2ead..231e0f360d0cba5b82106e7950e4ce844dcf8171 100644 (file)
@@ -1017,7 +1017,7 @@ ex_if(exarg_T *eap)
     cstack_T   *cstack = eap->cstack;
 
     if (cstack->cs_idx == CSTACK_LEN - 1)
-       eap->errmsg = _("E579: :if nesting too deep");
+       eap->errmsg = _(e_if_nesting_too_deep);
     else
     {
        enter_block(cstack);
@@ -1111,10 +1111,10 @@ ex_else(exarg_T *eap)
     {
        if (eap->cmdidx == CMD_else)
        {
-           eap->errmsg = _("E583: multiple :else");
+           eap->errmsg = _(e_multiple_else);
            return;
        }
-       eap->errmsg = _("E584: :elseif after :else");
+       eap->errmsg = _(e_elseif_after_else);
        skip = TRUE;
     }
 
@@ -1180,7 +1180,7 @@ ex_while(exarg_T *eap)
     cstack_T   *cstack = eap->cstack;
 
     if (cstack->cs_idx == CSTACK_LEN - 1)
-       eap->errmsg = _("E585: :while/:for nesting too deep");
+       eap->errmsg = _(e_while_for_nesting_too_deep);
     else
     {
        /*
@@ -1465,7 +1465,7 @@ ex_block(exarg_T *eap)
     cstack_T   *cstack = eap->cstack;
 
     if (cstack->cs_idx == CSTACK_LEN - 1)
-       eap->errmsg = _("E579: block nesting too deep");
+       eap->errmsg = _(e_block_nesting_too_deep);
     else
     {
        enter_block(cstack);
index 292da7c4fb45064cf8ee798094fa42dc4489e5c4..bf53caab206fae3c4110150f73f49b06f82aee25 100644 (file)
--- a/src/gui.c
+++ b/src/gui.c
@@ -814,7 +814,7 @@ gui_init(void)
 
 #if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
        if (!im_xim_isvalid_imactivate())
-           emsg(_("E599: Value of 'imactivatekey' is invalid"));
+           emsg(_(e_value_of_imactivatekey_is_invalid));
 #endif
        // When 'cmdheight' was set during startup it may not have taken
        // effect yet.
index 190ca996baf16c14f5d81b2d4b8db10eca0ecd7e..6b1974b2df2c22030974e92931742a92ef6cafdc 100644 (file)
@@ -205,7 +205,7 @@ parse_list_options(
        colonp = vim_strchr(stringp, ':');
        if (colonp == NULL)
        {
-           ret = N_("E550: Missing colon");
+           ret = e_missing_colon_3;
            break;
        }
        commap = vim_strchr(stringp, ',');
@@ -220,7 +220,7 @@ parse_list_options(
 
        if (idx == table_size)
        {
-           ret = N_("E551: Illegal component");
+           ret = e_illegal_component;
            break;
        }
        p = colonp + 1;
@@ -230,7 +230,7 @@ parse_list_options(
        {
            if (!VIM_ISDIGIT(*p))
            {
-               ret = N_("E552: digit expected");
+               ret = e_digit_expected_2;
                break;
            }
 
index d76f1dd878a37e6b5084b10fc3ba2453e0766093..e0dd759ab4e3379fbaeb24f6d19f8aaddd4be5b5 100644 (file)
@@ -76,7 +76,7 @@ static cscmd_T            cs_cmds[] =
     static void
 cs_usage_msg(csid_e x)
 {
-    (void)semsg(_("E560: Usage: cs[cope] %s"), cs_cmds[(int)x].usage);
+    (void)semsg(_(e_usage_cscope_str), cs_cmds[(int)x].usage);
 }
 
 static enum
@@ -250,7 +250,7 @@ ex_cstag(exarg_T *eap)
 
     if (*eap->arg == NUL)
     {
-       (void)emsg(_("E562: Usage: cstag <ident>"));
+       (void)emsg(_(e_usage_cstag_ident));
        return;
     }
 
@@ -463,7 +463,7 @@ cs_add(exarg_T *eap UNUSED)
 cs_stat_emsg(char *fname)
 {
     int err = errno;
-    (void)semsg(_("E563: stat(%s) error: %d"), fname, err);
+    (void)semsg(_(e_stat_str_error_nr), fname, err);
 }
 
 
@@ -564,9 +564,8 @@ staterr:
     else
     {
        if (p_csverbose)
-           (void)semsg(
-               _("E564: %s is not a directory or a valid cscope database"),
-               fname);
+           (void)semsg(_(e_str_is_not_directory_or_valid_cscope_database),
+                                                                       fname);
        goto add_err;
     }
 
@@ -742,7 +741,7 @@ cs_create_cmd(char *csoption, char *pattern)
        search = 9;
        break;
     default :
-       (void)emsg(_("E561: unknown cscope search type"));
+       (void)emsg(_(e_unknown_cscope_search_type));
        cs_usage_msg(Find);
        return NULL;
     }
@@ -799,7 +798,7 @@ cs_create_connection(int i)
     to_cs[0] = to_cs[1] = from_cs[0] = from_cs[1] = -1;
     if (pipe(to_cs) < 0 || pipe(from_cs) < 0)
     {
-       (void)emsg(_("E566: Could not create cscope pipes"));
+       (void)emsg(_(e_could_not_create_cscope_pipes));
 err_closing:
        if (to_cs[0] != -1)
            (void)close(to_cs[0]);
@@ -838,7 +837,7 @@ err_closing:
        if (!(pipe_stdin = CreatePipe(&stdin_rd, &stdin_wr, &sa, 0))
                || !(pipe_stdout = CreatePipe(&stdout_rd, &stdout_wr, &sa, 0)))
        {
-           (void)emsg(_("E566: Could not create cscope pipes"));
+           (void)emsg(_(e_could_not_create_cscope_pipes));
 err_closing:
            if (pipe_stdin)
            {
@@ -1014,7 +1013,7 @@ cs_find(exarg_T *eap)
 
     if (cs_check_for_connections() == FALSE)
     {
-       (void)emsg(_("E567: no cscope connections"));
+       (void)emsg(_(e_no_cscope_connections));
        return FALSE;
     }
 
@@ -1356,7 +1355,7 @@ cs_insert_filelist(
            )
        {
            if (p_csverbose)
-               (void)emsg(_("E568: duplicate cscope database not added"));
+               (void)emsg(_(e_duplicate_cscope_database_not_added));
            return -1;
        }
 
@@ -1665,7 +1664,7 @@ cs_manage_matches(
        cs_print_tags_priv(mp, cp, cnt);
        break;
     default:   // should not reach here
-       iemsg(_("E570: fatal error in cs_manage_matches"));
+       iemsg(_(e_fatal_error_in_cs_manage_matches));
        return NULL;
     }
 
index 65f25c1befdc0c6683924b4c9d5842b1332c79e4..75f904a9ef9c8179d005dcae17fabe9920e27827 100644 (file)
@@ -1710,7 +1710,7 @@ tclinit(exarg_T *eap)
 #ifdef DYNAMIC_TCL
     if (!tcl_enabled(TRUE))
     {
-       emsg(_("E571: Sorry, this command is disabled: the Tcl library could not be loaded."));
+       emsg(_(e_sorry_this_command_is_disabled_tcl_library_could_not_be_loaded));
        return FAIL;
     }
 #endif
@@ -1874,7 +1874,7 @@ tclexit(int error)
     {
        char buf[50];
 
-       sprintf(buf, _("E572: exit code %d"), tclinfo.exitvalue);
+       sprintf(buf, _(e_exit_code_nr), tclinfo.exitvalue);
        tclerrmsg(buf);
        if (tclinfo.exitvalue == 0)
        {
index 6e653c5063e93b83af50c242b7affa80fd1e86e8..81a4d9de30d23caa68de02276aef2a8284c2ea5d 100644 (file)
@@ -720,7 +720,7 @@ serverStrToWin(char_u *str)
 
     sscanf((char *)str, "0x%x", &id);
     if (id == None)
-       semsg(_("E573: Invalid server id used: %s"), str);
+       semsg(_(e_invalid_server_id_used_str), str);
 
     return (Window)id;
 }
index e9febcb98b62075725026c3418d144f2ce71be86..2f4edd53af68d44090ca1a62e96a0e32d20f99dc 100644 (file)
@@ -513,7 +513,7 @@ mb_init(void)
        else if (GetLastError() == ERROR_INVALID_PARAMETER)
        {
 codepage_invalid:
-           return N_("E543: Not a valid codepage");
+           return N_(e_not_valid_codepage);
        }
     }
 #endif
index 3a8012a4a869c4e018efeba3dd7858ccd9d36577..6a65ec475632958ecc15f532c60756e74b60a3bb 100644 (file)
@@ -2066,9 +2066,9 @@ parse_shape_opt(int what)
            commap = vim_strchr(modep, ',');
 
            if (colonp == NULL || (commap != NULL && commap < colonp))
-               return N_("E545: Missing colon");
+               return e_missing_colon_2;
            if (colonp == modep)
-               return N_("E546: Illegal mode");
+               return e_illegal_mode;
 
            /*
             * Repeat for all mode's before the colon.
@@ -2094,7 +2094,7 @@ parse_shape_opt(int what)
                                break;
                        if (idx == SHAPE_IDX_COUNT
                                   || (shape_table[idx].used_for & what) == 0)
-                           return N_("E546: Illegal mode");
+                           return e_illegal_mode;
                        if (len == 2 && modep[0] == 'v' && modep[1] == 'e')
                            found_ve = TRUE;
                    }
@@ -2133,7 +2133,7 @@ parse_shape_opt(int what)
                            if (mshape_names[i] == NULL)
                            {
                                if (!VIM_ISDIGIT(*p))
-                                   return N_("E547: Illegal mouseshape");
+                                   return e_illegal_mouseshape;
                                if (round == 2)
                                    shape_table[idx].mshape =
                                              getdigits(&p) + MSHAPE_NUMBERED;
@@ -2173,12 +2173,12 @@ parse_shape_opt(int what)
                        {
                            p += len;
                            if (!VIM_ISDIGIT(*p))
-                               return N_("E548: digit expected");
+                               return e_digit_expected;
                            n = getdigits(&p);
                            if (len == 3)   // "ver" or "hor"
                            {
                                if (n == 0)
-                                   return N_("E549: Illegal percentage");
+                                   return e_illegal_percentage;
                                if (round == 2)
                                {
                                    if (TOLOWER_ASC(i) == 'v')
index 5bdb8680dc74e1f99c5e070a35d280c07e353381..c4223ca16e232948e956cadd345b0ee929597062 100644 (file)
@@ -1941,7 +1941,7 @@ nb_do_cmd(
            bg = vim_strsave(p);
            if (STRLEN(fg) > MAX_COLOR_LENGTH || STRLEN(bg) > MAX_COLOR_LENGTH)
            {
-               emsg("E532: highlighting color name too long in defineAnnoType");
+               emsg(e_highlighting_color_name_too_long_in_defineAnnoType);
                VIM_CLEAR(typeName);
                parse_error = TRUE;
            }
index 59e4862bad93dc2fcacb4f10aad9b0fbd9d9a62d..ef1908f41049351e04614ebe210c672af8f63969 100644 (file)
@@ -1406,7 +1406,7 @@ do_set(
                                  && vim_strchr((char_u *)"!&<", *arg) != NULL)
                    errmsg = e_no_white_space_allowed_between_option_and;
                else
-                   errmsg = N_("E518: Unknown option");
+                   errmsg = N_(e_unknown_option);
                goto skip;
            }
 
@@ -1419,7 +1419,7 @@ do_set(
                    if (vim_strchr((char_u *)"=:!&<", nextchar) == NULL
                            && (!(options[opt_idx].flags & P_BOOL)
                                || nextchar == '?'))
-                       errmsg = N_("E519: Option not supported");
+                       errmsg = N_(e_option_not_supported);
                    goto skip;
                }
 
@@ -1457,7 +1457,7 @@ do_set(
            {
                if (flags & (P_SECURE | P_NO_ML))
                {
-                   errmsg = N_("E520: Not allowed in a modeline");
+                   errmsg = N_(e_not_allowed_in_modeline);
                    goto skip;
                }
                if ((flags & P_MLE) && !p_mle)
@@ -1682,13 +1682,13 @@ do_set(
                            if (i == 0 || (arg[i] != NUL
                                                      && !VIM_ISWHITE(arg[i])))
                            {
-                               errmsg = N_("E521: Number required after =");
+                               errmsg = N_(e_number_required_after_equal);
                                goto skip;
                            }
                        }
                        else
                        {
-                           errmsg = N_("E521: Number required after =");
+                           errmsg = N_(e_number_required_after_equal);
                            goto skip;
                        }
 
@@ -2140,7 +2140,7 @@ do_set(
                        if (nextchar == '&')
                        {
                            if (add_termcap_entry(key_name, TRUE) == FAIL)
-                               errmsg = N_("E522: Not found in termcap");
+                               errmsg = N_(e_not_found_in_termcap);
                        }
                        else
                        {
@@ -2950,7 +2950,7 @@ set_bool_option(
                if (win->w_p_pvw && win != curwin)
                {
                    curwin->w_p_pvw = FALSE;
-                   return N_("E590: A preview window already exists");
+                   return N_(e_preview_window_already_exists);
                }
        }
     }
@@ -3680,7 +3680,7 @@ set_num_option(
        if (errbuf != NULL)
        {
            vim_snprintf((char *)errbuf, errbuflen,
-                              _("E593: Need at least %d lines"), min_rows());
+                              _(e_need_at_least_nr_lines), min_rows());
            errmsg = errbuf;
        }
        Rows = min_rows();
@@ -3690,7 +3690,7 @@ set_num_option(
        if (errbuf != NULL)
        {
            vim_snprintf((char *)errbuf, errbuflen,
-                           _("E594: Need at least %d columns"), MIN_COLUMNS);
+                           _(e_need_at_least_nr_columns), MIN_COLUMNS);
            errmsg = errbuf;
        }
        Columns = MIN_COLUMNS;
@@ -4385,7 +4385,7 @@ set_option_value(
                        // There's another character after zeros or the string
                        // is empty.  In both cases, we are trying to set a
                        // num option using a string.
-                       semsg(_("E521: Number required: &%s = '%s'"),
+                       semsg(_(e_number_required_after_str_equal_str),
                                                                name, string);
                        return NULL;     // do nothing as we hit an error
 
index fa23a9c6a63cd42f4a14dc9520a55e4f035e21a3..f555beef104195cbd23396f25befa696222ec548 100644 (file)
@@ -193,8 +193,7 @@ illegal_char(char *errbuf, int c)
 {
     if (errbuf == NULL)
        return "";
-    sprintf((char *)errbuf, _("E539: Illegal character <%s>"),
-                                                       (char *)transchar(c));
+    sprintf((char *)errbuf, _(e_illegal_character_str), (char *)transchar(c));
     return errbuf;
 }
 
@@ -629,11 +628,11 @@ check_stl_option(char_u *s)
            while ((*s != '}' || (reevaluate && s[-1] != '%')) && *s)
                s++;
            if (*s != '}')
-               return N_("E540: Unclosed expression sequence");
+               return N_(e_unclosed_expression_sequence);
        }
     }
     if (groupdepth != 0)
-       return N_("E542: unbalanced groups");
+       return N_(e_unbalanced_groups);
     return NULL;
 }
 #endif
@@ -693,15 +692,15 @@ did_set_string_option(
     else if (varp == &T_NAME)
     {
        if (T_NAME[0] == NUL)
-           errmsg = N_("E529: Cannot set 'term' to empty string");
+           errmsg = e_cannot_set_term_to_empty_string;
 #ifdef FEAT_GUI
        else if (gui.in_use)
-           errmsg = N_("E530: Cannot change term in GUI");
+           errmsg = e_cannot_change_term_in_GUI;
        else if (term_is_gui(T_NAME))
-           errmsg = N_("E531: Use \":gui\" to start the GUI");
+           errmsg = e_use_gui_to_start_GUI;
 #endif
        else if (set_termname(T_NAME) == FAIL)
-           errmsg = N_("E522: Not found in termcap");
+           errmsg = e_not_found_in_termcap;
        else
        {
            // Screen colors may have changed.
@@ -749,7 +748,7 @@ did_set_string_option(
     {
        if (STRCMP(*p_bex == '.' ? p_bex + 1 : p_bex,
                     *p_pm == '.' ? p_pm + 1 : p_pm) == 0)
-           errmsg = N_("E589: 'backupext' and 'patchmode' are equal");
+           errmsg = N_(e_backupext_and_patchmode_are_equal);
     }
 #ifdef FEAT_LINEBREAK
     // 'breakindentopt'
@@ -1296,9 +1295,9 @@ ambw_end:
                ++s;
            }
            if (*s++ == NUL)
-               errmsg = N_("E524: Missing colon");
+               errmsg = e_missing_colon;
            else if (*s == ',' || *s == NUL)
-               errmsg = N_("E525: Zero length string");
+               errmsg = e_zero_length_string;
            if (errmsg != NULL)
                break;
            while (*s && *s != ',')
@@ -1395,7 +1394,8 @@ ambw_end:
                {
                    if (errbuf != NULL)
                    {
-                       sprintf(errbuf, _("E526: Missing number after <%s>"),
+                       sprintf(errbuf,
+                               _(e_missing_number_after_angle_str_angle),
                                                    transchar_byte(*(s - 1)));
                        errmsg = errbuf;
                    }
@@ -1409,14 +1409,14 @@ ambw_end:
            else if (*s)
            {
                if (errbuf != NULL)
-                   errmsg = N_("E527: Missing comma");
+                   errmsg = e_missing_comma;
                else
                    errmsg = "";
                break;
            }
        }
        if (*p_viminfo && errmsg == NULL && get_viminfo_parameter('\'') < 0)
-           errmsg = N_("E528: Must specify a ' value");
+           errmsg = e_must_specify_a_value;
     }
 #endif // FEAT_VIMINFO
 
@@ -1487,7 +1487,7 @@ ambw_end:
        for (s = *varp; *s; )
        {
            if (ptr2cells(s) != 1)
-               errmsg = N_("E595: 'showbreak' contains unprintable or wide character");
+               errmsg = N_(e_showbreak_contains_unprintable_or_wide_character);
            MB_PTR_ADV(s);
        }
     }
@@ -1529,7 +1529,7 @@ ambw_end:
                }
                else
 # endif
-                   errmsg = N_("E596: Invalid font(s)");
+                   errmsg = N_(e_invalid_fonts);
            }
        }
        redraw_gui_only = TRUE;
@@ -1538,18 +1538,18 @@ ambw_end:
     else if (varp == &p_guifontset)
     {
        if (STRCMP(p_guifontset, "*") == 0)
-           errmsg = N_("E597: can't select fontset");
+           errmsg = N_(e_cant_select_fontset);
        else if (gui.in_use && gui_init_font(p_guifontset, TRUE) != OK)
-           errmsg = N_("E598: Invalid fontset");
+           errmsg = N_(e_invalid_fontset);
        redraw_gui_only = TRUE;
     }
 # endif
     else if (varp == &p_guifontwide)
     {
        if (STRCMP(p_guifontwide, "*") == 0)
-           errmsg = N_("E533: can't select wide font");
+           errmsg = e_cant_select_wide_font;
        else if (gui_get_wide_font() == FAIL)
-           errmsg = N_("E534: Invalid wide font");
+           errmsg = e_invalid_wide_font;
        redraw_gui_only = TRUE;
     }
 #endif
@@ -1860,8 +1860,7 @@ ambw_end:
                    if (errbuf != NULL)
                    {
                        sprintf((char *)errbuf,
-                                    _("E535: Illegal character after <%c>"),
-                                    *--s);
+                                      _(e_illegal_character_after_chr), *--s);
                        errmsg = errbuf;
                    }
                    else
@@ -2031,7 +2030,7 @@ ambw_end:
     {
        p = vim_strchr(*varp, ',');
        if (p == NULL)
-           errmsg = N_("E536: comma required");
+           errmsg = e_comma_required;
        else if (p == *varp || p[1] == NUL)
            errmsg = e_invalid_argument;
        else if (foldmethodIsMarker(curwin))
@@ -2041,7 +2040,7 @@ ambw_end:
     else if (gvarp == &p_cms)
     {
        if (**varp != NUL && strstr((char *)*varp, "%s") == NULL)
-           errmsg = N_("E537: 'commentstring' must be empty or contain %s");
+           errmsg = e_commentstring_must_be_empty_or_contain_str;
     }
     // 'foldopen'
     else if (varp == &p_fdo)
index 101240a448ad81562464e933f75fb18f0209fce6..c2747b7add3f07ed06b6d9754794c183891b1a11 100644 (file)
@@ -187,7 +187,6 @@ static buf_T        *load_dummy_buffer(char_u *fname, char_u *dirname_start, char_u *re
 static void    wipe_dummy_buffer(buf_T *buf, char_u *dirname_start);
 static void    unload_dummy_buffer(buf_T *buf, char_u *dirname_start);
 static qf_info_T *ll_get_or_alloc_list(win_T *);
-static char_u  *e_no_more_items = (char_u *)N_("E553: No more items");
 
 // Quickfix window check helper macro
 #define IS_QF_WINDOW(wp) (bt_quickfix(wp->w_buffer) && wp->w_llist_ref == NULL)
@@ -2733,7 +2732,7 @@ get_nth_valid_entry(
     int                        qf_idx = qfl->qf_index;
     qfline_T           *prev_qf_ptr;
     int                        prev_index;
-    char_u             *err = e_no_more_items;
+    char               *err = e_no_more_items;
 
     while (errornr--)
     {
index fdcd6d10e066f5a83d407bf2676408145d43c105..a30ff8bdc0e9b17d7cd159ebbb6112b0f1a20c5b 100644 (file)
@@ -1050,7 +1050,7 @@ read_limits(long *minval, long *maxval)
     if (*regparse == '\\')
        regparse++;     // Allow either \{...} or \{...\}
     if (*regparse != '}')
-       EMSG2_RET_FAIL(_("E554: Syntax error in %s{...}"),
+       EMSG2_RET_FAIL(_(e_syntax_error_in_str_curlies),
                                                       reg_magic == MAGIC_ALL);
 
     /*
index b2d610a880b76d6134321b112942bdf9f12ca787..5e890e4940a7c5edd013621cea7c026d6d3ad57c 100644 (file)
--- a/src/tag.c
+++ b/src/tag.c
@@ -84,8 +84,6 @@ static int add_llist_tags(char_u *tag, int num_matches, char_u **matches);
 #endif
 static void tagstack_clear_entry(taggy_T *item);
 
-static char_u *bottommsg = (char_u *)N_("E555: at bottom of tag stack");
-static char_u *topmsg = (char_u *)N_("E556: at top of tag stack");
 #ifdef FEAT_EVAL
 static char_u *recurmsg = (char_u *)N_("E986: cannot modify the tag stack within tagfunc");
 static char_u *tfu_inv_ret_msg = (char_u *)N_("E987: invalid return value from tagfunc");
@@ -377,7 +375,7 @@ do_tag(
 #endif
                if ((tagstackidx -= count) < 0)
                {
-                   emsg(_(bottommsg));
+                   emsg(_(e_at_bottom_of_tag_stack));
                    if (tagstackidx + count == 0)
                    {
                        // We did [num]^T from the bottom of the stack
@@ -390,7 +388,7 @@ do_tag(
                }
                else if (tagstackidx >= tagstacklen)    // count == 0?
                {
-                   emsg(_(topmsg));
+                   emsg(_(e_at_top_of_tag_stack));
                    goto end_do_tag;
                }
 
@@ -461,12 +459,12 @@ do_tag(
                         * position.
                         */
                        tagstackidx = tagstacklen - 1;
-                       emsg(_(topmsg));
+                       emsg(_(e_at_top_of_tag_stack));
                        save_pos = FALSE;
                    }
                    else if (tagstackidx < 0)   // must have been count == 0
                    {
-                       emsg(_(bottommsg));
+                       emsg(_(e_at_bottom_of_tag_stack));
                        tagstackidx = 0;
                        goto end_do_tag;
                    }
index b3df1b3ffeb603047e6ae36c3f23bae32af6d120..85f6229342522504e70d3f3a167cf843abbbbbfa 100644 (file)
@@ -2222,13 +2222,13 @@ tgetent_error(char_u *tbuf, char_u *term)
 
        if (i < 0)
 # ifdef TGETENT_ZERO_ERR
-           return _("E557: Cannot open termcap file");
+           return _(e_cannot_open_termcap_file);
        if (i == 0)
 # endif
 #ifdef TERMINFO
-           return _("E558: Terminal entry not found in terminfo");
+           return _(e_terminal_entry_not_found_in_terminfo);
 #else
-           return _("E559: Terminal entry not found in termcap");
+           return _(e_terminal_entry_not_found_in_termcap);
 #endif
     }
     return NULL;
index 528ae1cc4dc20337c8ca6256c93f808f97012c5b..3403fdaf6f17f4d14ac9dcda807b52225a4163b7 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3987,
 /**/
     3986,
 /**/
index 5ce1ff36f3e40671f0c59f0b5407d021dd5eb3da..9cf1526060f68dab374188f6f54cbeb48ed99b05 100644 (file)
@@ -1611,7 +1611,7 @@ read_viminfo_register(vir_T *virp, int force)
 
     if (!ASCII_ISALNUM(*str) && *str != '-')
     {
-       if (viminfo_error("E577: ", _("Illegal register name"), virp->vir_line))
+       if (viminfo_error("E577: ", _(e_illegal_register_name), virp->vir_line))
            return TRUE;        // too many errors, pretend end-of-file
        do_it = FALSE;
     }
@@ -1891,7 +1891,7 @@ write_viminfo_registers(FILE *fp)
                type = (char_u *)"BLOCK";
                break;
            default:
-               semsg(_("E574: Unknown register type %d"), y_ptr->y_type);
+               semsg(_(e_unknown_register_type_nr), y_ptr->y_type);
                type = (char_u *)"LINE";
                break;
        }
@@ -2272,7 +2272,7 @@ copy_viminfo_marks(
        {
            if (line[0] != '\n' && line[0] != '\r' && line[0] != '#')
            {
-               if (viminfo_error("E576: ", _("Missing '>'"), line))
+               if (viminfo_error("E576: ", _(e_nonr_missing_gt), line))
                    break;      // too many errors, return now
            }
            eof = vim_fgets(line, LSIZE, virp->vir_fd);
@@ -2876,7 +2876,7 @@ read_viminfo_up_to_marks(
                    eof = viminfo_readline(virp);
                break;
            default:
-               if (viminfo_error("E575: ", _("Illegal starting char"),
+               if (viminfo_error("E575: ", _(e_illegal_starting_char),
                            virp->vir_line))
                    eof = TRUE;
                else