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

20 files changed:
src/change.c
src/clientserver.c
src/errors.h
src/eval.c
src/gui_xim.c
src/if_cscope.c
src/if_py_both.h
src/if_python.c
src/if_python3.c
src/if_ruby.c
src/if_tcl.c
src/main.c
src/mark.c
src/match.c
src/memfile.c
src/memline.c
src/terminal.c
src/textprop.c
src/userfunc.c
src/version.c

index bc77fa23da92882e4bdb1df1a90c95dbcb60f71f..9f1705f2a4ce96fb4ae96661b361ac38c2993b92 100644 (file)
@@ -1247,7 +1247,7 @@ del_bytes(
     // If "count" is negative the caller must be doing something wrong.
     if (count < 1)
     {
-       siemsg("E292: Invalid count for del_bytes(): %ld", count);
+       siemsg(e_invalid_count_for_del_bytes_nr, count);
        return FAIL;
     }
 
index 2fefcc4151d90b0ac2975437f4662c7f36565f6a..ca6a4eb6684ab1ae71bc77cbf32ea8446688f800 100644 (file)
@@ -929,7 +929,7 @@ f_remote_read(typval_T *argvars UNUSED, typval_T *rettv)
                || serverReadReply(X_DISPLAY, serverStrToWin(serverid),
                                                       &r, FALSE, timeout) < 0)
 # endif
-           emsg(_("E277: Unable to read a server reply"));
+           emsg(_(e_unable_to_read_server_reply));
     }
 #endif
     rettv->v_type = VAR_STRING;
index a8ad95eb37ba1c4403272248628d3bc9f491135c..2a5b85c6ac158c1352b6fdf1f39b1771393afd66 100644 (file)
@@ -592,11 +592,117 @@ EXTERN char e_unable_to_send_to_client[]
 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_missing_name_after_method[]
+       INIT(= N_("E260: Missing name after ->"));
+#endif
+#ifdef FEAT_CSCOPE
+EXTERN char e_cscope_connection_str_not_founc[]
+       INIT(= N_("E261: cscope connection %s not found"));
+EXTERN char e_error_reading_cscope_connection_nr[]
+       INIT(= N_("E262: error reading cscope connection %d"));
+#endif
+#ifdef DYNAMIC_PYTHON
+EXTERN char e_sorry_this_command_is_disabled_python_library_could_not_be_found[]
+       INIT(= N_("E263: Sorry, this command is disabled, the Python library could not be loaded."));
+#endif
+#if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3)
+EXTERN char e_python_error_initialising_io_object[]
+       INIT(= N_("E264: Python: Error initialising I/O objects"));
+#endif
+#ifdef FEAT_RUBY
+EXTERN char e_dollar_must_be_an_instance_of_string[]
+       INIT(= N_("E265: $_ must be an instance of String"));
+#endif
+#ifdef DYNAMIC_RUBY
+EXTERN char e_sorry_this_command_is_disabled_the_ruby_library_could_not_be_loaded[]
+       INIT(= N_("E266: Sorry, this command is disabled, the Ruby library could not be loaded."));
+#endif
+#ifdef FEAT_RUBY
+EXTERN char e_unexpected_return[]
+       INIT(= N_("E267: unexpected return"));
+EXTERN char e_unexpected_next[]
+       INIT(= N_("E268: unexpected next"));
+EXTERN char e_unexpected_break[]
+       INIT(= N_("E269: unexpected break"));
+EXTERN char e_unexpected_redo[]
+       INIT(= N_("E270: unexpected redo"));
+EXTERN char e_retry_outside_of_rescue_clause[]
+       INIT(= N_("E271: retry outside of rescue clause"));
+EXTERN char e_unhandled_exception[]
+       INIT(= N_("E272: unhandled exception"));
+EXTERN char e_unknown_longjmp_status_nr[]
+       INIT(= N_("E273: unknown longjmp status %d"));
+#endif
 #ifdef FEAT_EVAL
 EXTERN char e_no_white_space_allowed_before_parenthesis[]
        INIT(= N_("E274: No white space allowed before parenthesis"));
 #endif
