changeset 26962:85866e069c24 v8.2.4010

patch 8.2.4010: error messages are spread out Commit: https://github.com/vim/vim/commit/9d00e4a8146862c17ed429dc6b1b43349acb2b5f Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jan 5 17:49:15 2022 +0000 patch 8.2.4010: error messages are spread out Problem: Error messages are spread out. Solution: Move more error messages to errors.h.
author Bram Moolenaar <Bram@vim.org>
date Wed, 05 Jan 2022 19:00:06 +0100
parents 33c0467b3c52
children da59984f3903
files src/crypt.c src/diff.c src/errors.h src/ex_docmd.c src/ex_getln.c src/fileio.c src/findfile.c src/float.c src/gui.c src/highlight.c src/if_mzsch.c src/if_py_both.h src/if_python.c src/if_python3.c src/insexpand.c src/match.c src/memline.c src/option.c src/popupwin.c src/regexp.c src/regexp_nfa.c src/spellfile.c src/strings.c src/syntax.c src/textprop.c src/typval.c src/undo.c src/usercmd.c src/userfunc.c src/version.c src/window.c
diffstat 31 files changed, 200 insertions(+), 87 deletions(-) [+]
line wrap: on
line diff
--- a/src/crypt.c
+++ b/src/crypt.c
@@ -200,7 +200,7 @@ crypt_method_nr_from_magic(char *ptr, in
 
     i = (int)STRLEN(crypt_magic_head);
     if (len >= i && memcmp(ptr, crypt_magic_head, i) == 0)
-	emsg(_("E821: File is encrypted with unknown method"));
+	emsg(_(e_file_is_encrypted_with_unknown_method));
 
     return -1;
 }
