changeset 26958:d92e0d85923f v8.2.4008

patch 8.2.4008: error messages are spread out Commit: https://github.com/vim/vim/commit/677658ae49de31fe2e5b1fa6d93fdfab85a4362e Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jan 5 16:09:06 2022 +0000 patch 8.2.4008: 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 17:15:05 +0100
parents e5b81e2bed22
children 11d386c0c8f4
files src/diff.c src/digraph.c src/errors.h src/evalfunc.c src/evalvars.c src/ex_cmds.c src/ex_docmd.c src/ex_getln.c src/insexpand.c src/match.c src/memline.c src/menu.c src/ops.c src/profiler.c src/quickfix.c src/regexp.c src/regexp_bt.c src/regexp_nfa.c src/register.c src/spell.c src/spell.h src/spellfile.c src/strings.c src/syntax.c src/typval.c src/undo.c src/userfunc.c src/version.c
diffstat 28 files changed, 187 insertions(+), 76 deletions(-) [+]
line wrap: on
line diff
--- a/src/diff.c
+++ b/src/diff.c
@@ -2682,7 +2682,7 @@ ex_diffgetput(exarg_T *eap)
 	if (idx_other == DB_COUNT)
 	{
 	    if (found_not_ma)
-		emsg(_("E793: No other buffer in diff mode is modifiable"));
+		emsg(_(e_no_other_buffer_in_diff_mode_is_modifiable));
 	    else
 		emsg(_(e_no_other_buffer_in_diff_mode));
 	    return;
@@ -2769,7 +2769,7 @@ ex_diffgetput(exarg_T *eap)
 	change_warning(0);
 	if (diff_buf_idx(curbuf) != idx_to)
 	{
-	    emsg(_("E787: Buffer changed unexpectedly"));
+	    emsg(_(e_buffer_changed_unexpectedly));
 	    goto theend;
 	}
     }
--- a/src/digraph.c
+++ b/src/digraph.c
@@ -2661,7 +2661,7 @@ ex_loadkeymap(exarg_T *eap)
 		    || *kp->from == NUL || *kp->to == NUL)
 	    {
 		if (kp->to != NULL && *kp->to == NUL)
-		    emsg(_("E791: Empty keymap entry"));
+		    emsg(_(e_empty_keymap_entry));
 		vim_free(kp->from);
 		vim_free(kp->to);
 	    }
--- a/src/errors.h
+++ b/src/errors.h
@@ -1719,25 +1719,129 @@ EXTERN char e_cannot_change_value[]
 	INIT(= N_("E742: Cannot change value"));
 EXTERN char e_cannot_change_value_of_str[]
 	INIT(= N_("E742: Cannot change value of %s"));
+EXTERN char e_variable_nested_too_deep_for_unlock[]
+	INIT(= N_("E743: variable nested too deep for (un)lock"));
 #endif
 #ifdef FEAT_NETBEANS_INTG
 EXTERN char e_netbeans_does_not_allow_changes_in_read_only_files[]
 	INIT(= N_("E744: NetBeans does not allow changes in read-only files"));
 #endif
+#ifdef FEAT_EVAL
+EXTERN char e_using_list_as_number[]
+	INIT(= N_("E745: Using a List as a Number"));
+EXTERN char e_function_name_does_not_match_script_file_name_str[]
+	INIT(= N_("E746: Function name does not match script file name: %s"));
+#endif
+EXTERN char e_cannot_change_directory_buffer_is_modified_add_bang_to_override[]
+	INIT(= N_("E747: Cannot change directory, buffer is modified (add ! to override)"));
+EXTERN char e_no_previously_used_register[]
+	INIT(= N_("E748: No previously used register"));
 EXTERN char e_empty_buffer[]
 	INIT(= N_("E749: empty buffer"));
+#ifdef FEAT_PROFILE
+EXTERN char e_first_use_profile_start_fname[]
+	INIT(= N_("E750: First use \":profile start {fname}\""));
+#endif
 #ifdef FEAT_SPELL
+EXTERN char e_output_file_name_must_not_have_region_name[]
+	INIT(= N_("E751: Output file name must not have region name"));
+EXTERN char e_no_previous_spell_replacement[]
+	INIT(= N_("E752: No previous spell replacement"));
+EXTERN char e_not_found_str[]
+	INIT(= N_("E753: Not found: %s"));
+EXTERN char e_only_up_to_nr_regions_supported[]
+	INIT(= N_("E754: Only up to %d regions supported"));
+EXTERN char e_invalid_region_in_str[]
+	INIT(= N_("E755: Invalid region in %s"));
 EXTERN char e_spell_checking_is_not_possible[]
 	INIT(= N_("E756: Spell checking is not possible"));