+#ifdef FEAT_PROP_POPUP
+EXTERN char e_cannot_add_text_property_to_unloaded_buffer[]
+       INIT(= N_("E275: Cannot add text property to unloaded buffer"));
+#endif
+#ifdef FEAT_EVAL
+EXTERN char e_cannot_use_function_as_method_str[]
+       INIT(= N_("E276: Cannot use function as a method: %s"));
+#endif
+#ifdef FEAT_CLIENTSERVER
+EXTERN char e_unable_to_read_server_reply[]
+       INIT(= N_("E277: Unable to read a server reply"));
+#endif
+#ifdef FEAT_TERMINAL
+EXTERN char e_sorry_plusplusshell_not_supported_on_this_system[]
+       INIT(= N_("E279: Sorry, ++shell is not supported on this system"));
+#endif
+#ifdef FEAT_TCL
+EXTERN char e_tcl_fatal_error_reflist_corrupt_please_report_this[]
+       INIT(= N_("E280: TCL FATAL ERROR: reflist corrupt!? Please report this to vim-dev@vim.org"));
+#endif
+// E281 unused
+EXTERN char e_cannot_read_from_str_2[]
+       INIT(= N_("E282: Cannot read from \"%s\""));
+EXTERN char e_no_marks_matching_str[]
+       INIT(= N_("E283: No marks matching \"%s\""));
+#ifdef FEAT_XIM
+EXTERN char e_cannot_set_ic_values[]
+       INIT(= N_("E284: Cannot set IC values"));
+# if defined(FEAT_GUI_X11)
+EXTERN char e_failed_to_create_input_context[]
+       INIT(= N_("E285: Failed to create input context"));
+# endif
+EXTERN char e_failed_to_open_input_method[]
+       INIT(= N_("E286: Failed to open input method"));
+EXTERN char e_warning_could_not_set_destroy_callback_to_im[]
+       INIT(= N_("E287: Warning: Could not set destroy callback to IM"));
+EXTERN char e_input_method_doesnt_support_any_style[]
+       INIT(= N_("E288: input method doesn't support any style"));
+EXTERN char e_input_method_doesnt_support_my_preedit_type[]
+       INIT(= N_("E289: input method doesn't support my preedit type"));
+#endif
+#ifdef FEAT_SEARCH_EXTRA
+EXTERN char e_list_or_number_required[]
+       INIT(= N_("E290: List or number required"));
+#endif
+// E291 unused
+EXTERN char e_invalid_count_for_del_bytes_nr[]
+       INIT(= N_("E292: Invalid count for del_bytes(): %ld"));
+EXTERN char e_block_was_not_locked[]
+       INIT(= N_("E293: block was not locked"));
+EXTERN char e_seek_error_in_swap_file_read[]
+       INIT(= N_("E294: Seek error in swap file read"));
+EXTERN char e_read_error_in_swap_file[]
+       INIT(= N_("E295: Read error in swap file"));
+EXTERN char e_seek_error_in_swap_file_write[]
+       INIT(= N_("E296: Seek error in swap file write"));
+EXTERN char e_write_error_in_swap_file[]
+       INIT(= N_("E297: Write error in swap file"));
+EXTERN char e_didnt_get_block_nr_zero[]
+       INIT(= N_("E298: Didn't get block nr 0?"));
+EXTERN char e_didnt_get_block_nr_one[]
+       INIT(= N_("E298: Didn't get block nr 1?"));
+EXTERN char e_didnt_get_block_nr_two[]
+       INIT(= N_("E298: Didn't get block nr 2?"));
+// E299 unused
 
 #ifdef FEAT_MENU
 EXTERN char e_menu_only_exists_in_another_mode[]
index f22806776aabdca18346d0be80395c077e2ebbfa..99bc5a577a176893e7c7e139b344d55fc1428066 100644 (file)
@@ -3936,7 +3936,7 @@ eval_method(
     if (len <= 0)
     {
        if (verbose)
-           emsg(_("E260: Missing name after ->"));
+           emsg(_(e_missing_name_after_method));
        ret = FAIL;
     }
     else
index 4bd1a2eedfbe8e6f3cf666535b30e5efaa3da4ca..28d354ced3457563316e0f6f8341366a9db45125 100644 (file)
@@ -1324,15 +1324,11 @@ xim_set_preedit(void)
                                        XNLineSpace, line_space,
                                        NULL);
        if (XSetICValues(xic, XNPreeditAttributes, attr_list, NULL))
-           emsg(_("E284: Cannot set IC values"));
+           emsg(_(e_cannot_set_ic_values));
        XFree(attr_list);
     }
 }
 
-#  if defined(FEAT_GUI_X11)
-static char e_xim[] = N_("E285: Failed to create input context");
-#  endif
-
 #  if defined(FEAT_GUI_X11) || defined(PROTO)
 #   if defined(XtSpecificationRelease) && XtSpecificationRelease >= 6 && !defined(SUN_SYSTEM)
 #    define USE_X11R6_XIM
