]> granicus.if.org Git - vim/commitdiff
patch 8.2.3975: error messages are spread out v8.2.3975
authorBram Moolenaar <Bram@vim.org>
Sat, 1 Jan 2022 19:33:50 +0000 (19:33 +0000)
committerBram Moolenaar <Bram@vim.org>
Sat, 1 Jan 2022 19:33:50 +0000 (19:33 +0000)
Problem:    Error messages are spread out.
Solution:   Move more error messages to errors.h.

14 files changed:
src/clientserver.c
src/errors.h
src/fileio.c
src/gui.c
src/gui_beval.c
src/gui_w32.c
src/gui_x11.c
src/if_cscope.c
src/if_xcmdsrv.c
src/os_mswin.c
src/sign.c
src/version.c
src/viminfo.c
src/window.c

index 2d234f2ca54acfa34efd780eba2774350280366f..2fefcc4151d90b0ac2975437f4662c7f36565f6a 100644 (file)
@@ -709,7 +709,7 @@ check_connection(void)
     make_connection();
     if (X_DISPLAY == NULL)
     {
-       emsg(_("E240: No connection to the X server"));
+       emsg(_(e_no_connection_to_x_server));
        return FAIL;
     }
     return OK;
@@ -759,7 +759,7 @@ remote_common(typval_T *argvars, typval_T *rettv, int expr)
            vim_free(r);
        }
        else
-           semsg(_("E241: Unable to send to %s"), server_name);
+           semsg(_(e_unable_to_send_to_str), server_name);
        return;
     }
 
@@ -1016,7 +1016,7 @@ f_server2client(typval_T *argvars UNUSED, typval_T *rettv)
 
     if (serverSendReply(server, reply) < 0)
     {
-       emsg(_("E258: Unable to send to client"));
+       emsg(_(e_unable_to_send_to_client));
        return;
     }
     rettv->vval.v_number = 0;
index 1ab0fb642d51e6ce6ac2d3e3a2475acca042fef4..a8ad95eb37ba1c4403272248628d3bc9f491135c 100644 (file)
@@ -494,32 +494,85 @@ EXTERN char e_mapping_already_exists_for_str[]
        INIT(= N_("E227: mapping already exists for %s"));
 EXTERN char e_makemap_illegal_mode[]
        INIT(= N_("E228: makemap: Illegal mode"));
+#ifdef FEAT_GUI
 EXTERN char e_cannot_start_the_GUI[]
        INIT(= N_("E229: Cannot start the GUI"));
-
-#if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11)
+EXTERN char e_cannot_read_from_str[]
+       INIT(= N_("E230: Cannot read from \"%s\""));
+EXTERN char e_guifontwide_invalid[]
+       INIT(= N_("E231: 'guifontwide' invalid"));
+EXTERN char e_cannot_create_ballooneval_with_both_message_and_callback[]
+       INIT(= N_("E232: Cannot create BalloonEval with both message and callback"));
+# if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11)
 EXTERN char e_cannot_open_display[]
        INIT(= N_("E233: cannot open display"));
-#endif
-#if defined(FEAT_GUI) && defined(FEAT_XFONTSET)
+# endif
+# if defined(FEAT_XFONTSET)
 EXTERN char e_unknown_fontset_str[]
        INIT(= N_("E234: Unknown fontset: %s"));
-#endif
-#if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK) \
+# endif
+# if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK) \
        || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_HAIKU)
 EXTERN char e_unknown_font_str[]
        INIT(= N_("E235: Unknown font: %s"));
-#endif
-#if defined(FEAT_GUI_X11) && !defined(FEAT_GUI_GTK)
+# endif
+# if defined(FEAT_GUI_X11) && !defined(FEAT_GUI_GTK)
 EXTERN char e_font_str_is_not_fixed_width[]
        INIT(= N_("E236: Font \"%s\" is not fixed-width"));
+# endif
+#endif
+#ifdef MSWIN
+EXTERN char e_printer_selection_failed[]
+       INIT(= N_("E237: Printer selection failed"));
+EXTERN char e_print_error_str[]
+       INIT(= N_("E238: Print error: %s"));
+#endif
+EXTERN char e_invalid_sign_text_str[]
+       INIT(= N_("E239: Invalid sign text: %s"));
+#if defined(FEAT_CLIENTSERVER) && defined(FEAT_X11)
+EXTERN char e_no_connection_to_x_server[]
+       INIT(= N_("E240: No connection to the X server"));
 #endif
 #ifdef FEAT_CLIENTSERVER