-#endif
+EXTERN char e_this_does_not_look_like_spell_file[]
+	INIT(= N_("E757: This does not look like a spell file"));
+EXTERN char e_truncated_spell_file[]
+	INIT(= N_("E758: Truncated spell file"));
+EXTERN char e_format_error_in_spell_file[]
+	INIT(= N_("E759: Format error in spell file"));
+EXTERN char e_no_word_count_in_str[]
+	INIT(= N_("E760: No word count in %s"));
+EXTERN char e_format_error_in_affix_file_fol_low_or_upp[]
+	INIT(= N_("E761: Format error in affix file FOL, LOW or UPP"));
+EXTERN char e_character_in_fol_low_or_upp_is_out_of_range[]
+	INIT(= N_("E762: Character in FOL, LOW or UPP is out of range"));
+EXTERN char e_word_characters_differ_between_spell_files[]
+	INIT(= N_("E763: Word characters differ between spell files"));
 #if defined(FEAT_SYN_HL) || defined(FEAT_COMPL_FUNC)
 EXTERN char e_option_str_is_not_set[]
 	INIT(= N_("E764: Option '%s' is not set"));
 #endif
+EXTERN char e_spellfile_does_not_have_nr_entries[]
+	INIT(= N_("E765: 'spellfile' does not have %d entries"));
+#endif
+EXTERN char e_insufficient_arguments_for_printf[]
+	INIT(= N_("E766: Insufficient arguments for printf()"));
+EXTERN char e_too_many_arguments_to_printf[]
+	INIT(= N_("E767: Too many arguments for printf()"));
+EXTERN char e_swap_file_exists_str_silent_overrides[]
+	INIT(= N_("E768: Swap file exists: %s (:silent! overrides)"));
+EXTERN char e_missing_rsb_after_str_lsb[]
+	INIT(= N_("E769: Missing ] after %s["));
+#ifdef FEAT_SPELL
+EXTERN char e_unsupported_section_in_spell_file[]
+	INIT(= N_("E770: Unsupported section in spell file"));
+EXTERN char e_old_spell_file_needs_to_be_updated[]
+	INIT(= N_("E771: Old spell file, needs to be updated"));
+EXTERN char e_spell_file_is_for_newer_version_of_vim[]
+	INIT(= N_("E772: Spell file is for newer version of Vim"));
+#endif
+EXTERN char e_symlink_loop_for_str[]
+	INIT(= N_("E773: Symlink loop for \"%s\""));
+EXTERN char e_operatorfunc_is_empty[]
+	INIT(= N_("E774: 'operatorfunc' is empty"));
+#ifndef FEAT_EVAL
+EXTERN char e_eval_feature_not_available[]
+	INIT(= N_("E775: Eval feature not available"));
+#endif
 #ifdef FEAT_QUICKFIX
 EXTERN char e_no_location_list[]
 	INIT(= N_("E776: No location list"));
 #endif