@@ -1483,7 +1479,7 @@ xim_real_init(Window x11_window, Display *x11_display)
        if (p_verbose > 0)
        {
            verbose_enter();
-           emsg(_("E286: Failed to open input method"));
+           emsg(_(e_failed_to_open_input_method));
            verbose_leave();
        }
        return FALSE;
@@ -1496,13 +1492,13 @@ xim_real_init(Window x11_window, Display *x11_display)
        destroy_cb.callback = xim_destroy_cb;
        destroy_cb.client_data = NULL;
        if (XSetIMValues(xim, XNDestroyCallback, &destroy_cb, NULL))
-           emsg(_("E287: Warning: Could not set destroy callback to IM"));
+           emsg(_(e_warning_could_not_set_destroy_callback_to_im));
     }
 #  endif
 
     if (XGetIMValues(xim, XNQueryInputStyle, &xim_styles, NULL) || !xim_styles)
     {
-       emsg(_("E288: input method doesn't support any style"));
+       emsg(_(e_input_method_doesnt_support_any_style));
        XCloseIM(xim);
        return FALSE;
     }
@@ -1561,7 +1557,7 @@ xim_real_init(Window x11_window, Display *x11_display)
        if (p_verbose > 0)
        {
            verbose_enter();
-           emsg(_("E289: input method doesn't support my preedit type"));
+           emsg(_(e_input_method_doesnt_support_my_preedit_type));
            verbose_leave();
        }
        XCloseIM(xim);
@@ -1625,7 +1621,7 @@ xim_real_init(Window x11_window, Display *x11_display)
     else
     {
        if (!is_not_a_term())
-           emsg(_(e_xim));
+           emsg(_(e_failed_to_create_input_context));
        XCloseIM(xim);
        return FALSE;
     }
index 91538313e0cef8ae6a66a56321256c9c39afaa29..dbaa9600fb7fb60b9cc331bc4904e1bbb673a23b 100644 (file)
@@ -636,7 +636,7 @@ cs_cnt_connections(void)
 cs_reading_emsg(
     int idx)   // connection index
 {
-    semsg(_("E262: error reading cscope connection %d"), idx);
+    semsg(_(e_error_reading_cscope_connection_nr), idx);
 }
 
 #define        CSREAD_BUFSIZE  2048