+EXTERN char e_unable_to_send_to_str[]
+       INIT(= N_("E241: Unable to send to %s"));
+#endif
+EXTERN char e_cant_split_window_while_closing_another[]
+       INIT(= N_("E242: Can't split a window while closing another"));
+#if defined(FEAT_GUI_MSWIN) && !defined(FEAT_OLE)
+EXTERN char e_argument_not_supported_str_use_ole_version[]
+       INIT(= N_("E243: Argument not supported: \"-%s\"; Use the OLE version."));
+#endif
+#ifdef MSWIN
+EXTERN char e_illegal_str_name_str_in_font_name_str[]
+       INIT(= N_("E244: Illegal %s name \"%s\" in font name \"%s\""));
+EXTERN char e_illegal_char_nr_in_font_name_str[]
+       INIT(= N_("E245: Illegal char '%c' in font name \"%s\""));
+#endif
+EXTERN char e_filechangedshell_autocommand_deleted_buffer[]
+       INIT(= N_("E246: FileChangedShell autocommand deleted buffer"));
+#ifdef FEAT_CLIENTSERVER
 EXTERN char e_no_registered_server_named_str[]
        INIT(= N_("E247: no registered server named \"%s\""));
+EXTERN char e_failed_to_send_command_to_destination_program[]
+       INIT(= N_("E248: Failed to send command to the destination program"));
 #endif
 EXTERN char e_window_layout_changed_unexpectedly[]
        INIT(= N_("E249: window layout changed unexpectedly"));
+#ifdef FEAT_XFONTSET
+EXTERN char e_fonts_for_the_following_charsets_are_missing_in_fontset[]
+       INIT(= N_("E250: Fonts for the following charsets are missing in fontset %s:"));
+#endif
+#ifdef FEAT_CLIENTSERVER
+EXTERN char e_vim_instance_registry_property_is_badly_formed_deleted[]
+       INIT(= N_("E251: VIM instance registry property is badly formed.  Deleted!"));
+#endif
+#ifdef FEAT_GUI_X11
+EXTERN char e_fontsent_name_str_font_str_is_not_fixed_width[]
+       INIT(= N_("E252: Fontset name: %s - Font '%s' is not fixed-width"));
+EXTERN char e_fontset_name_str[]
+       INIT(= N_("E253: Fontset name: %s"));
+#endif
 #if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)
 EXTERN char e_cannot_allocate_color_str[]
        INIT(= N_("E254: Cannot allocate color %s"));
@@ -528,6 +581,18 @@ EXTERN char e_cannot_allocate_color_str[]
 EXTERN char e_couldnt_read_in_sign_data[]
        INIT(= N_("E255: Couldn't read in sign data"));
 #endif
+// E256 unused
+EXTERN char e_cstag_tag_not_founc[]
+       INIT(= N_("E257: cstag: tag not found"));
+#ifdef FEAT_CLIENTSERVER
+EXTERN char e_unable_to_send_to_client[]
+       INIT(= N_("E258: Unable to send to client"));
+#endif
+#ifdef FEAT_CSCOPE
+EXTERN char e_no_matches_found_for_cscope_query_str_of_str[]
+       INIT(= N_("E259: no matches found for cscope query %s of %s"));
+#endif
+
 #ifdef FEAT_EVAL
 EXTERN char e_no_white_space_allowed_before_parenthesis[]
        INIT(= N_("E274: No white space allowed before parenthesis"));