+EXTERN char e_string_or_list_expected[]
+	INIT(= N_("E777: String or List expected"));
+#ifdef FEAT_SPELL
+EXTERN char e_this_does_not_look_like_sug_file_str[]
+	INIT(= N_("E778: This does not look like a .sug file: %s"));
+EXTERN char e_old_sug_file_needs_to_be_updated_str[]
+	INIT(= N_("E779: Old .sug file, needs to be updated: %s"));
+EXTERN char e_sug_file_is_for_newer_version_of_vim_str[]
+	INIT(= N_("E780: .sug file is for newer version of Vim: %s"));
+EXTERN char e_sug_file_doesnt_match_spl_file_str[]
+	INIT(= N_("E781: .sug file doesn't match .spl file: %s"));
+EXTERN char e_error_while_reading_sug_file_str[]
+	INIT(= N_("E782: error while reading .sug file: %s"));
+EXTERN char e_duplicate_char_in_map_entry[]
+	INIT(= N_("E783: duplicate char in MAP entry"));
+#endif
+EXTERN char e_cannot_close_last_tab_page[]
+	INIT(= N_("E784: Cannot close last tab page"));
+EXTERN char e_complete_can_only_be_used_in_insert_mode[]
+	INIT(= N_("E785: complete() can only be used in Insert mode"));
+EXTERN char e_range_not_allowed[]
+	INIT(= N_("E786: Range not allowed"));
+EXTERN char e_buffer_changed_unexpectedly[]
+	INIT(= N_("E787: Buffer changed unexpectedly"));
+EXTERN char e_not_allowed_to_edit_another_buffer_now[]
+	INIT(= N_("E788: Not allowed to edit another buffer now"));
+EXTERN char e_error_missing_rsb_str[]
+	INIT(= N_("E789: Missing ']': %s"));
+EXTERN char e_undojoin_is_not_allowed_after_undo[]
+	INIT(= N_("E790: undojoin is not allowed after undo"));
+EXTERN char e_empty_keymap_entry[]
+	INIT(= N_("E791: Empty keymap entry"));
+EXTERN char e_empty_menu_name[]
+	INIT(= N_("E792: Empty menu name"));
+#ifdef FEAT_DIFF
+EXTERN char e_no_other_buffer_in_diff_mode_is_modifiable[]
+	INIT(= N_("E793: No other buffer in diff mode is modifiable"));
+#endif
 #ifdef FEAT_EVAL
 EXTERN char e_cannot_set_variable_in_sandbox[]
 	INIT(= N_("E794: Cannot set variable in the sandbox"));
@@ -1745,21 +1849,30 @@ EXTERN char e_cannot_set_variable_in_san
 	INIT(= N_("E794: Cannot set variable in the sandbox: \"%s\""));
 EXTERN char e_cannot_delete_variable[]
 	INIT(= N_("E795: Cannot delete variable"));
+EXTERN char e_cannot_delete_variable_str[]
+	INIT(= N_("E795: Cannot delete variable %s"));
 	// E796
 EXTERN char e_writing_to_device_disabled_with_opendevice_option[]
 	INIT(= N_("writing to device disabled with 'opendevice' option"));
-EXTERN char e_cannot_delete_variable_str[]
-	INIT(= N_("E795: Cannot delete variable %s"));
+#endif
+#ifdef FEAT_SPELL
+EXTERN char e_spellfilemising_autocommand_deleted_buffer[]
+	INIT(= N_("E797: SpellFileMissing autocommand deleted buffer"));
 #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)"));
 #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
+
 #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_string[]
 	INIT(= N_("E806: using Float as a String"));
@@ -1838,6 +1951,11 @@ EXTERN char e_positive_count_required[]
 EXTERN char e_cannot_lock_or_unlock_variable_str[]
 	INIT(= N_("E940: Cannot lock or unlock variable %s"));
 #endif
+EXTERN char e_reverse_range_in_character_class[]
+	INIT(= N_("E944: Reverse range in character class"));
+EXTERN char e_range_too_large_in_character_class[]
+	INIT(= N_("E945: Range too large in character class"));
+
 #ifdef FEAT_TERMINAL
 EXTERN char e_job_still_running[]
 	INIT(= N_("E948: Job still running"));
@@ -1848,6 +1966,8 @@ EXTERN char e_file_changed_while_writing
 	INIT(= N_("E949: File changed while writing"));
 EXTERN char e_autocommand_caused_recursive_behavior[]
 	INIT(= N_("E952: Autocommand caused recursive behavior"));
+EXTERN char e_cannot_use_pattern_recursively[]
+	INIT(= N_("E956: Cannot use pattern recursively"));
 EXTERN char e_invalid_window_number[]
 	INIT(= N_("E957: Invalid window number"));
 EXTERN char_u e_invalid_column_number_nr[]
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -6715,7 +6715,7 @@ f_islocked(typval_T *argvars, typval_T *
 		}
 	    }
 	    else if (lv.ll_range)