@@ -1497,7 +1497,7 @@ cs_kill(exarg_T *eap UNUSED)
     if ((i != -1) && (i >= csinfo_size || i < -1 || csinfo[i].fname == NULL))
     {
        if (p_csverbose)
-           (void)semsg(_("E261: cscope connection %s not found"), stok);
+           (void)semsg(_(e_cscope_connection_str_not_founc), stok);
     }
     else
     {
index 6d71ac1a28bc86a0a23974df70b3a6aaa8b54e21..b8716fa8ef1467af57390019ebd31ad225234370 100644 (file)
@@ -538,7 +538,7 @@ PythonIO_Init_io(void)
 
     if (PyErr_Occurred())
     {
-       emsg(_("E264: Python: Error initialising I/O objects"));
+       emsg(_(e_python_error_initialising_io_object));
        return -1;
     }
 
index 22c2f0c0d4eef40d76810883904db7efd1dd1095..7cc9aa711cc6150186b51ffa54854e8af0bd1d41 100644 (file)
@@ -919,7 +919,7 @@ Python_Init(void)
 #ifdef DYNAMIC_PYTHON
        if (!python_enabled(TRUE))
        {
-           emsg(_("E263: Sorry, this command is disabled, the Python library could not be loaded."));
+           emsg(_(e_sorry_this_command_is_disabled_python_library_could_not_be_found));
            goto fail;
        }
 #endif
index 938ab8dd5a9189f44f0fe0df3033dac6ac470e15..3bf387aa67eb3d517925bcce954a1c6246badcd6 100644 (file)
@@ -1071,7 +1071,7 @@ Python3_Init(void)
 #ifdef DYNAMIC_PYTHON3
        if (!python3_enabled(TRUE))
        {
-           emsg(_("E263: Sorry, this command is disabled, the Python library could not be loaded."));
+           emsg(_(e_sorry_this_command_is_disabled_python_library_could_not_be_found));
            goto fail;
        }
 #endif
index ef332ee0b60357746c2621fbe292c7571444b339..fcbbf336e77a7a80c59a94f5f66a352b03462dd9 100644 (file)
@@ -978,7 +978,7 @@ ex_rubydo(exarg_T *eap)
            {
                if (TYPE(line) != T_STRING)
                {
-                   emsg(_("E265: $_ must be an instance of String"));
+                   emsg(_(e_dollar_must_be_an_instance_of_string));
                    return;
                }
                ml_replace(i, (char_u *) StringValuePtr(line), 1);
@@ -1077,7 +1077,7 @@ ensure_ruby_initialized(void)
        }
        else
        {
-           emsg(_("E266: Sorry, this command is disabled, the Ruby library could not be loaded."));
+           emsg(_(e_sorry_this_command_is_disabled_the_ruby_library_could_not_be_loaded));
            return 0;
        }
 #endif
@@ -1112,19 +1112,19 @@ error_print(int state)
     switch (state)
     {
        case TAG_RETURN:
-           emsg(_("E267: unexpected return"));
+           emsg(_(e_unexpected_return));
            break;
        case TAG_NEXT:
-           emsg(_("E268: unexpected next"));
+           emsg(_(e_unexpected_next));
            break;
        case TAG_BREAK:
-           emsg(_("E269: unexpected break"));
+           emsg(_(e_unexpected_break));
            break;
        case TAG_REDO:
-           emsg(_("E270: unexpected redo"));
+           emsg(_(e_unexpected_redo));
            break;
        case TAG_RETRY:
-           emsg(_("E271: retry outside of rescue clause"));
+           emsg(_(e_retry_outside_of_rescue_clause));
            break;
        case TAG_RAISE:
        case TAG_FATAL:
@@ -1137,7 +1137,7 @@ error_print(int state)
            einfo = rb_obj_as_string(error);
            if (eclass == rb_eRuntimeError && RSTRING_LEN(einfo) == 0)
            {
-               emsg(_("E272: unhandled exception"));
+               emsg(_(e_unhandled_exception));
            }
            else
            {
@@ -1164,7 +1164,7 @@ error_print(int state)
 #endif
            break;
        default:
-           vim_snprintf(buff, BUFSIZ, _("E273: unknown longjmp status %d"), state);
+           vim_snprintf(buff, BUFSIZ, _(e_unknown_longjmp_status_nr), state);
            emsg(buff);
            break;
     }
index cc48c8e63841f6628e24f931ed1f902fe1fadbb9..65f25c1befdc0c6683924b4c9d5842b1332c79e4 100644 (file)
@@ -1541,7 +1541,7 @@ tclsetdelcmd(
        reflist = reflist->next;
     }
     // This should never happen.  Famous last word?
-    iemsg(_("E280: TCL FATAL ERROR: reflist corrupt!? Please report this to vim-dev@vim.org"));
+    iemsg(_(e_tcl_fatal_error_reflist_corrupt_please_report_this));
     Tcl_SetResult(interp, _("cannot register callback command: buffer/window reference not found"), TCL_STATIC);
     return TCL_ERROR;
 }
index 01dd50477bce95e69abe5f47789d9939dbc99b07..dc82a8ad3c3d5867404189a97554dc86f28eaa18 100644 (file)
@@ -3141,7 +3141,7 @@ source_startup_scripts(mparm_T *parmp)
        else
        {
            if (do_source(parmp->use_vimrc, FALSE, DOSO_NONE, NULL) != OK)
-               semsg(_("E282: Cannot read from \"%s\""), parmp->use_vimrc);
+               semsg(_(e_cannot_read_from_str_2), parmp->use_vimrc);
        }
     }
     else if (!silent_mode)
index dc9bece44f2f7008176697d1207f5ef4b99dfb3a..771eb1b986597a9470d631aa5b486ede39ad4388 100644 (file)
@@ -732,7 +732,7 @@ show_one_mark(
            if (arg == NULL)
                msg(_("No marks set"));
            else
-               semsg(_("E283: No marks matching \"%s\""), arg);
+               semsg(_(e_no_marks_matching_str), arg);
        }
     }
     // don't output anything if 'q' typed at --more-- prompt
index 082c0793eee3242d00db7d6264a1fbdf3cd7df94..8b175f3880721d48cc594cbbcb2f09a6cdc4b336 100644 (file)
@@ -165,7 +165,7 @@ match_add(
            }
            else
            {
-               emsg(_("E290: List or number required"));
+               emsg(_(e_list_or_number_required));
                goto fail;
            }
            if (toplnum == 0 || lnum < toplnum)