index 1aeb483a9408a1725e7088dac462e5228a722162..7c63a1a3bc4d0eca8b0f1aac50076c0b1c5d97d6 100644 (file)
@@ -4155,7 +4155,7 @@ buf_check_timestamp(
            if (n)
            {
                if (!bufref_valid(&bufref))
-                   emsg(_("E246: FileChangedShell autocommand deleted buffer"));
+                   emsg(_(e_filechangedshell_autocommand_deleted_buffer));
 #ifdef FEAT_EVAL
                s = get_vim_var_str(VV_FCS_CHOICE);
                if (STRCMP(s, "reload") == 0 && *reason != 'd')
index a5f449a38663911faba6bb196b8a918f839f0ab4..292da7c4fb45064cf8ee798094fa42dc4489e5c4 100644 (file)
--- a/src/gui.c
+++ b/src/gui.c
@@ -547,7 +547,7 @@ gui_init(void)
            if (STRCMP(use_gvimrc, "NONE") != 0
                    && STRCMP(use_gvimrc, "NORC") != 0
                    && do_source(use_gvimrc, FALSE, DOSO_NONE, NULL) != OK)
-               semsg(_("E230: Cannot read from \"%s\""), use_gvimrc);
+               semsg(_(e_cannot_read_from_str), use_gvimrc);
        }
        else
        {
@@ -686,7 +686,7 @@ gui_init(void)
        goto error2;
     }
     if (gui_get_wide_font() == FAIL)
-       emsg(_("E231: 'guifontwide' invalid"));
+       emsg(_(e_guifontwide_invalid));
 
     gui.num_cols = Columns;
     gui.num_rows = Rows;
index 9e461e687c36c123b8b6c4cc24f65f172bf74cf0..b460e36fc1ab22885e2066f762bcf9a721927d9f 100644 (file)
@@ -103,7 +103,7 @@ gui_mch_create_beval_area(
 
     if (mesg != NULL && mesgCB != NULL)
     {
-       iemsg(_("E232: Cannot create BalloonEval with both message and callback"));
+       iemsg(_(e_cannot_create_ballooneval_with_both_message_and_callback));
        return NULL;
     }
 
index 604114ce93a15281129ba7d195fb6e57858d3f34..e612505dad7bcd6f1cc5d7277291db49e732da1f 100644 (file)
@@ -4982,8 +4982,7 @@ ole_error(char *arg)
 
     // Can't use emsg() here, we have not finished initialisation yet.
     vim_snprintf(buf, IOSIZE,
-           _("E243: Argument not supported: \"-%s\"; Use the OLE version."),
-           arg);
+                        _(e_argument_not_supported_str_use_ole_version), arg);
     mch_errmsg(buf);
 }
 #endif