-		emsg(_("E786: Range not allowed"));
+		emsg(_(e_range_not_allowed));
 	    else if (lv.ll_newkey != NULL)
 		semsg(_(e_key_not_present_in_dictionary), lv.ll_newkey);
 	    else if (lv.ll_list != NULL)
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -1968,7 +1968,7 @@ item_lock(typval_T *tv, int deep, int lo
 
     if (recurse >= DICT_MAXNEST)
     {
-	emsg(_("E743: variable nested too deep for (un)lock"));
+	emsg(_(e_variable_nested_too_deep_for_unlock));
 	return;
     }
     if (deep == 0)
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -2194,8 +2194,7 @@ check_overwrite(
 		else
 #endif
 		{
-		    semsg(_("E768: Swap file exists: %s (:silent! overrides)"),
-								    swapname);
+		    semsg(_(e_swap_file_exists_str_silent_overrides), swapname);
 		    vim_free(swapname);
 		    return FAIL;
 		}
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -6023,7 +6023,7 @@ ex_tabclose(exarg_T *eap)
     else
 # endif
 	if (first_tabpage->tp_next == NULL)
-	    emsg(_("E784: Cannot close last tab page"));
+	    emsg(_(e_cannot_close_last_tab_page));
 	else
 	{
 	    tab_number = get_tabpage_arg(eap);
@@ -7366,7 +7366,7 @@ changedir_func(
 
     if (vim_strchr(p_cpo, CPO_CHDIR) != NULL && curbufIsChanged() && !forceit)
     {
-	emsg(_("E747: Cannot change directory, buffer is modified (add ! to override)"));
+	emsg(_(e_cannot_change_directory_buffer_is_modified_add_bang_to_override));
 	return FALSE;
     }
 
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -2664,7 +2664,7 @@ curbuf_locked(void)
 {
     if (curbuf_lock > 0)
     {
-	emsg(_("E788: Not allowed to edit another buffer now"));
+	emsg(_(e_not_allowed_to_edit_another_buffer_now));
 	return TRUE;
     }
     return allbuf_locked();
--- a/src/insexpand.c
+++ b/src/insexpand.c
@@ -2864,7 +2864,7 @@ f_complete(typval_T *argvars, typval_T *
 
     if ((State & INSERT) == 0)
     {
-	emsg(_("E785: complete() can only be used in Insert mode"));
+	emsg(_(e_complete_can_only_be_used_in_insert_mode));
 	return;
     }
 
--- a/src/match.c
+++ b/src/match.c
@@ -45,8 +45,7 @@ match_add(
 	return -1;
     if (id < -1 || id == 0)
     {
-	semsg(_("E799: 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;
     }
     if (id != -1)
@@ -1216,7 +1215,7 @@ f_matchadd(typval_T *argvars UNUSED, typ
 	return;
     if (id >= 1 && id <= 3)
     {
-	semsg(_("E798: ID is reserved for \":match\": %d"), id);
+	semsg(_(e_id_is_reserved_for_match_nr), id);
 	return;
     }
 
@@ -1284,7 +1283,7 @@ f_matchaddpos(typval_T *argvars UNUSED, 
     // id == 3 is ok because matchaddpos() is supposed to substitute :3match
     if (id == 1 || id == 2)
     {
-	semsg(_("E798: ID is reserved for \":match\": %d"), id);
+	semsg(_(e_id_is_reserved_for_match_nr), id);
 	return;
     }
 
--- a/src/memline.c
+++ b/src/memline.c
@@ -4415,7 +4415,7 @@ resolve_symlink(char_u *fname, char_u *b
 	// Limit symlink depth to 100, catch recursive loops.
 	if (++depth == 100)
 	{
-	    semsg(_("E773: Symlink loop for \"%s\""), fname);
+	    semsg(_(e_symlink_loop_for_str), fname);
 	    return FAIL;
 	}
 
--- a/src/menu.c
+++ b/src/menu.c
@@ -512,7 +512,7 @@ add_menu_path(
 	if (*dname == NUL)
 	{
 	    // Only a mnemonic or accelerator is not valid.
-	    emsg(_("E792: Empty menu name"));
+	    emsg(_(e_empty_menu_name));
 	    goto erret;
 	}
 
--- a/src/ops.c
+++ b/src/ops.c
@@ -3381,7 +3381,7 @@ op_function(oparg_T *oap UNUSED)
     typval_T	rettv;
 
     if (*p_opfunc == NUL)
-	emsg(_("E774: 'operatorfunc' is empty"));
+	emsg(_(e_operatorfunc_is_empty));
     else
     {
 	// Set '[ and '] marks to text to be operated on.
@@ -3419,7 +3419,7 @@ op_function(oparg_T *oap UNUSED)
 	}
     }
 #else
-    emsg(_("E775: Eval feature not available"));
+    emsg(_(e_eval_feature_not_available));
 #endif
 }
 
--- a/src/profiler.c
+++ b/src/profiler.c
@@ -320,7 +320,7 @@ ex_profile(exarg_T *eap)
 	set_vim_var_nr(VV_PROFILING, 1L);
     }
     else if (do_profiling == PROF_NONE)
-	emsg(_("E750: First use \":profile start {fname}\""));
+	emsg(_(e_first_use_profile_start_fname));
     else if (STRCMP(eap->arg, "pause") == 0)
     {
 	if (do_profiling == PROF_YES)
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -7978,7 +7978,7 @@ cexpr_core(exarg_T *eap, typval_T *tv)
 	return OK;
     }
 
-    emsg(_("E777: String or List expected"));
+    emsg(_(e_string_or_list_expected));
     return FAIL;
 }
 
--- a/src/regexp.c
+++ b/src/regexp.c
@@ -71,11 +71,6 @@ toggle_Magic(int x)
 
 #define MAX_LIMIT	(32767L << 16L)
 
-static char_u e_missingbracket[] = N_("E769: Missing ] after %s[");
-static char_u e_reverse_range[] = N_("E944: Reverse range in character class");
-static char_u e_large_class[] = N_("E945: Range too large in character class");
-static char_u e_recursive[]  = N_("E956: Cannot use pattern recursively");
-
 #define NOT_MULTI	0
 #define MULTI_ONE	1
 #define MULTI_MULT	2
@@ -2779,7 +2774,7 @@ vim_regexec_string(
     // Cannot use the same prog recursively, it contains state.
     if (rmp->regprog->re_in_use)
     {
-	emsg(_(e_recursive));
+	emsg(_(e_cannot_use_pattern_recursively));
 	return FALSE;
     }
     rmp->regprog->re_in_use = TRUE;
@@ -2900,7 +2895,7 @@ vim_regexec_multi(
     // Cannot use the same prog recursively, it contains state.
     if (rmp->regprog->re_in_use)
     {
-	emsg(_(e_recursive));
+	emsg(_(e_cannot_use_pattern_recursively));
 	return FALSE;
     }
     rmp->regprog->re_in_use = TRUE;
--- a/src/regexp_bt.c
+++ b/src/regexp_bt.c
@@ -1782,13 +1782,13 @@ collection:
 				endc = coll_get_char();
 
 			    if (startc > endc)
-				EMSG_RET_NULL(_(e_reverse_range));
+				EMSG_RET_NULL(_(e_reverse_range_in_character_class));
 			    if (has_mbyte && ((*mb_char2len)(startc) > 1
 						 || (*mb_char2len)(endc) > 1))
 			    {
 				// Limit to a range of 256 chars.
 				if (endc > startc + 256)
-				    EMSG_RET_NULL(_(e_large_class));
+				    EMSG_RET_NULL(_(e_range_too_large_in_character_class));
 				while (++startc <= endc)
 				    regmbc(startc);
 			    }
@@ -2008,7 +2008,8 @@ collection:
 		break;
 	    }
 	    else if (reg_strict)
-		EMSG2_RET_NULL(_(e_missingbracket), reg_magic > MAGIC_OFF);
+		EMSG2_RET_NULL(_(e_missing_rsb_after_str_lsb),
+							reg_magic > MAGIC_OFF);
 	}
 	// FALLTHROUGH
 
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -2019,7 +2019,7 @@ collection:
 
 			startc = oldstartc;
 			if (startc > endc)
-			    EMSG_RET_FAIL(_(e_reverse_range));
+			    EMSG_RET_FAIL(_(e_reverse_range_in_character_class));
 
 			if (endc > startc + 2)
 			{
@@ -2128,7 +2128,7 @@ collection:
 	    } // if exists closing ]
 
 	    if (reg_strict)
-		EMSG_RET_FAIL(_(e_missingbracket));
+		EMSG_RET_FAIL(_(e_missing_rsb_after_str_lsb));
 	    // FALLTHROUGH
 
 	default:
--- a/src/register.c
+++ b/src/register.c
@@ -575,7 +575,7 @@ do_execreg(
     {
 	if (execreg_lastc == NUL)
 	{
-	    emsg(_("E748: No previously used register"));
+	    emsg(_(e_no_previously_used_register));
 	    return FAIL;
 	}
 	regname = execreg_lastc;
--- a/src/spell.c
+++ b/src/spell.c
@@ -478,7 +478,7 @@ find_word(matchinf_T *mip, int mode)
 	    if (endidxcnt == MAXWLEN)
 	    {
 		// Must be a corrupted spell file.
-		emsg(_(e_format));
+		emsg(_(e_format_error_in_spell_file));
 		return;
 	    }
 	    endlen[endidxcnt] = wlen;
@@ -2095,7 +2095,7 @@ did_set_spelllang(win_T *wp)
 		// destroying the buffer we are using...
 		if (!bufref_valid(&bufref))
 		{
-		    ret_msg = N_("E797: SpellFileMissing autocommand deleted buffer");
+		    ret_msg = N_(e_spellfilemising_autocommand_deleted_buffer);
 		    goto theend;
 		}
 	    }
@@ -2881,7 +2881,7 @@ ex_spellrepall(exarg_T *eap UNUSED)
 
     if (repl_from == NULL || repl_to == NULL)
     {
-	emsg(_("E752: No previous spell replacement"));
+	emsg(_(e_no_previous_spell_replacement));
 	return;
     }
     addlen = (int)(STRLEN(repl_to) - STRLEN(repl_from));
@@ -2931,7 +2931,7 @@ ex_spellrepall(exarg_T *eap UNUSED)
     vim_free(frompat);
 
     if (sub_nsubs == 0)
-	semsg(_("E753: Not found: %s"), repl_from);
+	semsg(_(e_not_found_str), repl_from);
     else
 	do_sub_msg(FALSE);
 }
--- a/src/spell.h
+++ b/src/spell.h
@@ -295,9 +295,6 @@ SPELL_EXTERN slang_T	*first_lang SPELL_I
 // file used for "zG" and "zW"
 SPELL_EXTERN char_u	*int_wordlist SPELL_INIT(= NULL);
 
-
-SPELL_EXTERN char e_format[] SPELL_INIT(= N_("E759: Format error in spell file"));
-
 SPELL_EXTERN spelltab_T   spelltab;
 SPELL_EXTERN int	  did_set_spelltab;
 
--- a/src/spellfile.c
+++ b/src/spellfile.c
@@ -322,11 +322,8 @@ static int set_spell_chartab(char_u *fol
 static void set_map_str(slang_T *lp, char_u *map);
 
 
-static char *e_spell_trunc = N_("E758: Truncated spell file");
 static char *e_afftrailing = N_("Trailing text in %s line %d: %s");
 static char *e_affname = N_("Affix name too long in %s line %d: %s");
-static char *e_affform = N_("E761: Format error in affix file FOL, LOW or UPP");
-static char *e_affrange = N_("E762: Character in FOL, LOW or UPP is out of range");
 static char *msg_compressing = N_("Compressing word tree...");
 
 /*
@@ -410,18 +407,18 @@ spell_load_file(
 	buf[i] = getc(fd);				// <fileID>
     if (STRNCMP(buf, VIMSPELLMAGIC, VIMSPELLMAGICL) != 0)
     {
-	emsg(_("E757: This does not look like a spell file"));
+	emsg(_(e_this_does_not_look_like_spell_file));
 	goto endFAIL;
     }
     c = getc(fd);					// <versionnr>
     if (c < VIMSPELLVERSION)
     {
-	emsg(_("E771: Old spell file, needs to be updated"));
+	emsg(_(e_old_spell_file_needs_to_be_updated));
 	goto endFAIL;
     }
     else if (c > VIMSPELLVERSION)
     {
-	emsg(_("E772: Spell file is for newer version of Vim"));
+	emsg(_(e_spell_file_is_for_newer_version_of_vim));
 	goto endFAIL;
     }
 
@@ -528,7 +525,7 @@ spell_load_file(
 		// message.  When it's not required skip the contents.
 		if (c & SNF_REQUIRED)
 		{
-		    emsg(_("E770: Unsupported section in spell file"));
+		    emsg(_(e_unsupported_section_in_spell_file));
 		    goto endFAIL;
 		}
 		while (--len >= 0)
@@ -539,13 +536,13 @@ spell_load_file(
 someerror:
 	if (res == SP_FORMERROR)
 	{
-	    emsg(_(e_format));
+	    emsg(_(e_format_error_in_spell_file));
 	    goto endFAIL;
 	}
 	if (res == SP_TRUNCERROR)
 	{
 truncerr:
-	    emsg(_(e_spell_trunc));
+	    emsg(_(e_truncated_spell_file));
 	    goto endFAIL;
 	}
 	if (res == SP_OTHERERROR)
@@ -706,20 +703,20 @@ suggest_load_files(void)
 		buf[i] = getc(fd);			// <fileID>
 	    if (STRNCMP(buf, VIMSUGMAGIC, VIMSUGMAGICL) != 0)
 	    {
-		semsg(_("E778: This does not look like a .sug file: %s"),
+		semsg(_(e_this_does_not_look_like_sug_file_str),
 							     slang->sl_fname);
 		goto nextone;
 	    }
 	    c = getc(fd);				// <versionnr>
 	    if (c < VIMSUGVERSION)
 	    {
-		semsg(_("E779: Old .sug file, needs to be updated: %s"),
+		semsg(_(e_old_sug_file_needs_to_be_updated_str),
 							     slang->sl_fname);
 		goto nextone;
 	    }
 	    else if (c > VIMSUGVERSION)
 	    {
-		semsg(_("E780: .sug file is for newer version of Vim: %s"),
+		semsg(_(e_sug_file_is_for_newer_version_of_vim_str),
 							     slang->sl_fname);
 		goto nextone;
 	    }
@@ -729,7 +726,7 @@ suggest_load_files(void)
 	    timestamp = get8ctime(fd);			// <timestamp>
 	    if (timestamp != slang->sl_sugtime)
 	    {
-		semsg(_("E781: .sug file doesn't match .spl file: %s"),
+		semsg(_(e_sug_file_doesnt_match_spl_file_str),
 							     slang->sl_fname);
 		goto nextone;
 	    }
@@ -742,7 +739,7 @@ suggest_load_files(void)
 							       FALSE, 0) != 0)
 	    {
 someerror:
-		semsg(_("E782: error while reading .sug file: %s"),
+		semsg(_(e_error_while_reading_sug_file_str),
 							     slang->sl_fname);
 		slang_clear_sug(slang);
 		goto nextone;
@@ -3536,7 +3533,7 @@ spell_read_dic(spellinfo_T *spin, char_u
 
     // Read and ignore the first line: word count.
     if (vim_fgets(line, MAXLINELEN, fd) || !vim_isdigit(*skipwhite(line)))
-	semsg(_("E760: No word count in %s"), fname);
+	semsg(_(e_no_word_count_in_str), fname);
 
     /*
      * Read all the lines in the file one by one.
@@ -5965,9 +5962,9 @@ mkspell(
     if (incount <= 0)
 	emsg(_(e_invalid_argument));	// need at least output and input names
     else if (vim_strchr(gettail(wfname), '_') != NULL)
-	emsg(_("E751: Output file name must not have region name"));
+	emsg(_(e_output_file_name_must_not_have_region_name));
     else if (incount > MAXREGIONS)
-	semsg(_("E754: Only up to %d regions supported"), MAXREGIONS);
+	semsg(_(e_only_up_to_nr_regions_supported), MAXREGIONS);
     else
     {
 	// Check for overwriting before doing things that may take a lot of
@@ -6001,7 +5998,7 @@ mkspell(
 		if (STRLEN(gettail(innames[i])) < 5
 						|| innames[i][len - 3] != '_')
 		{
-		    semsg(_("E755: Invalid region in %s"), innames[i]);
+		    semsg(_(e_invalid_region_in_str), innames[i]);
 		    goto theend;
 		}
 		spin.si_region_name[i * 2] = TOLOWER_ASC(innames[i][len - 2]);
@@ -6228,7 +6225,7 @@ spell_add_word(
 		break;
 	    if (*spf == NUL)
 	    {
-		semsg(_("E765: 'spellfile' does not have %d entries"), idx);
+		semsg(_(e_spellfile_does_not_have_nr_entries), idx);
 		vim_free(fnamebuf);
 		return;
 	    }
@@ -6445,7 +6442,7 @@ set_spell_chartab(char_u *fol, char_u *l
     {
 	if (*pl == NUL || *pu == NUL)
 	{
-	    emsg(_(e_affform));
+	    emsg(_(e_format_error_in_affix_file_fol_low_or_upp));
 	    return FAIL;
 	}
 	f = mb_ptr2char_adv(&pf);
@@ -6466,7 +6463,7 @@ set_spell_chartab(char_u *fol, char_u *l
 	{
 	    if (f >= 256)
 	    {
-		emsg(_(e_affrange));
+		emsg(_(e_character_in_fol_low_or_upp_is_out_of_range));
 		return FAIL;
 	    }
 	    new_st.st_fold[l] = f;
@@ -6479,7 +6476,7 @@ set_spell_chartab(char_u *fol, char_u *l
 	{
 	    if (f >= 256)
 	    {
-		emsg(_(e_affrange));
+		emsg(_(e_character_in_fol_low_or_upp_is_out_of_range));
 		return FAIL;
 	    }
 	    new_st.st_fold[u] = f;
@@ -6490,7 +6487,7 @@ set_spell_chartab(char_u *fol, char_u *l
 
     if (*pl != NUL || *pu != NUL)
     {
-	emsg(_(e_affform));
+	emsg(_(e_format_error_in_affix_file_fol_low_or_upp));
 	return FAIL;
     }
 
@@ -6550,7 +6547,7 @@ set_spell_finish(spelltab_T *new_st)
 		    || spelltab.st_fold[i] != new_st->st_fold[i]
 		    || spelltab.st_upper[i] != new_st->st_upper[i])
 	    {
-		emsg(_("E763: Word characters differ between spell files"));
+		emsg(_(e_word_characters_differ_between_spell_files));
 		return FAIL;
 	    }
 	}
@@ -6667,7 +6664,7 @@ set_map_str(slang_T *lp, char_u *map)
 		{
 		    // This should have been checked when generating the .spl
 		    // file.
-		    emsg(_("E783: duplicate char in MAP entry"));
+		    emsg(_(e_duplicate_char_in_map_entry));
 		    vim_free(b);
 		}
 	    }
--- a/src/strings.c
+++ b/src/strings.c
@@ -1862,7 +1862,7 @@ f_trim(typval_T *argvars, typval_T *rett
     rettv->vval.v_string = vim_strnsave(head, tail - head);
 }
 
-static char *e_printf = N_("E766: Insufficient arguments for printf()");
+static char *e_printf = N_(e_insufficient_arguments_for_printf);
 
 /*
  * Get number argument from "idxp" entry in "tvs".  First entry is 1.
@@ -2961,7 +2961,7 @@ vim_vsnprintf_typval(
     }
 
     if (tvs != NULL && tvs[arg_idx - 1].v_type != VAR_UNKNOWN)
-	emsg(_("E767: Too many arguments to printf()"));
+	emsg(_(e_too_many_arguments_to_printf));
 
     // Return the number of characters formatted (excluding trailing nul
     // character), that is, the number of characters that would have been
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -4882,7 +4882,7 @@ syn_cmd_keyword(exarg_T *eap, int syncin
 			    break;
 			if (p[1] == NUL)
 			{
-			    semsg(_("E789: Missing ']': %s"), kw);
+			    semsg(_(e_error_missing_rsb_str), kw);
 			    goto error;
 			}
 			if (p[1] == ']')
--- a/src/typval.c
+++ b/src/typval.c
@@ -209,7 +209,7 @@ tv_get_bool_or_number_chk(typval_T *varp
 					    STR2NR_ALL, &n, NULL, 0, FALSE);
 	    return n;
 	case VAR_LIST:
-	    emsg(_("E745: Using a List as a Number"));
+	    emsg(_(e_using_list_as_number));
 	    break;
 	case VAR_DICT:
 	    emsg(_(e_using_dictionary_as_number));
--- a/src/undo.c
+++ b/src/undo.c
@@ -3180,7 +3180,7 @@ ex_undojoin(exarg_T *eap UNUSED)
 	return;		    // nothing changed before
     if (curbuf->b_u_curhead != NULL)
     {
-	emsg(_("E790: undojoin is not allowed after undo"));
+	emsg(_(e_undojoin_is_not_allowed_after_undo));
 	return;
     }
     if (!curbuf->b_u_synced)
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -4524,7 +4524,8 @@ define_function(exarg_T *eap, char_u *na
 		linenr_T save_lnum = SOURCING_LNUM;
 
 		SOURCING_LNUM = sourcing_lnum_top;
-		semsg(_("E746: Function name does not match script file name: %s"), name);
+		semsg(_(e_function_name_does_not_match_script_file_name_str),
+									 name);
 		SOURCING_LNUM = save_lnum;
 		goto erret;
 	    }
--- 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 */
 /**/
+    4008,
+/**/
     4007,
 /**/
     4006,