--- a/src/diff.c
+++ b/src/diff.c
@@ -1096,7 +1096,7 @@ check_external_diff(diffio_T *diffio)
     if (!ok)
     {
 	if (io_error)
-	    emsg(_("E810: Cannot read or write temp files"));
+	    emsg(_(e_cannot_read_or_write_temp_files));
 	emsg(_(e_cannot_create_diffs));
 	diff_a_works = MAYBE;
 #if defined(MSWIN)
@@ -1337,7 +1337,7 @@ ex_diffpatch(exarg_T *eap)
 
     // Only continue if the output file was created.
     if (mch_stat((char *)tmp_new, &st) < 0 || st.st_size == 0)
-	emsg(_("E816: Cannot read patch output"));
+	emsg(_(e_cannot_read_patch_output));
     else
     {
 	if (curbuf->b_fname != NULL)
--- a/src/errors.h
+++ b/src/errors.h
@@ -1861,24 +1861,55 @@ EXTERN char e_spellfilemising_autocomman
 #endif
 EXTERN char e_id_is_reserved_for_match_nr[]
 	INIT(= N_("E798: ID is reserved for \":match\": %d"));
-EXTERN char e_invalid_id_nr_must_be_greater_than_or_equal_to_one[]
-	INIT(= N_("E799: Invalid ID: %d (must be greater than or equal to 1)"));
+// E799 unused
 #ifndef FEAT_ARABIC
 EXTERN char e_arabic_cannot_be_used_not_enabled_at_compile_time[]
 	INIT(= N_("E800: Arabic cannot be used: Not enabled at compile time\n"));
 #endif
-
+EXTERN char e_id_already_taken_nr[]
+	INIT(= N_("E801: ID already taken: %d"));
+EXTERN char e_invalid_id_nr_must_be_greater_than_or_equal_to_one[]
+	INIT(= N_("E802: Invalid ID: %d (must be greater than or equal to 1)"));
+EXTERN char e_id_not_found_nr[]
+	INIT(= N_("E803: ID not found: %d"));
 #ifdef FEAT_EVAL
 EXTERN char e_cannot_use_percent_with_float[]
 	INIT(= N_("E804: Cannot use '%' with Float"));
 #endif
-
 #ifdef FEAT_FLOAT
+EXTERN char e_using_float_as_number[]
+	INIT(= N_("E805: Using a Float as a Number"));
 EXTERN char e_using_float_as_string[]
 	INIT(= N_("E806: using Float as a String"));
 #endif
+#ifdef FEAT_FLOAT
+EXTERN char e_expected_float_argument_for_printf[]
+	INIT(= N_("E807: Expected Float argument for printf()"));
+#endif
+#if defined(FEAT_EVAL) && defined(FEAT_FLOAT)
+EXTERN char e_number_or_float_required[]
+	INIT(= N_("E808: Number or Float required"));
+#endif
+#ifndef FEAT_EVAL
+EXTERN char e_hashsmall_is_not_available_without_the_eval_feature[]
+	INIT(= N_("E809: #< is not available without the +eval feature"));
+#endif
+EXTERN char e_cannot_read_or_write_temp_files[]
+	INIT(= N_("E810: Cannot read or write temp files"));
+EXTERN char e_not_allowed_to_change_buffer_information_now[]
+	INIT(= N_("E811: Not allowed to change buffer information now"));
+EXTERN char e_autocommands_changed_buffer_or_buffer_name[]
+	INIT(= N_("E812: Autocommands changed buffer or buffer name"));
 EXTERN char e_cannot_close_autocmd_or_popup_window[]
 	INIT(= N_("E813: Cannot close autocmd or popup window"));
+EXTERN char e_cannot_close_window_only_autocmd_window_would_remain[]
+	INIT(= N_("E814: Cannot close window, only autocmd window would remain"));
+#ifdef FEAT_MZSCHEME
+EXTERN char e_sorry_this_command_is_disabled_the_mzscheme_libraries_could_not_be_loaded[]
+	INIT(= N_("E815: Sorry, this command is disabled, the MzScheme libraries could not be loaded."));
+#endif
+EXTERN char e_cannot_read_patch_output[]
+	INIT(= N_("E816: Cannot read patch output"));
 EXTERN char e_blowfish_big_little_endian_use_wrong[]
 	INIT(= N_("E817: Blowfish big/little endian use wrong"));
 EXTERN char e_sha256_test_failed[]
@@ -1887,21 +1918,83 @@ EXTERN char e_blowfish_test_failed[]
 	INIT(= N_("E819: Blowfish test failed"));
 EXTERN char e_sizeof_uint32_isnot_four[]
 	INIT(= N_("E820: sizeof(uint32_t) != 4"));
+EXTERN char e_file_is_encrypted_with_unknown_method[]
+	INIT(= N_("E821: File is encrypted with unknown method"));
+EXTERN char e_cannot_open_undo_file_for_reading_str[]
+	INIT(= N_("E822: Cannot open undo file for reading: %s"));
+EXTERN char e_not_an_undo_file_str[]
+	INIT(= N_("E823: Not an undo file: %s"));
+EXTERN char e_incompatible_undo_file_str[]
+	INIT(= N_("E824: Incompatible undo file: %s"));
+EXTERN char e_corrupted_undo_file_str_str[]
+	INIT(= N_("E825: Corrupted undo file (%s): %s"));
+EXTERN char e_undo_file_decryption_failed[]
+	INIT(= N_("E826: Undo file decryption failed: %s"));
+EXTERN char e_undo_file_is_encrypted_str[]
+	INIT(= N_("E827: Undo file is encrypted: %s"));
+EXTERN char e_cannot_open_undo_file_for_writing_str[]
+	INIT(= N_("E828: Cannot open undo file for writing: %s"));
+EXTERN char e_write_error_in_undo_file_str[]
+	INIT(= N_("E829: write error in undo file: %s"));
+EXTERN char e_undo_number_nr_not_found[]
+	INIT(= N_("E830: Undo number %ld not found"));
 EXTERN char e_bf_key_init_called_with_empty_password[]
 	INIT(= N_("E831: bf_key_init() called with empty password"));
+EXTERN char e_non_encrypted_file_has_encrypted_undo_file[]
+	INIT(= N_("E832: Non-encrypted file has encrypted undo file: %s"));
+EXTERN char e_str_is_encrypted_and_this_version_of_vim_does_not_support_encryption[]
+	INIT(= N_("E833: %s is encrypted and this version of Vim does not support encryption"));
 EXTERN char e_conflicts_with_value_of_listchars[]
 	INIT(= N_("E834: Conflicts with value of 'listchars'"));
 EXTERN char e_conflicts_with_value_of_fillchars[]
 	INIT(= N_("E835: Conflicts with value of 'fillchars'"));
+EXTERN char e_this_vim_cannot_execute_python_after_using_py3[]
+	INIT(= N_("E836: This Vim cannot execute :python after using :py3"));
+EXTERN char e_this_vim_cannot_execute_py3_after_using_python[]
+	INIT(= N_("E837: This Vim cannot execute :py3 after using :python"));
 #ifdef FEAT_NETBEANS_INTG
 EXTERN char e_netbeans_is_not_supported_with_this_GUI[]
 	INIT(= N_("E838: netbeans is not supported with this GUI"));
 #endif
 // E839 unused
+# ifdef FEAT_COMPL_FUNC
+EXTERN char e_complete_function_deleted_text[]
+	INIT(= N_("E840: Completion function deleted text"));
+# endif
+EXTERN char e_reserved_name_cannot_be_used_for_user_defined_command[]
+	INIT(= N_("E841: Reserved name, cannot be used for user defined command"));
+EXTERN char e_no_line_number_to_use_for_slnum[]
+	INIT(= N_("E842: no line number to use for \"<slnum>\""));
+EXTERN char e_error_while_updating_swap_file_crypt[]
+	INIT(= N_("E843: Error while updating swap file crypt"));
+EXTERN char e_invalid_cchar_value[]
+	INIT(= N_("E844: invalid cchar value"));
+#ifdef FEAT_SPELL
+EXTERN char e_insufficient_memory_word_list_will_be_incomplete[]
+	INIT(= N_("E845: Insufficient memory, word list will be incomplete"));
+#endif
+EXTERN char e_key_code_not_set[]
+	INIT(= N_("E846: Key code not set"));
+EXTERN char e_too_many_syntax_includes[]
+	INIT(= N_("E847: Too many syntax includes"));
+EXTERN char e_too_many_syntax_clusters[]
+	INIT(= N_("E848: Too many syntax clusters"));
+EXTERN char e_too_many_highlight_and_syntax_groups[]
+	INIT(= N_("E849: Too many highlight and syntax groups"));
 #ifndef FEAT_CLIPBOARD
 EXTERN char e_invalid_register_name[]
 	INIT(= N_("E850: Invalid register name"));
 #endif
+#ifdef FEAT_GUI
+EXTERN char e_failed_to_create_new_process_for_GUI[]
+	INIT(= N_("E851: Failed to create a new process for the GUI"));
+EXTERN char e_the_child_process_failed_to_start_GUI[]
+	INIT(= N_("E852: The child process failed to start the GUI"));
+#endif
+EXTERN char e_duplicate_argument_name_str[]
+	INIT(= N_("E853: Duplicate argument name: %s"));
+EXTERN char e_path_too_long_for_completion[]
+	INIT(= N_("E854: path too long for completion"));
 EXTERN char e_autocommands_caused_command_to_abort[]
 	INIT(= N_("E855: Autocommands caused command to abort"));
 #ifdef FEAT_EVAL
@@ -1910,6 +2003,38 @@ EXTERN char e_assert_fails_second_arg[]
 EXTERN char e_dictionary_key_str_required[]
 	INIT(= N_("E857: Dictionary key \"%s\" required"));
 #endif
+#if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3)
+EXTERN char e_eval_did_not_return_valid_python_object[]
+	INIT(= N_("E858: Eval did not return a valid python object"));
+EXTERN char e_failed_to_convert_returned_python_object_to_vim_value[]
+	INIT(= N_("E859: Failed to convert returned python object to a Vim value"));
+#endif
+EXTERN char e_need_id_and_type_with_both[]
+	INIT(= N_("E860: Need 'id' and 'type' with 'both'"));
+EXTERN char e_cannot_open_second_popup_with_terminal[]
+	INIT(= N_("E861: Cannot open a second popup with a terminal"));
+EXTERN char e_cannot_use_g_here[]
+	INIT(= N_("E862: Cannot use g: here"));
+EXTERN char e_not_allowed_for_terminal_in_popup_window[]
+	INIT(= N_("E863: Not allowed for a terminal in a popup window"));
+EXTERN char e_percent_hash_can_only_be_followed_by_zero_one_two_automatic_engine_will_be_used[]
+	INIT(= N_("E864: \\%#= can only be followed by 0, 1, or 2. The automatic engine will be used"));
+EXTERN char e_nfa_regexp_end_encountered_prematurely[]
+	INIT(= N_("E865: (NFA) Regexp end encountered prematurely"));
+EXTERN char e_nfa_regexp_misplaced_chr[]
+	INIT(= N_("E866: (NFA regexp) Misplaced %c"));
+EXTERN char e_nfa_unknown_operator_z_chr[]
+	INIT(= N_("E867: (NFA) Unknown operator '\\z%c'"));
+EXTERN char e_nfa_unknown_operator_percent_chr[]
+	INIT(= N_("E867: (NFA) Unknown operator '\\%%%c'"));
+EXTERN char e_error_building_nfa_with_equivalence_class[]
+	INIT(= N_("E868: Error building NFA with equivalence class!"));
+EXTERN char e_nfa_unknown_operator_at_chr[]
+	INIT(= N_("E869: (NFA) Unknown operator '\\@%c'"));
+
+EXTERN char e_nfa_regexp_invalid_character_class_nr[]
+	INIT(= N_("E877: (NFA regexp) Invalid character class: %d"));
+
 #ifdef FEAT_PROP_POPUP
 EXTERN char e_number_required[]
 	INIT(= N_("E889: Number required"));
@@ -1964,6 +2089,9 @@ EXTERN char e_job_still_running_add_bang
 #endif
 EXTERN char e_file_changed_while_writing[]
 	INIT(= N_("E949: File changed while writing"));
+
+EXTERN char e_percent_value_too_large[]
+	INIT(= N_("E951: \\% value too large"));
 EXTERN char e_autocommand_caused_recursive_behavior[]
 	INIT(= N_("E952: Autocommand caused recursive behavior"));
 EXTERN char e_cannot_use_pattern_recursively[]
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -9051,7 +9051,7 @@ eval_vars(
 			return NULL;
 		    }
 #else
-		    *errormsg = _("E809: #< is not available without the +eval feature");
+		    *errormsg = _(e_hashsmall_is_not_available_without_the_eval_feature);
 		    return NULL;
 #endif
 		}
@@ -9147,7 +9147,7 @@ eval_vars(
 	case SPEC_SLNUM:	// line in file for ":so" command
 		if (SOURCING_NAME == NULL || SOURCING_LNUM == 0)
 		{
-		    *errormsg = _("E842: no line number to use for \"<slnum>\"");
+		    *errormsg = _(e_no_line_number_to_use_for_slnum);
 		    return NULL;
 		}
 		sprintf((char *)strbuf, "%ld", SOURCING_LNUM);
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -2679,7 +2679,7 @@ allbuf_locked(void)
 {
     if (allbuf_lock > 0)
     {
-	emsg(_("E811: Not allowed to change buffer information now"));
+	emsg(_(e_not_allowed_to_change_buffer_information_now));
 	return TRUE;
     }
     return FALSE;
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -41,7 +41,6 @@ static char_u *check_for_cryptkey(char_u
 #endif
 static linenr_T readfile_linenr(linenr_T linecnt, char_u *p, char_u *endp);
 static char_u *check_for_bom(char_u *p, long size, int *lenp, int flags);
-static char *e_auchangedbuf = N_("E812: Autocommands changed buffer or buffer name");
 
 #ifdef FEAT_EVAL
 static int readdirex_sort;
@@ -527,7 +526,7 @@ readfile(
 				|| (using_b_fname
 					 && (old_b_fname != curbuf->b_fname)))
 			{
-			    emsg(_(e_auchangedbuf));
+			    emsg(_(e_autocommands_changed_buffer_or_buffer_name));
 			    return FAIL;
 			}
 		    }
@@ -605,7 +604,7 @@ readfile(
 		|| (using_b_ffname && (old_b_ffname != curbuf->b_ffname))
 		|| (using_b_fname && (old_b_fname != curbuf->b_fname))))
 	{
-	    emsg(_(e_auchangedbuf));
+	    emsg(_(e_autocommands_changed_buffer_or_buffer_name));
 	    if (!read_buffer)
 		close(fd);
 	    return FAIL;
@@ -3012,7 +3011,7 @@ set_rw_fname(char_u *fname, char_u *sfna
     if (curbuf != buf)
     {
 	// We are in another buffer now, don't do the renaming.
-	emsg(_(e_auchangedbuf));
+	emsg(_(e_autocommands_changed_buffer_or_buffer_name));
 	return FAIL;
     }
 
--- a/src/findfile.c
+++ b/src/findfile.c
@@ -206,8 +206,6 @@ static ff_stack_T *ff_create_stack_eleme
 static int ff_path_in_stoplist(char_u *, int, char_u **);
 #endif
 
-static char_u e_pathtoolong[] = N_("E854: path too long for completion");
-
 static char_u	*ff_expand_buffer = NULL; // used for expanding filenames
 
 #if 0
@@ -501,7 +499,7 @@ vim_findfile_init(
 	{
 	    if (len + 5 >= MAXPATHL)
 	    {
-		emsg(_(e_pathtoolong));
+		emsg(_(e_path_too_long_for_completion));
 		break;
 	    }
 	    if (STRNCMP(wc_part, "**", 2) == 0)
@@ -551,7 +549,7 @@ vim_findfile_init(
     if (STRLEN(search_ctx->ffsc_start_dir)
 			  + STRLEN(search_ctx->ffsc_fix_path) + 3 >= MAXPATHL)
     {
-	emsg(_(e_pathtoolong));
+	emsg(_(e_path_too_long_for_completion));
 	goto error_return;
     }
     STRCPY(ff_expand_buffer, search_ctx->ffsc_start_dir);
--- a/src/float.c
+++ b/src/float.c
@@ -99,7 +99,7 @@ get_float_arg(typval_T *argvars, float_T
 	*f = (float_T)argvars[0].vval.v_number;
 	return OK;
     }
-    emsg(_("E808: Number or Float required"));
+    emsg(_(e_number_or_float_required));
     return FAIL;
 }
 
--- a/src/gui.c
+++ b/src/gui.c
@@ -241,7 +241,7 @@ gui_do_fork(void)
     pid = fork();
     if (pid < 0)	    // Fork error
     {
-	emsg(_("E851: Failed to create a new process for the GUI"));
+	emsg(_(e_failed_to_create_new_process_for_GUI));
 	return;
     }
     else if (pid > 0)	    // Parent
@@ -265,7 +265,7 @@ gui_do_fork(void)
 # else
 		waitpid(pid, &exit_status, 0);
 # endif
-		emsg(_("E852: The child process failed to start the GUI"));
+		emsg(_(e_the_child_process_failed_to_start_GUI));
 		return;
 	    }
 	    else if (status == GUI_CHILD_IO_ERROR)
--- a/src/highlight.c
+++ b/src/highlight.c
@@ -3466,7 +3466,7 @@ syn_add_group(char_u *name)
 
     if (highlight_ga.ga_len >= MAX_HL_ID)
     {
-	emsg(_("E849: Too many highlight and syntax groups"));
+	emsg(_(e_too_many_highlight_and_syntax_groups));
 	vim_free(name);
 	return 0;
     }
--- a/src/if_mzsch.c
+++ b/src/if_mzsch.c
@@ -1242,7 +1242,7 @@ mzscheme_init(void)
 #ifdef DYNAMIC_MZSCHEME
 	if (disabled || !mzscheme_enabled(TRUE))
 	{
-	    emsg(_("E815: Sorry, this command is disabled, the MzScheme libraries could not be loaded."));
+	    emsg(_(e_sorry_this_command_is_disabled_the_mzscheme_libraries_could_not_be_loaded));
 	    return -1;
 	}
 #endif
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -5850,13 +5850,13 @@ run_eval(const char *cmd, typval_T *rett
 	{
 	    if (PyErr_Occurred() && !msg_silent)
 		PyErr_PrintEx(0);
-	    emsg(_("E858: Eval did not return a valid python object"));
+	    emsg(_(e_eval_did_not_return_valid_python_object));
 	}
     }
     else
     {
 	if (ConvertFromPyObject(run_ret, rettv) == -1)
-	    emsg(_("E859: Failed to convert returned python object to a Vim value"));
+	    emsg(_(e_failed_to_convert_returned_python_object_to_vim_value));
 	Py_DECREF(run_ret);
     }
     PyErr_Clear();
--- a/src/if_python.c
+++ b/src/if_python.c
@@ -679,7 +679,7 @@ python_runtime_link_init(char *libname, 
     if (python3_loaded())
     {
 	if (verbose)
-	    emsg(_("E836: This Vim cannot execute :python after using :py3"));
+	    emsg(_(e_this_vim_cannot_execute_python_after_using_py3));
 	return FAIL;
     }
 # endif
--- a/src/if_python3.c
+++ b/src/if_python3.c
@@ -771,7 +771,7 @@ py3_runtime_link_init(char *libname, int
     if (python_loaded())
     {
 	if (verbose)
-	    emsg(_("E837: This Vim cannot execute :py3 after using :python"));
+	    emsg(_(e_this_vim_cannot_execute_py3_after_using_python));
 	return FAIL;
     }
 # endif
--- a/src/insexpand.c
+++ b/src/insexpand.c
@@ -124,9 +124,6 @@ struct compl_S
 # define CP_FAST	    32	// use fast_breakcheck instead of ui_breakcheck
 
 static char e_hitend[] = N_("Hit end of paragraph");
-# ifdef FEAT_COMPL_FUNC
-static char e_compldel[] = N_("E840: Completion function deleted text");
-# endif
 
 /*
  * All the current matches are stored in a list.
@@ -2670,7 +2667,7 @@ expand_by_function(int type, char_u *bas
     validate_cursor();
     if (!EQUAL_POS(curwin->w_cursor, pos))
     {
-	emsg(_(e_compldel));
+	emsg(_(e_complete_function_deleted_text));
 	goto theend;
     }
 
@@ -4506,7 +4503,7 @@ get_userdefined_compl_info(colnr_T curs_
     validate_cursor();
     if (!EQUAL_POS(curwin->w_cursor, pos))
     {
-	emsg(_(e_compldel));
+	emsg(_(e_complete_function_deleted_text));
 	return FAIL;
     }
 
--- a/src/match.c
+++ b/src/match.c
@@ -55,7 +55,7 @@ match_add(
 	{
 	    if (cur->id == id)
 	    {
-		semsg(_("E801: ID already taken: %d"), id);
+		semsg(_(e_id_already_taken_nr), id);
 		return -1;
 	    }
 	    cur = cur->next;
@@ -233,8 +233,7 @@ match_delete(win_T *wp, int id, int perr
     if (id < 1)
     {
 	if (perr == TRUE)
-	    semsg(_("E802: Invalid ID: %d (must be greater than or equal to 1)"),
-									  id);
+	    semsg(_(e_invalid_id_nr_must_be_greater_than_or_equal_to_one), id);
 	return -1;
     }
     while (cur != NULL && cur->id != id)
@@ -245,7 +244,7 @@ match_delete(win_T *wp, int id, int perr
     if (cur == NULL)
     {
 	if (perr == TRUE)
-	    semsg(_("E803: ID not found: %d"), id);
+	    semsg(_(e_id_not_found_nr), id);
 	return -1;
     }
     if (cur == prev)
--- a/src/memline.c
+++ b/src/memline.c
@@ -621,7 +621,7 @@ ml_set_crypt_key(
 	    mf_put(mfp, hp, FALSE, FALSE);  // release previous block
 
 	if (error > 0)
-	    emsg(_("E843: Error while updating swap file crypt"));
+	    emsg(_(e_error_while_updating_swap_file_crypt));
     }
 
     mfp->mf_old_key = NULL;
@@ -1342,7 +1342,7 @@ ml_recover(int checkext)
 #else
     if (b0p->b0_id[1] != BLOCK0_ID1)
     {
-	semsg(_("E833: %s is encrypted and this version of Vim does not support encryption"), mfp->mf_fname);
+	semsg(_(e_str_is_encrypted_and_this_version_of_vim_does_not_support_encryption), mfp->mf_fname);
 	goto theend;
     }
 #endif
--- a/src/option.c
+++ b/src/option.c
@@ -1558,7 +1558,7 @@ do_set(
 		    p = find_termcode(key_name);
 		    if (p == NULL)
 		    {
-			errmsg = N_("E846: Key code not set");
+			errmsg = N_(e_key_code_not_set);
 			goto skip;
 		    }
 		    else
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -1883,7 +1883,7 @@ popup_create(typval_T *argvars, typval_T
 #ifdef FEAT_TERMINAL
 	    if (buf->b_term != NULL && popup_terminal_exists())
 	    {
-		emsg(_("E861: Cannot open a second popup with a terminal"));
+		emsg(_(e_cannot_open_second_popup_with_terminal));
 		return NULL;
 	    }
 #endif
@@ -3162,7 +3162,7 @@ error_if_term_popup_window()
     if (WIN_IS_POPUP(curwin) && curbuf->b_term != NULL
 					   && term_job_running(curbuf->b_term))
     {
-	emsg(_("E863: Not allowed for a terminal in a popup window"));
+	emsg(_(e_not_allowed_for_terminal_in_popup_window));
 	return TRUE;
     }
     return FALSE;
--- a/src/regexp.c
+++ b/src/regexp.c
@@ -2638,7 +2638,7 @@ vim_regcomp(char_u *expr_arg, int re_fla
 	}
 	else
 	{
-	    emsg(_("E864: \\%#= can only be followed by 0, 1, or 2. The automatic engine will be used "));
+	    emsg(_(e_percent_hash_can_only_be_followed_by_zero_one_two_automatic_engine_will_be_used));
 	    regexp_engine = AUTOMATIC_ENGINE;
 	}
     }
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -243,11 +243,6 @@ static int nfa_classcodes[] = {
     NFA_UPPER, NFA_NUPPER
 };
 
-static char_u e_nul_found[] = N_("E865: (NFA) Regexp end encountered prematurely");
-static char_u e_misplaced[] = N_("E866: (NFA regexp) Misplaced %c");
-static char_u e_ill_char_class[] = N_("E877: (NFA regexp) Invalid character class: %d");
-static char_u e_value_too_large[] = N_("E951: \\% value too large");
-
 // Variables only used in nfa_regcomp() and descendants.
 static int nfa_re_flags; // re_flags passed to nfa_regcomp()
 static int *post_start;  // holds the postfix form of r.e.
@@ -1377,7 +1372,7 @@ nfa_regatom(void)
     switch (c)
     {
 	case NUL:
-	    EMSG_RET_FAIL(_(e_nul_found));
+	    EMSG_RET_FAIL(_(e_nfa_regexp_end_encountered_prematurely));
 
 	case Magic('^'):
 	    EMIT(NFA_BOL);
@@ -1401,7 +1396,7 @@ nfa_regatom(void)
 	case Magic('_'):
 	    c = no_Magic(getchr());
 	    if (c == NUL)
-		EMSG_RET_FAIL(_(e_nul_found));
+		EMSG_RET_FAIL(_(e_nfa_regexp_end_encountered_prematurely));
 
 	    if (c == '^')	// "\_^" is start-of-line
 	    {
@@ -1461,7 +1456,7 @@ nfa_regatom(void)
 	    {
 		if (extra == NFA_ADD_NL)
 		{
-		    semsg(_(e_ill_char_class), c);
+		    semsg(_(e_nfa_regexp_invalid_character_class_nr), c);
 		    rc_did_emsg = TRUE;
 		    return FAIL;
 		}
@@ -1506,7 +1501,7 @@ nfa_regatom(void)
 	case Magic('|'):
 	case Magic('&'):
 	case Magic(')'):
-	    semsg(_(e_misplaced), no_Magic(c));
+	    semsg(_(e_nfa_regexp_misplaced_chr), no_Magic(c));
 	    return FAIL;
 
 	case Magic('='):
@@ -1516,7 +1511,7 @@ nfa_regatom(void)
 	case Magic('*'):
 	case Magic('{'):
 	    // these should follow an atom, not form an atom
-	    semsg(_(e_misplaced), no_Magic(c));
+	    semsg(_(e_nfa_regexp_misplaced_chr), no_Magic(c));
 	    return FAIL;
 
 	case Magic('~'):
@@ -1602,8 +1597,7 @@ nfa_regatom(void)
 		    break;
 #endif
 		default:
-		    semsg(_("E867: (NFA) Unknown operator '\\z%c'"),
-								 no_Magic(c));
+		    semsg(_(e_nfa_unknown_operator_z_chr), no_Magic(c));
 		    return FAIL;
 	    }
 	    break;
@@ -1725,7 +1719,7 @@ nfa_regatom(void)
 			    if (tmp < n)
 			    {
 				// overflow.
-				emsg(_(e_value_too_large));
+				emsg(_(e_percent_value_too_large));
 				return FAIL;
 			    }
 			    n = tmp;
@@ -1773,7 +1767,7 @@ nfa_regatom(void)
 			    }
 			    if (n >= limit)
 			    {
-				emsg(_(e_value_too_large));
+				emsg(_(e_percent_value_too_large));
 				return FAIL;
 			    }
 			    EMIT((int)n);
@@ -1788,8 +1782,7 @@ nfa_regatom(void)
 			    break;
 			}
 		    }
-		    semsg(_("E867: (NFA) Unknown operator '\\%%%c'"),
-								 no_Magic(c));
+		    semsg(_(e_nfa_unknown_operator_percent_chr), no_Magic(c));
 		    return FAIL;
 	    }
 	    break;
@@ -1947,7 +1940,7 @@ collection:
 			    if (result == FAIL)
 			    {
 				// should never happen
-				EMSG_RET_FAIL(_("E868: Error building NFA with equivalence class!"));
+				EMSG_RET_FAIL(_(e_error_building_nfa_with_equivalence_class));
 			    }
 			    continue;
 			}
@@ -2273,7 +2266,7 @@ nfa_regpiece(void)
 	    }
 	    if (i == 0)
 	    {
-		semsg(_("E869: (NFA) Unknown operator '\\@%c'"), op);
+		semsg(_(e_nfa_unknown_operator_at_chr), op);
 		return FAIL;
 	    }
 	    EMIT(i);
@@ -5125,7 +5118,7 @@ check_char_class(int class, int c)
 
 	default:
 	    // should not be here :P
-	    siemsg(_(e_ill_char_class), class);
+	    siemsg(_(e_nfa_regexp_invalid_character_class_nr), class);
 	    return FAIL;
     }
     return FAIL;
--- a/src/spellfile.c
+++ b/src/spellfile.c
@@ -4307,7 +4307,7 @@ getroom(
 	{
 	    if (!spin->si_did_emsg)
 	    {
-		emsg(_("E845: Insufficient memory, word list will be incomplete"));
+		emsg(_(e_insufficient_memory_word_list_will_be_incomplete));
 		spin->si_did_emsg = TRUE;
 	    }
 	    return NULL;
--- a/src/strings.c
+++ b/src/strings.c
@@ -1934,7 +1934,7 @@ tv_float(typval_T *tvs, int *idxp)
 	else if (tvs[idx].v_type == VAR_NUMBER)
 	    f = (double)tvs[idx].vval.v_number;
 	else
-	    emsg(_("E807: Expected Float argument for printf()"));
+	    emsg(_(e_expected_float_argument_for_printf));
     }
     return f;
 }
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -4635,7 +4635,7 @@ get_syn_options(
 #ifdef FEAT_CONCEAL
 	    if (!vim_isprintc_strict(*conceal_char))
 	    {
-		emsg(_("E844: invalid cchar value"));
+		emsg(_(e_invalid_cchar_value));
 		return NULL;
 	    }
 #endif
@@ -4785,7 +4785,7 @@ syn_cmd_include(exarg_T *eap, int syncin
      */
     if (running_syn_inc_tag >= MAX_SYN_INC_TAG)
     {
-	emsg(_("E847: Too many syntax includes"));
+	emsg(_(e_too_many_syntax_includes));
 	return;
     }
     prev_syn_inc_tag = current_syn_inc_tag;
@@ -5522,7 +5522,7 @@ syn_add_cluster(char_u *name)
     len = curwin->w_s->b_syn_clusters.ga_len;
     if (len >= MAX_CLUSTER_ID)
     {
-	emsg(_("E848: Too many syntax clusters"));
+	emsg(_(e_too_many_syntax_clusters));
 	vim_free(name);
 	return 0;
     }
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -801,7 +801,7 @@ f_prop_find(typval_T *argvars, typval_T 
     }
     if (both && (!id_found || type_id == -1))
     {
-	emsg(_("E860: Need 'id' and 'type' with 'both'"));
+	emsg(_(e_need_id_and_type_with_both));
 	return;
     }
 
@@ -1224,7 +1224,7 @@ f_prop_remove(typval_T *argvars, typval_
     }
     if (both && (id == -1 || type_id == -1))
     {
-	emsg(_("E860: Need 'id' and 'type' with 'both'"));
+	emsg(_(e_need_id_and_type_with_both));
 	return;
     }
 
--- a/src/typval.c
+++ b/src/typval.c
@@ -191,7 +191,7 @@ tv_get_bool_or_number_chk(typval_T *varp
 	    return varp->vval.v_number;
 	case VAR_FLOAT:
 #ifdef FEAT_FLOAT
-	    emsg(_("E805: Using a Float as a Number"));
+	    emsg(_(e_using_float_as_number));
 	    break;
 #endif
 	case VAR_FUNC:
--- a/src/undo.c
+++ b/src/undo.c
@@ -784,8 +784,6 @@ nomem:
 // extra fields for uhp
 # define UHP_SAVE_NR		1
 
-static char_u e_not_open[] = N_("E828: Cannot open undo file for writing: %s");
-
 /*
  * Compute the hash for the current buffer text into hash[UNDO_HASH_SIZE].
  */
@@ -898,7 +896,7 @@ u_get_undo_file_name(char_u *buf_ffname,
     static void
 corruption_error(char *mesg, char_u *file_name)
 {
-    semsg(_("E825: Corrupted undo file (%s): %s"), mesg, file_name);
+    semsg(_(e_corrupted_undo_file_str_str), mesg, file_name);
 }
 
     static void
@@ -1680,7 +1678,7 @@ u_write_undo(
 			    O_CREAT|O_EXTRA|O_WRONLY|O_EXCL|O_NOFOLLOW, perm);
     if (fd < 0)
     {
-	semsg(_(e_not_open), file_name);
+	semsg(_(e_cannot_open_undo_file_for_writing_str), file_name);
 	goto theend;
     }
     (void)mch_setperm(file_name, perm);
@@ -1719,7 +1717,7 @@ u_write_undo(
     fp = fdopen(fd, "w");
     if (fp == NULL)
     {
-	semsg(_(e_not_open), file_name);
+	semsg(_(e_cannot_open_undo_file_for_writing_str), file_name);
 	close(fd);
 	mch_remove(file_name);
 	goto theend;
@@ -1792,7 +1790,7 @@ u_write_undo(
 write_error:
     fclose(fp);
     if (!write_ok)
-	semsg(_("E829: write error in undo file: %s"), file_name);
+	semsg(_(e_write_error_in_undo_file_str), file_name);
 
 #if defined(MSWIN)
     // Copy file attributes; for systems where this can only be done after
@@ -1904,7 +1902,7 @@ u_read_undo(char_u *name, char_u *hash, 
     if (fp == NULL)
     {
 	if (name != NULL || p_verbose > 0)
-	    semsg(_("E822: Cannot open undo file for reading: %s"), file_name);
+	    semsg(_(e_cannot_open_undo_file_for_reading_str), file_name);
 	goto error;
     }
     bi.bi_buf = curbuf;
@@ -1916,7 +1914,7 @@ u_read_undo(char_u *name, char_u *hash, 
     if (fread(magic_buf, UF_START_MAGIC_LEN, 1, fp) != 1
 		|| memcmp(magic_buf, UF_START_MAGIC, UF_START_MAGIC_LEN) != 0)
     {
-	semsg(_("E823: Not an undo file: %s"), file_name);
+	semsg(_(e_not_an_undo_file_str), file_name);
 	goto error;
     }
     version = get2c(fp);
@@ -1925,14 +1923,13 @@ u_read_undo(char_u *name, char_u *hash, 
 #ifdef FEAT_CRYPT
 	if (*curbuf->b_p_key == NUL)
 	{
-	    semsg(_("E832: Non-encrypted file has encrypted undo file: %s"),
-								   file_name);
+	    semsg(_(e_non_encrypted_file_has_encrypted_undo_file), file_name);
 	    goto error;
 	}
 	bi.bi_state = crypt_create_from_file(fp, curbuf->b_p_key);
 	if (bi.bi_state == NULL)
 	{
-	    semsg(_("E826: Undo file decryption failed: %s"), file_name);
+	    semsg(_(e_undo_file_decryption_failed), file_name);
 	    goto error;
 	}
 	if (crypt_whole_undofile(bi.bi_state->method_nr))
@@ -1948,13 +1945,13 @@ u_read_undo(char_u *name, char_u *hash, 
 	    bi.bi_used = 0;
 	}
 #else
-	semsg(_("E827: Undo file is encrypted: %s"), file_name);
+	semsg(_(e_undo_file_is_encrypted_str), file_name);
 	goto error;
 #endif
     }
     else if (version != UF_VERSION)
     {
-	semsg(_("E824: Incompatible undo file: %s"), file_name);
+	semsg(_(e_incompatible_undo_file_str), file_name);
 	goto error;
     }
 
@@ -2522,7 +2519,7 @@ undo_time(
 
 	if (absolute)
 	{
-	    semsg(_("E830: Undo number %ld not found"), step);
+	    semsg(_(e_undo_number_nr_not_found), step);
 	    return;
 	}
 
--- a/src/usercmd.c
+++ b/src/usercmd.c
@@ -1101,7 +1101,7 @@ ex_command(exarg_T *eap)
     else if ((name_len == 1 && *name == 'X')
 	  || (name_len <= 4
 		  && STRNCMP(name, "Next", name_len > 4 ? 4 : name_len) == 0))
-	emsg(_("E841: Reserved name, cannot be used for user defined command"));
+	emsg(_(e_reserved_name_cannot_be_used_for_user_defined_command));
     else if (compl > 0 && (argt & EX_EXTRA) == 0)
     {
 	// Some plugins rely on silently ignoring the mistake, only make this
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -109,7 +109,7 @@ one_function_arg(
 	    for (i = 0; i < newargs->ga_len; ++i)
 		if (STRCMP(((char_u **)(newargs->ga_data))[i], arg_copy) == 0)
 		{
-		    semsg(_("E853: Duplicate argument name: %s"), arg_copy);
+		    semsg(_(e_duplicate_argument_name_str), arg_copy);
 		    vim_free(arg_copy);
 		    return arg;
 		}
@@ -4268,7 +4268,7 @@ define_function(exarg_T *eap, char_u *na
 	// Disallow using the g: dict.
 	if (fudi.fd_dict != NULL && fudi.fd_dict->dv_scope == VAR_DEF_SCOPE)
 	{
-	    emsg(_("E862: Cannot use g: here"));
+	    emsg(_(e_cannot_use_g_here));
 	    goto ret_free;
 	}
     }
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    4010,
+/**/
     4009,
 /**/
     4008,
--- a/src/window.c
+++ b/src/window.c
@@ -2501,7 +2501,7 @@ win_close(win_T *win, int free_buf)
     }
     if ((firstwin == aucmd_win || lastwin == aucmd_win) && one_window())
     {
-	emsg(_("E814: Cannot close window, only autocmd window would remain"));
+	emsg(_(e_cannot_close_window_only_autocmd_window_would_remain));
 	return FAIL;
     }