@@ -8682,7 +8681,7 @@ gui_mch_create_beval_area(
 
     if (mesg != NULL && mesgCB != NULL)
     {
-       iemsg(_("E232: Cannot create BalloonEval with both message and callback"));
+       iemsg(_(e_cannot_create_ballooneval_with_both_message_and_callback));
        return NULL;
     }
 
index 6ef347431b0aa30dee3e5334ffeca2c88ed9ec64..7828ab7842ed4f0569937056e75f78dc604838fd 100644 (file)
@@ -2062,7 +2062,7 @@ gui_mch_get_fontset(
 
        if (giveErrorIfMissing)
        {
-           semsg(_("E250: Fonts for the following charsets are missing in fontset %s:"), name);
+           semsg(_(e_fonts_for_the_following_charsets_are_missing_in_fontset), name);
            for (i = 0; i < num_missing; i++)
                semsg("%s", missing[i]);
        }
@@ -2104,8 +2104,8 @@ check_fontset_sanity(XFontSet fs)
     {
        if (xfs[i]->max_bounds.width != xfs[i]->min_bounds.width)
        {
-           semsg(_("E252: Fontset name: %s"), base_name);
-           semsg(_("Font '%s' is not fixed-width"), font_name[i]);
+           semsg(_(e_fontsent_name_str_font_str_is_not_fixed_width),
+                   base_name, font_name[i]);
            return FAIL;
        }
     }
@@ -2124,7 +2124,7 @@ check_fontset_sanity(XFontSet fs)
        if (       xfs[i]->max_bounds.width != 2 * min_width
                && xfs[i]->max_bounds.width != min_width)
        {
-           semsg(_("E253: Fontset name: %s"), base_name);
+           semsg(_(e_fontset_name_str), base_name);
            semsg(_("Font0: %s"), font_name[min_font_idx]);
            semsg(_("Font%d: %s"), i, font_name[i]);
            semsg(_("Font%d width is not twice that of font0"), i);
index c7bd9e33ed849cb9b3b79d60b920cf58341fb5b0..91538313e0cef8ae6a66a56321256c9c39afaa29 100644 (file)
@@ -308,7 +308,7 @@ ex_cstag(exarg_T *eap)
 
     if (!ret)
     {
-       (void)emsg(_("E257: cstag: tag not found"));
+       (void)emsg(_(e_cstag_tag_not_founc));
 #if defined(FEAT_QUICKFIX)
        g_do_tagpreview = 0;
 #endif
@@ -1160,7 +1160,8 @@ cs_find_common(
     if (totmatches == 0)
     {
        if (verbose)
-           (void)semsg(_("E259: no matches found for cscope query %s of %s"), opt, pat);
+           (void)semsg(_(e_no_matches_found_for_cscope_query_str_of_str),
+                                                                    opt, pat);
        vim_free(nummatches);
        return FALSE;
     }
index 25f63de8a5cd327e116f46037d303a7afb60b7ab..6e653c5063e93b83af50c242b7affa80fd1e86e8 100644 (file)
@@ -456,7 +456,7 @@ serverSendToVim(
     vim_free(property);
     if (res < 0)
     {
-       emsg(_("E248: Failed to send command to the destination program"));
+       emsg(_(e_failed_to_send_command_to_destination_program));
        return -1;
     }
 
@@ -1089,7 +1089,7 @@ GetRegProp(
            XFree(*regPropp);
        XDeleteProperty(dpy, RootWindow(dpy, 0), registryProperty);
        if (domsg)
-           emsg(_("E251: VIM instance registry property is badly formed.  Deleted!"));
+           emsg(_(e_vim_instance_registry_property_is_badly_formed_deleted));
        return FAIL;
     }
     return OK;
index f4fc0894d9a702e013c3f7a7fd17ee745282eecf..4f71d9e70d96c0643ea940d1d0965b18040f2ec4 100644 (file)
@@ -1399,7 +1399,7 @@ mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit)
 
     if (prt_dlg.hDC == NULL)
     {
-       emsg(_("E237: Printer selection failed"));
+       emsg(_(e_printer_selection_failed));
        mch_print_cleanup();
        return FALSE;
     }
@@ -1519,7 +1519,7 @@ init_fail_dlg:
                          FORMAT_MESSAGE_FROM_SYSTEM |
                          FORMAT_MESSAGE_IGNORE_INSERTS,
                          NULL, err, 0, (LPTSTR)(&buf), 0, NULL);
-           semsg(_("E238: Print error: %s"),
+           semsg(_(e_print_error_str),
                                  buf == NULL ? (char_u *)_("Unknown") : buf);
            LocalFree((LPVOID)(buf));
        }
@@ -2961,7 +2961,9 @@ get_logfont(
                    if (cp->name == NULL && verbose)
                    {
                        char_u *s = utf16_to_enc(p, NULL);
-                       semsg(_("E244: Illegal charset name \"%s\" in font name \"%s\""), s, name);
+
+                       semsg(_(e_illegal_str_name_str_in_font_name_str),
+                                                          "charset", s, name);
                        vim_free(s);
                        break;
                    }
@@ -2981,7 +2983,8 @@ get_logfont(
                    if (qp->name == NULL && verbose)
                    {
                        char_u *s = utf16_to_enc(p, NULL);
-                       semsg(_("E244: Illegal quality name \"%s\" in font name \"%s\""), s, name);
+                       semsg(_(e_illegal_str_name_str_in_font_name_str),
+                                                          "quality", s, name);
                        vim_free(s);
                        break;
                    }
@@ -2989,7 +2992,7 @@ get_logfont(
                }
            default:
                if (verbose)
-                   semsg(_("E245: Illegal char '%c' in font name \"%s\""), p[-1], name);
+                   semsg(_(e_illegal_char_nr_in_font_name_str), p[-1], name);
                goto theend;
        }
        while (*p == L':')
index 0656c0f506bfbde65bdd11f5efbda7cebfc5408c..290d41482d64807f3a84873eebbf086fb15e4cda 100644 (file)
@@ -1019,7 +1019,7 @@ sign_define_init_text(sign_T *sp, char_u *text)
     // Currently sign text must be one or two display cells
     if (s != endp || cells < 1 || cells > 2)
     {
-       semsg(_("E239: Invalid sign text: %s"), text);
+       semsg(_(e_invalid_sign_text_str), text);
        return FAIL;
     }
 
index 12e236cac0149eff8bd03b64907c209a63a086b1..3b2e7d5d4f32cef5c14396fec90364fd71c4d8d2 100644 (file)
@@ -749,6 +749,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3975,
 /**/
     3974,
 /**/
index b3c0e148e4d798a1c3c0803c11f56eaafae21a5e..5ce1ff36f3e40671f0c59f0b5407d021dd5eb3da 100644 (file)
@@ -3326,7 +3326,7 @@ ex_viminfo(
     {
        if (read_viminfo(eap->arg, VIF_WANT_INFO | VIF_WANT_MARKS
                                  | (eap->forceit ? VIF_FORCEIT : 0)) == FAIL)
-           emsg(_("E195: Cannot open viminfo file for reading"));
+           emsg(_(e_cannot_open_viminfo_file_for_reading));
     }
     else
        write_viminfo(eap->arg, eap->forceit);
index 378436870206ad8dd85bf7cb0ea49da41e66d3d6..ef35a862c4fbb85c86266096fdab87dc4f099968 100644 (file)
@@ -774,7 +774,7 @@ check_split_disallowed()
 {
     if (split_disallowed > 0)
     {
-       emsg(_("E242: Can't split a window while closing another"));
+       emsg(_(e_cant_split_window_while_closing_another));
        return FAIL;
     }
     if (curwin->w_buffer->b_locked_split)