index fbffdbe95dd57db46ec19dc7fc7a8e7d09be66fc..4e8decbda72d0a93ccba13933c828ee12cdad74e 100644 (file)
@@ -477,7 +477,7 @@ mf_put(
     flags = hp->bh_flags;
 
     if ((flags & BH_LOCKED) == 0)
-       iemsg(_("E293: block was not locked"));
+       iemsg(_(e_block_was_not_locked));
     flags &= ~BH_LOCKED;
     if (dirty)
     {
@@ -945,12 +945,12 @@ mf_read(memfile_T *mfp, bhdr_T *hp)
     size = page_size * hp->bh_page_count;
     if (vim_lseek(mfp->mf_fd, offset, SEEK_SET) != offset)
     {
-       PERROR(_("E294: Seek error in swap file read"));
+       PERROR(_(e_seek_error_in_swap_file_read));
        return FAIL;
     }
     if ((unsigned)read_eintr(mfp->mf_fd, hp->bh_data, size) != size)
     {
-       PERROR(_("E295: Read error in swap file"));
+       PERROR(_(e_read_error_in_swap_file));
        return FAIL;
     }
 
@@ -1021,7 +1021,7 @@ mf_write(memfile_T *mfp, bhdr_T *hp)
            {
                if (vim_lseek(mfp->mf_fd, offset, SEEK_SET) != offset)
                {
-                   PERROR(_("E296: Seek error in swap file write"));
+                   PERROR(_(e_seek_error_in_swap_file_write));
                    return FAIL;
                }
                if (mf_write_block(mfp,
@@ -1046,7 +1046,7 @@ mf_write(memfile_T *mfp, bhdr_T *hp)
                // successful write or when hitting a key. We keep on trying,
                // in case some space becomes available.
                if (!did_swapwrite_msg)
-                   emsg(_("E297: Write error in swap file"));
+                   emsg(_(e_write_error_in_swap_file));
                did_swapwrite_msg = TRUE;
                return FAIL;
            }
index a0727464634c95f7d952ace921f2a7504d05e0d5..a4485c882d4f3121de758376e82f7742d45cd83b 100644 (file)
@@ -327,7 +327,7 @@ ml_open(buf_T *buf)
        goto error;
     if (hp->bh_bnum != 0)
     {
-       iemsg(_("E298: Didn't get block nr 0?"));
+       iemsg(_(e_didnt_get_block_nr_zero));
        goto error;
     }
     b0p = (ZERO_BL *)(hp->bh_data);
@@ -377,7 +377,7 @@ ml_open(buf_T *buf)
        goto error;
     if (hp->bh_bnum != 1)
     {
-       iemsg(_("E298: Didn't get block nr 1?"));
+       iemsg(_(e_didnt_get_block_nr_one));
        goto error;
     }
     pp = (PTR_BL *)(hp->bh_data);
@@ -395,7 +395,7 @@ ml_open(buf_T *buf)
        goto error;
     if (hp->bh_bnum != 2)
     {
-       iemsg(_("E298: Didn't get block nr 2?"));
+       iemsg(_(e_didnt_get_block_nr_two));
        goto error;
     }
 
index ca5b835dcfe4ef68a95e18177febc11f19814160..d974c11322e17ea454b1176930ffa5ad342686da 100644 (file)
@@ -935,7 +935,7 @@ ex_terminal(exarg_T *eap)
        vim_snprintf((char *)newcmd, cmdlen, "%s %s %s", p_sh, p_shcf, cmd);
        cmd = newcmd;
 # else
-       emsg(_("E279: Sorry, ++shell is not supported on this system"));
+       emsg(_(e_sorry_plusplusshell_not_supported_on_this_system));
        goto theend;
 # endif
 #endif
index 4c17a4aca120ed8aeb3e01cb4f72084859ab5c48..c28d4e42a9f33b6fe90427dad10db6ea19feb731 100644 (file)
@@ -222,7 +222,7 @@ prop_add_one(
 
     if (buf->b_ml.ml_mfp == NULL)
     {
-       emsg(_("E275: Cannot add text property to unloaded buffer"));
+       emsg(_(e_cannot_add_text_property_to_unloaded_buffer));
        return FAIL;
     }
 
index eb2ee1c073c8adb80ca559ee89647a0cbdfdc8b5..dac7df84dbcf238340d8661d22332569da62522f 100644 (file)
@@ -3268,7 +3268,7 @@ user_func_error(int error, char_u *name, funcexe_T *funcexe)
                break;
        case FCERR_NOTMETHOD:
                emsg_funcname(
-                       N_("E276: Cannot use function as a method: %s"), name);
+                       N_(e_cannot_use_function_as_method_str), name);
                break;
        case FCERR_DELETED:
                emsg_funcname(e_function_was_deleted_str, name);
index 44af31269a9e863239465159f45487b32916e2a9..0e341f90c3e5c137e4d696919686b667a3c0eda6 100644 (file)
@@ -749,6 +749,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3977,
 /**/
     3976,
 /**/