changeset 26883:7f150a4936f2 v8.2.3970

patch 8.2.3970: error messages are spread out Commit: https://github.com/vim/vim/commit/74409f62790a93daf0965c71da01ff76aa0fa5a5 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jan 1 15:58:22 2022 +0000 patch 8.2.3970: error messages are spread out Problem: Error messages are spread out. Solution: Move more errors to errors.h.
author Bram Moolenaar <Bram@vim.org>
date Sat, 01 Jan 2022 17:00:04 +0100
parents 196f4d7e2a38
children 62ab6a14b597
files src/buffer.c src/bufwrite.c src/clientserver.c src/cmdhist.c src/dict.c src/edit.c src/errors.h src/eval.c src/evalfunc.c src/evalvars.c src/ex_cmds.c src/ex_docmd.c src/ex_eval.c src/ex_getln.c src/globals.h src/gui_w32.c src/gui_x11.c src/if_xcmdsrv.c src/insexpand.c src/json.c src/match.c src/menu.c src/option.c src/optionstr.c src/os_mswin.c src/quickfix.c src/regexp_bt.c src/regexp_nfa.c src/scriptfile.c src/sign.c src/spellfile.c src/undo.c src/userfunc.c src/version.c src/vim9cmds.c src/vim9compile.c src/vim9execute.c src/vim9expr.c src/window.c
diffstat 39 files changed, 161 insertions(+), 131 deletions(-) [+]
line wrap: on
line diff
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1608,7 +1608,7 @@ do_bufdel(
 	if (addr_count == 2)
 	{
 	    if (*arg)		// both range and argument is not allowed
-		return ex_errmsg(e_trailing_arg, arg);
+		return ex_errmsg(e_trailing_characters_str, arg);
 	    bnr = start_bnr;
 	}
 	else	// addr_count == 1
--- a/src/bufwrite.c
+++ b/src/bufwrite.c
@@ -700,7 +700,7 @@ buf_write(
     {
 	// This can happen during startup when there is a stray "w" in the
 	// vimrc file.
-	emsg(_(e_emptybuf));
+	emsg(_(e_empty_buffer));
 	return FAIL;
     }
 
--- a/src/clientserver.c
+++ b/src/clientserver.c
@@ -119,7 +119,7 @@ sendToLocalVim(char_u *cmd, int asExpr, 
 	{
 	    if (ret == NULL)
 	    {
-		char	*err = _(e_invexprmsg);
+		char	*err = _(e_invalid_expression_received);
 		size_t	len = STRLEN(cmd) + STRLEN(err) + 5;
 		char_u	*msg;
 
--- a/src/cmdhist.c
+++ b/src/cmdhist.c
@@ -724,7 +724,7 @@ ex_history(exarg_T *eap)
 	    else
 	    {
 		*end = i;
-		semsg(_(e_trailing_arg), arg);
+		semsg(_(e_trailing_characters_str), arg);
 		return;
 	    }
 	}
@@ -736,7 +736,7 @@ ex_history(exarg_T *eap)
 	end = arg;
     if (!get_list_range(&end, &hisidx1, &hisidx2) || *end != NUL)
     {
-	semsg(_(e_trailing_arg), end);
+	semsg(_(e_trailing_characters_str), end);
 	return;
     }
 
--- a/src/dict.c
+++ b/src/dict.c
@@ -962,7 +962,7 @@ eval_dict(char_u **arg, typval_T *rettv,
 	    if (*skipwhite(*arg) == ':')
 		semsg(_(e_no_white_space_allowed_before_str_str), ":", *arg);
 	    else
-		semsg(_(e_missing_dict_colon), *arg);
+		semsg(_(e_missing_colon_in_dictionary), *arg);
 	    clear_tv(&tvkey);
 	    goto failret;
 	}
@@ -1002,7 +1002,7 @@ eval_dict(char_u **arg, typval_T *rettv,
 	    item = dict_find(d, key, -1);
 	    if (item != NULL)
 	    {
-		semsg(_(e_duplicate_key), key);
+		semsg(_(e_duplicate_key_in_dicitonary), key);
 		clear_tv(&tvkey);
 		clear_tv(&tv);
 		goto failret;
@@ -1042,7 +1042,7 @@ eval_dict(char_u **arg, typval_T *rettv,
 	    if (**arg == ',')
 		semsg(_(e_no_white_space_allowed_before_str_str), ",", *arg);
 	    else
-		semsg(_(e_missing_dict_comma), *arg);
+		semsg(_(e_missing_comma_in_dictionary), *arg);
 	    goto failret;
 	}
     }
--- a/src/edit.c
+++ b/src/edit.c
@@ -175,7 +175,7 @@ edit(
     if (textwinlock != 0 || textlock != 0
 			  || ins_compl_active() || compl_busy || pum_visible())
     {
-	emsg(_(e_textwinlock));
+	emsg(_(e_not_allowed_to_change_text_or_change_window));
 	return FALSE;
     }
     ins_compl_clear();	    // clear stuff for CTRL-X mode
--- a/src/errors.h
+++ b/src/errors.h
@@ -524,11 +524,22 @@ EXTERN char e_window_layout_changed_unex
 EXTERN char e_cannot_allocate_color_str[]
 	INIT(= N_("E254: Cannot allocate color %s"));
 #endif
+#if defined(FEAT_SIGN_ICONS) && !defined(FEAT_GUI_GTK)
+EXTERN char e_couldnt_read_in_sign_data[]
+	INIT(= N_("E255: Couldn't read in sign data"));
+#endif
 
 EXTERN char e_internal_error_lalloc_zero[]
 	INIT(= N_("E341: Internal error: lalloc(0, )"));
 EXTERN char e_out_of_memory_allocating_nr_bytes[]
 	INIT(= N_("E342: Out of memory!  (allocating %lu bytes)"));
+#if defined(AMIGA) || defined(MACOS_X) || defined(MSWIN)  \
+	|| defined(UNIX) || defined(VMS)
+EXTERN char e_screen_mode_setting_not_supported[]
+	INIT(= N_("E359: Screen mode setting not supported"));
+#endif
+EXTERN char e_pattern_uses_more_memory_than_maxmempattern[]
+	INIT(= N_("E363: pattern uses more memory than 'maxmempattern'"));
 #ifdef FEAT_LIBCALL
 EXTERN char e_library_call_failed_for_str[]
 	INIT(= N_("E364: Library call failed for \"%s()\""));
@@ -546,6 +557,10 @@ EXTERN char e_cannot_write_buftype_optio
 EXTERN char e_could_not_load_library_function_str[]
 	INIT(= N_("E448: Could not load library function %s"));
 #endif
+#ifdef FEAT_CLIENTSERVER
+EXTERN char e_invalid_expression_received[]
+	INIT(= N_("E449: Invalid expression received"));
+#endif
 #if defined(UNIX) || defined(FEAT_SESSION)
 EXTERN char e_cannot_go_back_to_previous_directory[]
 	INIT(= N_("E459: Cannot go back to previous directory"));
@@ -554,6 +569,10 @@ EXTERN char e_cannot_go_back_to_previous
 EXTERN char e_illegal_variable_name_str[]
 	INIT(= N_("E461: Illegal variable name: %s"));
 #endif
+#ifdef FEAT_NETBEANS_INTG
+EXTERN char e_region_is_guarded_cannot_modify[]
+	INIT(= N_("E463: Region is guarded, cannot modify"));
+#endif
 EXTERN char e_ambiguous_use_of_user_defined_command[]
 	INIT(= N_("E464: Ambiguous use of user-defined command"));
 EXTERN char e_command_aborted[]
@@ -600,6 +619,10 @@ EXTERN char e_no_match_str_2[]
 	INIT(= N_("E480: No match: %s"));
 EXTERN char e_no_range_allowed[]
 	INIT(= N_("E481: No range allowed"));
+EXTERN char e_trailing_characters[]
+	INIT(= N_("E488: Trailing characters"));
+EXTERN char e_trailing_characters_str[]
+	INIT(= N_("E488: Trailing characters: %s"));
 
 	// E502
 EXTERN char e_is_a_directory[]
@@ -638,11 +661,22 @@ EXTERN char e_no_buffers_were_deleted[]
 	INIT(= N_("E516: No buffers were deleted"));
 EXTERN char e_no_buffers_were_wiped_out[]
 	INIT(= N_("E517: No buffers were wiped out"));
+EXTERN char e_not_allowed_here[]
+	INIT(= N_("E523: Not allowed here"));
+EXTERN char e_not_allowed_to_change_text_or_change_window[]
+	INIT(= N_("E565: Not allowed to change text or change window"));
+EXTERN char e_not_allowed_to_change_text_here[]
+	INIT(= N_("E578: Not allowed to change text here"));
 #ifdef FEAT_EVAL
 EXTERN char e_endwhile_without_while[]
 	INIT(= N_("E588: :endwhile without :while"));
 EXTERN char e_endfor_without_for[]
 	INIT(= N_("E588: :endfor without :for"));
+EXTERN char e_winheight_cannot_be_smaller_than_winminheight[]
+	INIT(= N_("E591: 'winheight' cannot be smaller than 'winminheight'"));
+EXTERN char e_winwidth_cannot_be_smaller_than_winminwidth[]
+	INIT(= N_("E592: 'winwidth' cannot be smaller than 'winminwidth'"));
+
 EXTERN char e_missing_endtry[]
 	INIT(= N_("E600: Missing :endtry"));
 EXTERN char e_endtry_without_try[]
@@ -673,6 +707,8 @@ EXTERN char e_no_matching_autocommands_f
 	INIT(= N_("E676: No matching autocommands for acwrite buffer"));
 EXTERN char e_buffer_nr_invalid_buffer_number[]
 	INIT(= N_("E680: <buffer=%d>: invalid buffer number"));
+EXTERN char e_invalid_search_pattern_or_delimiter[]
+	INIT(= N_("E682: Invalid search pattern or delimiter"));
 #ifdef FEAT_EVAL
 EXTERN char e_list_index_out_of_range_nr[]
 	INIT(= N_("E684: list index out of range: %ld"));
@@ -701,6 +737,14 @@ EXTERN char e_key_not_present_in_diction
 	INIT(= N_("E716: Key not present in Dictionary: \"%s\""));
 EXTERN char e_cannot_slice_dictionary[]
 	INIT(= N_("E719: Cannot slice a Dictionary"));
+EXTERN char e_missing_colon_in_dictionary[]
+	INIT(= N_("E720: Missing colon in Dictionary: %s"));
+EXTERN char e_duplicate_key_in_dicitonary[]
+	INIT(= N_("E721: Duplicate key in Dictionary: \"%s\""));
+EXTERN char e_missing_comma_in_dictionary[]
+	INIT(= N_("E722: Missing comma in Dictionary: %s"));
+EXTERN char e_missing_dict_end[]
+	INIT(= N_("E723: Missing end of Dictionary '}': %s"));
 EXTERN char e_wrong_variable_type_for_str_equal[]
 	INIT(= N_("E734: Wrong variable type for %s="));
 EXTERN char e_value_is_locked[]
@@ -712,10 +756,20 @@ EXTERN char e_cannot_change_value[]
 EXTERN char e_cannot_change_value_of_str[]
 	INIT(= N_("E742: Cannot change value of %s"));
 #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
+EXTERN char e_empty_buffer[]
+	INIT(= N_("E749: empty buffer"));
 #ifdef FEAT_SPELL
 EXTERN char e_spell_checking_is_not_possible[]
 	INIT(= N_("E756: Spell checking is not possible"));
 #endif
+#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
 #ifdef FEAT_QUICKFIX
 EXTERN char e_no_location_list[]
 	INIT(= N_("E776: No location list"));
@@ -742,6 +796,12 @@ EXTERN char e_arabic_cannot_be_used_not_
 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"));
+#endif
+EXTERN char e_cannot_close_autocmd_or_popup_window[]
+	INIT(= N_("E813: Cannot close autocmd or popup window"));
 EXTERN char e_blowfish_big_little_endian_use_wrong[]
 	INIT(= N_("E817: Blowfish big/little endian use wrong"));
 EXTERN char e_sha256_test_failed[]
@@ -757,6 +817,10 @@ EXTERN char e_conflicts_with_value_of_li
 EXTERN char e_conflicts_with_value_of_fillchars[]
 	INIT(= N_("E835: Conflicts with value of 'fillchars'"));
 // E839 unused
+#ifndef FEAT_CLIPBOARD
+EXTERN char e_invalid_register_name[]
+	INIT(= N_("E850: Invalid register name"));
+#endif
 EXTERN char e_autocommands_caused_command_to_abort[]
 	INIT(= N_("E855: Autocommands caused command to abort"));
 #ifdef FEAT_EVAL
@@ -781,6 +845,10 @@ EXTERN char e_using_invalid_value_as_str
 	INIT(= N_("E908: using an invalid value as a String: %s"));
 EXTERN char e_cannot_index_special_variable[]
 	INIT(= N_("E909: Cannot index a special variable"));
+#endif
+EXTERN char e_directory_not_found_in_str_str[]
+	INIT(= N_("E919: Directory not found in '%s': \"%s\""));
+#ifdef FEAT_EVAL
 EXTERN char e_string_required[]
 	INIT(= N_("E928: String required"));
 #endif
@@ -794,6 +862,8 @@ EXTERN char e_cannot_delete_current_grou
 	INIT(= N_("E936: Cannot delete the current group"));
 EXTERN char e_attempt_to_delete_buffer_that_is_in_use_str[]
 	INIT(= N_("E937: Attempt to delete a buffer that is in use: %s"));
+EXTERN char e_positive_count_required[]
+	INIT(= N_("E939: Positive count required"));
 #ifdef FEAT_TERMINAL
 EXTERN char e_job_still_running[]
 	INIT(= N_("E948: Job still running"));
@@ -802,6 +872,8 @@ 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_autocommand_caused_recursive_behavior[]
+	INIT(= N_("E952: Autocommand caused recursive behavior"));
 EXTERN char_u e_invalid_column_number_nr[]
 	INIT(= N_("E964: Invalid column number: %ld"));
 EXTERN char_u e_invalid_line_number_nr[]
--- a/src/eval.c
+++ b/src/eval.c
@@ -856,7 +856,7 @@ get_lval(
 	if (unlet && !VIM_ISWHITE(*p) && !ends_excmd(*p)
 						    && *p != '[' && *p != '.')
 	{
-	    semsg(_(e_trailing_arg), p);
+	    semsg(_(e_trailing_characters_str), p);
 	    return NULL;
 	}
 
@@ -2269,7 +2269,7 @@ eval0(
 		&& (!in_vim9script() || !vim9_bad_comment(p)))
 	{
 	    if (end_error)
-		semsg(_(e_trailing_arg), p);
+		semsg(_(e_trailing_characters_str), p);
 	    else
 		semsg(_(e_invalid_expression_str), arg);
 	}
@@ -4129,7 +4129,7 @@ check_can_index(typval_T *rettv, int eva
 	case VAR_FLOAT:
 #ifdef FEAT_FLOAT
 	    if (verbose)
-		emsg(_(e_float_as_string));
+		emsg(_(e_using_float_as_string));
 	    return FAIL;
 #endif
 	case VAR_BOOL:
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -3496,7 +3496,7 @@ f_eval(typval_T *argvars, typval_T *rett
 	rettv->vval.v_number = 0;
     }
     else if (*s != NUL)
-	semsg(_(e_trailing_arg), s);
+	semsg(_(e_trailing_characters_str), s);
 }
 
 /*
@@ -6698,7 +6698,7 @@ f_islocked(typval_T *argvars, typval_T *
 	if (*end != NUL)
 	{
 	    semsg(_(lv.ll_name == lv.ll_name_end
-					   ? e_invalid_argument_str : e_trailing_arg), end);
+					   ? e_invalid_argument_str : e_trailing_characters_str), end);
 	}
 	else
 	{
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -622,7 +622,7 @@ heredoc_get(exarg_T *eap, char_u *cmd, i
 	p = skiptowhite(marker);
 	if (*skipwhite(p) != NUL && *skipwhite(p) != comment_char)
 	{
-	    semsg(_(e_trailing_arg), p);
+	    semsg(_(e_trailing_characters_str), p);
 	    return NULL;
 	}
 	*p = NUL;
@@ -802,7 +802,7 @@ ex_let(exarg_T *eap)
 	    if (vim9script)
 	    {
 		if (!ends_excmd2(eap->cmd, skipwhite(argend)))
-		    semsg(_(e_trailing_arg), argend);
+		    semsg(_(e_trailing_characters_str), argend);
 		else
 		    // Vim9 declaration ":var name: type"
 		    arg = vim9_declare_scriptvar(eap, arg);
@@ -1206,7 +1206,7 @@ list_arg_vars(exarg_T *eap, char_u *arg,
 	    {
 		emsg_severe = TRUE;
 		if (!did_emsg)
-		    semsg(_(e_trailing_arg), arg);
+		    semsg(_(e_trailing_characters_str), arg);
 		break;
 	    }
 	}
@@ -1691,7 +1691,7 @@ ex_unletlock(
 		if (name_end != NULL)
 		{
 		    emsg_severe = TRUE;
-		    semsg(_(e_trailing_arg), name_end);
+		    semsg(_(e_trailing_characters_str), name_end);
 		}
 		if (!(eap->skip || error))
 		    clear_lval(&lv);
@@ -4044,7 +4044,7 @@ var_redir_start(char_u *name, int append
 	clear_lval(redir_lval);
 	if (redir_endp != NULL && *redir_endp != NUL)
 	    // Trailing characters are present after the variable name
-	    semsg(_(e_trailing_arg), redir_endp);
+	    semsg(_(e_trailing_characters_str), redir_endp);
 	else
 	    semsg(_(e_invalid_argument_str), name);
 	redir_endp = NULL;  // don't store a value, only cleanup
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -3931,7 +3931,7 @@ ex_substitute(exarg_T *eap)
 	i = getdigits(&cmd);
 	if (i <= 0 && !eap->skip && subflags.do_error)
 	{
-	    emsg(_(e_zerocount));
+	    emsg(_(e_positive_count_required));
 	    return;
 	}
 	eap->line1 = eap->line2;
@@ -3949,7 +3949,7 @@ ex_substitute(exarg_T *eap)
 	set_nextcmd(eap, cmd);
 	if (eap->nextcmd == NULL)
 	{
-	    semsg(_(e_trailing_arg), cmd);
+	    semsg(_(e_trailing_characters_str), cmd);
 	    return;
 	}
     }
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -522,7 +522,7 @@ do_exmode(
 		   || changedtick != CHANGEDTICK(curbuf)) && !ex_no_reprint)
 	{
 	    if (curbuf->b_ml.ml_flags & ML_EMPTY)
-		emsg(_(e_emptybuf));
+		emsg(_(e_empty_buffer));
 	    else
 	    {
 		if (ex_pressedreturn)
@@ -541,7 +541,7 @@ do_exmode(
 	else if (ex_pressedreturn && !ex_no_reprint)	// must be at EOF
 	{
 	    if (curbuf->b_ml.ml_flags & ML_EMPTY)
-		emsg(_(e_emptybuf));
+		emsg(_(e_empty_buffer));
 	    else
 		emsg(_("E501: At end-of-file"));
 	}
@@ -2326,7 +2326,7 @@ do_one_cmd(
 	// check these explicitly for a more specific error message
 	if (*ea.arg == '*' || *ea.arg == '+')
 	{
-	    errormsg = _(e_invalidreg);
+	    errormsg = _(e_invalid_register_name);
 	    goto doend;
 	}
 #endif
@@ -2362,7 +2362,7 @@ do_one_cmd(
 	ea.arg = skipwhite(ea.arg);
 	if (n <= 0 && !ni && (ea.argt & EX_ZEROR) == 0)
 	{
-	    errormsg = _(e_zerocount);
+	    errormsg = _(e_positive_count_required);
 	    goto doend;
 	}
 	if (ea.addr_type != ADDR_LINES)	// e.g. :buffer 2, :sleep 3
@@ -2393,7 +2393,7 @@ do_one_cmd(
 	    && *ea.arg != '"' && (*ea.arg != '|' || (ea.argt & EX_TRLBAR) == 0))
     {
 	// no arguments allowed but there is something
-	errormsg = ex_errmsg(e_trailing_arg, ea.arg);
+	errormsg = ex_errmsg(e_trailing_characters_str, ea.arg);
 	goto doend;
     }
 
@@ -5353,7 +5353,7 @@ ex_buffer(exarg_T *eap)
     if (ERROR_IF_ANY_POPUP_WINDOW)
 	return;
     if (*eap->arg)
-	eap->errmsg = ex_errmsg(e_trailing_arg, eap->arg);
+	eap->errmsg = ex_errmsg(e_trailing_characters_str, eap->arg);
     else
     {
 	if (eap->addr_count == 0)	// default is current buffer
@@ -5860,7 +5860,7 @@ ex_win_close(
     // Never close the autocommand window.
     if (win == aucmd_win)
     {
-	emsg(_(e_autocmd_close));
+	emsg(_(e_cannot_close_autocmd_or_popup_window));
 	return;
     }
 
@@ -6286,7 +6286,7 @@ ex_exit(exarg_T *eap)
 ex_print(exarg_T *eap)
 {
     if (curbuf->b_ml.ml_flags & ML_EMPTY)
-	emsg(_(e_emptybuf));
+	emsg(_(e_empty_buffer));
     else
     {
 	for ( ;!got_int; ui_breakcheck())
@@ -6771,7 +6771,7 @@ ex_mode(exarg_T *eap)
     if (*eap->arg == NUL)
 	shell_resized();
     else
-	emsg(_(e_screenmode));
+	emsg(_(e_screen_mode_setting_not_supported));
 }
 
 /*
@@ -8327,7 +8327,7 @@ ex_mark(exarg_T *eap)
     if (*eap->arg == NUL)		// No argument?
 	emsg(_(e_argument_required));
     else if (eap->arg[1] != NUL)	// more than one character?
-	semsg(_(e_trailing_arg), eap->arg);
+	semsg(_(e_trailing_characters_str), eap->arg);
     else
     {
 	pos = curwin->w_cursor;		// save curwin->w_cursor
@@ -8420,7 +8420,7 @@ ex_normal(exarg_T *eap)
 
     if (ex_normal_lock > 0)
     {
-	emsg(_(e_secure));
+	emsg(_(e_not_allowed_here));
 	return;
     }
     if (ex_normal_busy >= p_mmd)
@@ -8698,7 +8698,7 @@ ex_findpat(exarg_T *eap)
 
 	    // Check for trailing illegal characters
 	    if (!ends_excmd2(eap->arg, p))
-		eap->errmsg = ex_errmsg(e_trailing_arg, p);
+		eap->errmsg = ex_errmsg(e_trailing_characters_str, p);
 	    else
 		set_nextcmd(eap, p);
 	}
--- a/src/ex_eval.c
+++ b/src/ex_eval.c
@@ -1770,7 +1770,7 @@ ex_catch(exarg_T *eap)
 	    if (end != NULL && *end != NUL
 				      && !ends_excmd2(end, skipwhite(end + 1)))
 	    {
-		semsg(_(e_trailing_arg), end);
+		semsg(_(e_trailing_characters_str), end);
 		return;
 	    }
 
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -2641,8 +2641,8 @@ get_text_locked_msg(void)
 	return e_invalid_in_cmdline_window;
 #endif
     if (textwinlock != 0)
-	return e_textwinlock;
-    return e_textlock;
+	return e_not_allowed_to_change_text_or_change_window;
+    return e_not_allowed_to_change_text_here;
 }
 
 /*
--- a/src/globals.h
+++ b/src/globals.h
@@ -1603,50 +1603,6 @@ EXTERN int netbeansSuppressNoLines INIT(
  * Some error messages that can be shared are included here.
  * They should be moved to errors.h.
  */
-EXTERN char e_secure[]		INIT(= N_("E523: Not allowed here"));
-EXTERN char e_textlock[]	INIT(= N_("E578: Not allowed to change text here"));
-EXTERN char e_textwinlock[]	INIT(= N_("E565: Not allowed to change text or change window"));
-#if defined(AMIGA) || defined(MACOS_X) || defined(MSWIN)  \
-	|| defined(UNIX) || defined(VMS)
-EXTERN char e_screenmode[]	INIT(= N_("E359: Screen mode setting not supported"));
-#endif
-#if defined(FEAT_SIGN_ICONS) && !defined(FEAT_GUI_GTK)
-EXTERN char e_signdata[]	INIT(= N_("E255: Couldn't read in sign data!"));
-#endif
-EXTERN char e_trailing[]	INIT(= N_("E488: Trailing characters"));
-EXTERN char e_trailing_arg[]	INIT(= N_("E488: Trailing characters: %s"));
-EXTERN char e_winheight[]	INIT(= N_("E591: 'winheight' cannot be smaller than 'winminheight'"));
-EXTERN char e_winwidth[]	INIT(= N_("E592: 'winwidth' cannot be smaller than 'winminwidth'"));
-EXTERN char e_zerocount[]	INIT(= N_("E939: Positive count required"));
-#ifdef FEAT_EVAL
-EXTERN char e_missing_dict_colon[] INIT(= N_("E720: Missing colon in Dictionary: %s"));
-EXTERN char e_duplicate_key[]	INIT(= N_("E721: Duplicate key in Dictionary: \"%s\""));
-EXTERN char e_missing_dict_comma[] INIT(= N_("E722: Missing comma in Dictionary: %s"));
-EXTERN char e_missing_dict_end[]    INIT(= N_("E723: Missing end of Dictionary '}': %s"));
-#endif
-#ifdef FEAT_CLIENTSERVER
-EXTERN char e_invexprmsg[]	INIT(= N_("E449: Invalid expression received"));
-#endif
-#ifdef FEAT_NETBEANS_INTG
-EXTERN char e_guarded[]	INIT(= N_("E463: Region is guarded, cannot modify"));
-EXTERN char e_nbreadonly[]	INIT(= N_("E744: NetBeans does not allow changes in read-only files"));
-#endif
-EXTERN char e_maxmempat[]	INIT(= N_("E363: pattern uses more memory than 'maxmempattern'"));
-EXTERN char e_emptybuf[]	INIT(= N_("E749: empty buffer"));
-
-EXTERN char e_invalpat[]	INIT(= N_("E682: Invalid search pattern or delimiter"));
-#if defined(FEAT_SYN_HL) || defined(FEAT_COMPL_FUNC)
-EXTERN char e_notset[]	INIT(= N_("E764: Option '%s' is not set"));
-#endif
-#ifndef FEAT_CLIPBOARD
-EXTERN char e_invalidreg[]    INIT(= N_("E850: Invalid register name"));
-#endif
-#ifdef FEAT_FLOAT
-EXTERN char e_float_as_string[] INIT(= N_("E806: using Float as a String"));
-#endif
-EXTERN char e_dirnotf[]	INIT(= N_("E919: Directory not found in '%s': \"%s\""));
-EXTERN char e_au_recursive[]	INIT(= N_("E952: Autocommand caused recursive behavior"));
-EXTERN char e_autocmd_close[]	INIT(= N_("E813: Cannot close autocmd or popup window"));
 #ifdef FEAT_MENU
 EXTERN char e_menuothermode[]	INIT(= N_("E328: Menu only exists in another mode"));
 #endif
--- a/src/gui_w32.c
+++ b/src/gui_w32.c
@@ -8393,7 +8393,7 @@ gui_mch_register_sign(char_u *signfile)
     {
 	if (sign.hImage)
 	    close_signicon_image(&sign);
-	emsg(_(e_signdata));
+	emsg(_(e_couldnt_read_in_sign_data));
     }
     return (void *)psign;
 
--- a/src/gui_x11.c
+++ b/src/gui_x11.c
@@ -3229,7 +3229,7 @@ gui_mch_register_sign(char_u *signfile)
 	    //     gui.sign_width = sign->width + 8;
 	}
 	else
-	    emsg(_(e_signdata));
+	    emsg(_(e_couldnt_read_in_sign_data));
     }
 
     return (void *)sign;
--- a/src/if_xcmdsrv.c
+++ b/src/if_xcmdsrv.c
@@ -1323,7 +1323,7 @@ server_parse_message(
 			    ga_concat(&reply, res);
 			else
 			{
-			    ga_concat(&reply, (char_u *)_(e_invexprmsg));
+			    ga_concat(&reply, (char_u *)_(e_invalid_expression_received));
 			    ga_append(&reply, 0);
 			    ga_concat(&reply, (char_u *)"-c 1");
 			}
--- a/src/insexpand.c
+++ b/src/insexpand.c
@@ -4355,7 +4355,7 @@ get_userdefined_compl_info(colnr_T curs_
     funcname = get_complete_funcname(ctrl_x_mode);
     if (*funcname == NUL)
     {
-	semsg(_(e_notset), ctrl_x_mode == CTRL_X_FUNCTION
+	semsg(_(e_option_str_is_not_set), ctrl_x_mode == CTRL_X_FUNCTION
 		? "completefunc" : "omnifunc");
 	return FAIL;
     }
--- a/src/json.c
+++ b/src/json.c
@@ -925,7 +925,7 @@ json_decode_item(js_read_T *reader, typv
 		if (cur_item->v_type == VAR_FLOAT)
 		{
 		    // cannot use a float as a key
-		    emsg(_(e_float_as_string));
+		    emsg(_(e_using_float_as_string));
 		    retval = FAIL;
 		    goto theend;
 		}
@@ -1096,7 +1096,7 @@ json_decode_all(js_read_T *reader, typva
     json_skip_white(reader);
     if (reader->js_buf[reader->js_used] != NUL)
     {
-	semsg(_(e_trailing_arg), reader->js_buf + reader->js_used);
+	semsg(_(e_trailing_characters_str), reader->js_buf + reader->js_used);
 	return FAIL;
     }
     return OK;
--- a/src/match.c
+++ b/src/match.c
@@ -1403,7 +1403,7 @@ ex_match(exarg_T *eap)
 	    if (*end != NUL && !ends_excmd2(end, skipwhite(end + 1)))
 	    {
 		vim_free(g);
-		eap->errmsg = ex_errmsg(e_trailing_arg, end);
+		eap->errmsg = ex_errmsg(e_trailing_characters_str, end);
 		return;
 	    }
 	    if (*end != *p)
--- a/src/menu.c
+++ b/src/menu.c
@@ -289,7 +289,7 @@ ex_menu(
     }
     else if (*map_to != NUL && (unmenu || enable != MAYBE))
     {
-	semsg(_(e_trailing_arg), map_to);
+	semsg(_(e_trailing_characters_str), map_to);
 	goto theend;
     }
 #if defined(FEAT_GUI) && !(defined(FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON))
--- a/src/option.c
+++ b/src/option.c
@@ -1509,7 +1509,7 @@ do_set(
 		if (vim_strchr((char_u *)"?!&<", nextchar) != NULL
 			&& arg[1] != NUL && !VIM_ISWHITE(arg[1]))
 		{
-		    errmsg = e_trailing;
+		    errmsg = e_trailing_characters;
 		    goto skip;
 		}
 	    }
@@ -1566,7 +1566,7 @@ do_set(
 		}
 		if (nextchar != '?'
 			&& nextchar != NUL && !VIM_ISWHITE(afterchar))
-		    errmsg = e_trailing;
+		    errmsg = e_trailing_characters;
 	    }
 	    else
 	    {
@@ -1610,7 +1610,7 @@ do_set(
 			 */
 			if (nextchar != NUL && !VIM_ISWHITE(afterchar))
 			{
-			    errmsg = e_trailing;
+			    errmsg = e_trailing_characters;
 			    goto skip;
 			}
 			if (prefix == 2)	// inv
@@ -2710,7 +2710,7 @@ set_bool_option(
 		|| sandbox != 0
 #endif
 		) && (options[opt_idx].flags & P_SECURE))
-	return e_secure;
+	return e_not_allowed_here;
 
 #if defined(FEAT_EVAL)
     // Save the global value before changing anything. This is needed as for
@@ -3304,7 +3304,7 @@ set_num_option(
 		|| sandbox != 0
 #endif
 		) && (options[opt_idx].flags & P_SECURE))
-	return e_secure;
+	return e_not_allowed_here;
 
 #if defined(FEAT_EVAL)
     // Save the global value before changing anything. This is needed as for
@@ -3350,7 +3350,7 @@ set_num_option(
 	}
 	if (p_wmh > p_wh)
 	{
-	    errmsg = e_winheight;
+	    errmsg = e_winheight_cannot_be_smaller_than_winminheight;
 	    p_wh = p_wmh;
 	}
 	if (p_hh < 0)
@@ -3378,7 +3378,7 @@ set_num_option(
 	}
 	if (p_wmh > p_wh)
 	{
-	    errmsg = e_winheight;
+	    errmsg = e_winheight_cannot_be_smaller_than_winminheight;
 	    p_wmh = p_wh;
 	}
 	win_setminheight();
@@ -3393,7 +3393,7 @@ set_num_option(
 	}
 	if (p_wmw > p_wiw)
 	{
-	    errmsg = e_winwidth;
+	    errmsg = e_winwidth_cannot_be_smaller_than_winminwidth;
 	    p_wiw = p_wmw;
 	}
 
@@ -3411,7 +3411,7 @@ set_num_option(
 	}
 	if (p_wmw > p_wiw)
 	{
-	    errmsg = e_winwidth;
+	    errmsg = e_winwidth_cannot_be_smaller_than_winminwidth;
 	    p_wmw = p_wiw;
 	}
 	win_setminwidth();
--- a/src/optionstr.c
+++ b/src/optionstr.c
@@ -677,7 +677,7 @@ did_set_string_option(
 		|| sandbox != 0
 #endif
 		) && (get_option_flags(opt_idx) & P_SECURE))
-	errmsg = e_secure;
+	errmsg = e_not_allowed_here;
 
     // Check for a "normal" directory or file name in some options.  Disallow a
     // path separator (slash and/or backslash), wildcards and characters that
--- a/src/os_mswin.c
+++ b/src/os_mswin.c
@@ -2037,7 +2037,7 @@ Messaging_WndProc(HWND hwnd, UINT msg, W
 
 	    if (res == NULL)
 	    {
-		char	*err = _(e_invexprmsg);
+		char	*err = _(e_invalid_expression_received);
 		size_t	len = STRLEN(str) + STRLEN(err) + 5;
 
 		res = alloc(len);
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -3629,7 +3629,7 @@ qf_list(exarg_T *eap)
     }
     if (!get_list_range(&arg, &idx1, &idx2) || *arg != NUL)
     {
-	semsg(_(e_trailing_arg), arg);
+	semsg(_(e_trailing_characters_str), arg);
 	return;
     }
     qfl = qf_get_curlist(qi);
@@ -6106,7 +6106,7 @@ vgr_process_args(
     p = skip_vimgrep_pat(eap->arg, &args->spat, &args->flags);
     if (p == NULL)
     {
-	emsg(_(e_invalpat));
+	emsg(_(e_invalid_search_pattern_or_delimiter));
 	return FAIL;
     }
 
@@ -8399,7 +8399,7 @@ set_qf_ll_list(
     if (list_arg->v_type != VAR_LIST)
 	emsg(_(e_list_required));
     else if (recursive != 0)
-	emsg(_(e_au_recursive));
+	emsg(_(e_autocommand_caused_recursive_behavior));
     else
     {
 	list_T  *l = list_arg->vval.v_list;
--- a/src/regexp_bt.c
+++ b/src/regexp_bt.c
@@ -2451,7 +2451,7 @@ reg(
 	if (curchr == Magic(')'))
 	    EMSG2_RET_NULL(_(e_unmatched_str_close), reg_magic == MAGIC_ALL);
 	else
-	    EMSG_RET_NULL(_(e_trailing));	// "Can't happen".
+	    EMSG_RET_NULL(_(e_trailing_characters));	// "Can't happen".
 	// NOTREACHED
     }
     // Here we set the flag allowing back references to this set of
@@ -3139,7 +3139,7 @@ regstack_push(regstate_T state, char_u *
 
     if ((long)((unsigned)regstack.ga_len >> 10) >= p_mmp)
     {
-	emsg(_(e_maxmempat));
+	emsg(_(e_pattern_uses_more_memory_than_maxmempattern));
 	return NULL;
     }
     if (ga_grow(&regstack, sizeof(regitem_T)) == FAIL)
@@ -4213,7 +4213,7 @@ regmatch(
 		    // a regstar_T on the regstack.
 		    if ((long)((unsigned)regstack.ga_len >> 10) >= p_mmp)
 		    {
-			emsg(_(e_maxmempat));
+			emsg(_(e_pattern_uses_more_memory_than_maxmempattern));
 			status = RA_FAIL;
 		    }
 		    else if (ga_grow(&regstack, sizeof(regstar_T)) == FAIL)
@@ -4258,7 +4258,7 @@ regmatch(
 	    // Need a bit of room to store extra positions.
 	    if ((long)((unsigned)regstack.ga_len >> 10) >= p_mmp)
 	    {
-		emsg(_(e_maxmempat));
+		emsg(_(e_pattern_uses_more_memory_than_maxmempattern));
 		status = RA_FAIL;
 	    }
 	    else if (ga_grow(&regstack, sizeof(regbehind_T)) == FAIL)
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -4660,7 +4660,7 @@ skip_add:
 
 		if ((long)(newsize >> 10) >= p_mmp)
 		{
-		    emsg(_(e_maxmempat));
+		    emsg(_(e_pattern_uses_more_memory_than_maxmempattern));
 		    --depth;
 		    return NULL;
 		}
@@ -5002,7 +5002,7 @@ addstate_here(
 
 	    if ((long)(newsize >> 10) >= p_mmp)
 	    {
-		emsg(_(e_maxmempat));
+		emsg(_(e_pattern_uses_more_memory_than_maxmempattern));
 		return NULL;
 	    }
 	    newl = alloc(newsize);
--- a/src/scriptfile.c
+++ b/src/scriptfile.c
@@ -359,7 +359,7 @@ do_in_path(
 	char *basepath = path == p_rtp ? "runtimepath" : "packpath";
 
 	if (flags & DIP_ERR)
-	    semsg(_(e_dirnotf), basepath, name);
+	    semsg(_(e_directory_not_found_in_str_str), basepath, name);
 	else if (p_verbose > 0)
 	{
 	    verbose_enter();
--- a/src/sign.c
+++ b/src/sign.c
@@ -1630,7 +1630,7 @@ parse_sign_cmd_args(
 	    filename = arg;
 	    *buf = buflist_findnr((int)getdigits(&arg));
 	    if (*skipwhite(arg) != NUL)
-		semsg(_(e_trailing_arg), arg);
+		semsg(_(e_trailing_characters_str), arg);
 	    break;
 	}
 	else
--- a/src/spellfile.c
+++ b/src/spellfile.c
@@ -6214,7 +6214,7 @@ spell_add_word(
 
 	if (*curwin->w_s->b_p_spf == NUL)
 	{
-	    semsg(_(e_notset), "spellfile");
+	    semsg(_(e_option_str_is_not_set), "spellfile");
 	    return;
 	}
 	fnamebuf = alloc(MAXPATHL);
--- a/src/undo.c
+++ b/src/undo.c
@@ -333,7 +333,7 @@ undo_allowed(void)
     // caller of getcmdline() may get confused.
     if (textwinlock != 0 || textlock != 0)
     {
-	emsg(_(e_textlock));
+	emsg(_(e_not_allowed_to_change_text_here));
 	return FALSE;
     }
 
@@ -438,12 +438,12 @@ u_savecommon(
 	{
 	    if (netbeans_is_guarded(top, bot))
 	    {
-		emsg(_(e_guarded));
+		emsg(_(e_region_is_guarded_cannot_modify));
 		return FAIL;
 	    }
 	    if (curbuf->b_p_ro)
 	    {
-		emsg(_(e_nbreadonly));
+		emsg(_(e_netbeans_does_not_allow_changes_in_read_only_files));
 		return FAIL;
 	    }
 	}
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -1127,7 +1127,7 @@ lambda_function_body(
 
     if (!ends_excmd2(*arg, skipwhite(*arg + 1)))
     {
-	semsg(_(e_trailing_arg), *arg + 1);
+	semsg(_(e_trailing_characters_str), *arg + 1);
 	return FAIL;
     }
 
@@ -4148,7 +4148,7 @@ define_function(exarg_T *eap, char_u *na
     {
 	if (!ends_excmd(*skipwhite(p)))
 	{
-	    semsg(_(e_trailing_arg), p);
+	    semsg(_(e_trailing_characters_str), p);
 	    goto ret_free;
 	}
 	set_nextcmd(eap, p);
@@ -4364,7 +4364,7 @@ define_function(exarg_T *eap, char_u *na
 				     && (vim9script || eap->cmdidx == CMD_def))
 	    && !eap->skip
 	    && !did_emsg)
-	semsg(_(e_trailing_arg), p);
+	semsg(_(e_trailing_characters_str), p);
 
     /*
      * Read the body of the function, until "}", ":endfunction" or ":enddef" is
@@ -4899,7 +4899,7 @@ ex_delfunction(exarg_T *eap)
     if (!ends_excmd(*skipwhite(p)))
     {
 	vim_free(name);
-	semsg(_(e_trailing_arg), p);
+	semsg(_(e_trailing_characters_str), p);
 	return;
     }
     set_nextcmd(eap, p);
@@ -5262,7 +5262,7 @@ ex_call(exarg_T *eap)
 	    if (!failed && !aborting())
 	    {
 		emsg_severe = TRUE;
-		semsg(_(e_trailing_arg), arg);
+		semsg(_(e_trailing_characters_str), arg);
 	    }
 	}
 	else
--- a/src/version.c
+++ b/src/version.c
@@ -750,6 +750,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    3970,
+/**/
     3969,
 /**/
     3968,
--- a/src/vim9cmds.c
+++ b/src/vim9cmds.c
@@ -408,7 +408,7 @@ compile_if(char_u *arg, cctx_T *cctx)
     }
     if (!ends_excmd2(arg, skipwhite(p)))
     {
-	semsg(_(e_trailing_arg), p);
+	semsg(_(e_trailing_characters_str), p);
 	return NULL;
     }
     if (cctx->ctx_skip == SKIP_YES)
@@ -578,7 +578,7 @@ compile_elseif(char_u *arg, cctx_T *cctx
     if (!ends_excmd2(arg, skipwhite(p)))
     {
 	clear_ppconst(&ppconst);
-	semsg(_(e_trailing_arg), p);
+	semsg(_(e_trailing_characters_str), p);
 	return NULL;
     }
     if (scope->se_skip_save == SKIP_YES)
@@ -1075,7 +1075,7 @@ compile_while(char_u *arg, cctx_T *cctx)
 
     if (!ends_excmd2(arg, skipwhite(p)))
     {
-	semsg(_(e_trailing_arg), p);
+	semsg(_(e_trailing_characters_str), p);
 	return NULL;
     }
 
@@ -2021,7 +2021,7 @@ compile_substitute(char_u *arg, exarg_T 
 				       || GA_GROW_FAILS(&cctx->ctx_instr, 1))
 	    {
 		if (trailing_error)
-		    semsg(_(e_trailing_arg), cmd);
+		    semsg(_(e_trailing_characters_str), cmd);
 		clear_instr_ga(&cctx->ctx_instr);
 		cctx->ctx_instr = save_ga;
 		return NULL;
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -2639,7 +2639,7 @@ compile_def_function(
 		&& !(*line == '#' && (line == cctx.ctx_line_start
 						    || VIM_ISWHITE(line[-1]))))
 	{
-	    semsg(_(e_trailing_arg), line);
+	    semsg(_(e_trailing_characters_str), line);
 	    goto erret;
 	}
 	else if (line != NULL && vim9_bad_comment(skipwhite(line)))
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -3148,7 +3148,7 @@ exec_instructions(ectx_T *ectx)
 			if (item != NULL)
 			{
 			    SOURCING_LNUM = iptr->isn_lnum;
-			    semsg(_(e_duplicate_key), key);
+			    semsg(_(e_duplicate_key_in_dicitonary), key);
 			    dict_unref(dict);
 			    goto on_error;
 			}
--- a/src/vim9expr.c
+++ b/src/vim9expr.c
@@ -517,7 +517,7 @@ compile_string(isn_T *isn, cctx_T *cctx)
 				       || GA_GROW_FAILS(&cctx->ctx_instr, 1))
     {
 	if (trailing_error)
-	    semsg(_(e_trailing_arg), s);
+	    semsg(_(e_trailing_characters_str), s);
 	clear_instr_ga(&cctx->ctx_instr);
 	cctx->ctx_instr = save_ga;
 	++cctx->ctx_type_stack.ga_len;
@@ -1090,7 +1090,7 @@ compile_dict(char_u **arg, cctx_T *cctx,
 	    item = dict_find(d, key, -1);
 	    if (item != NULL)
 	    {
-		semsg(_(e_duplicate_key), key);
+		semsg(_(e_duplicate_key_in_dicitonary), key);
 		goto failret;
 	    }
 	    item = dictitem_alloc(key);
@@ -1108,7 +1108,7 @@ compile_dict(char_u **arg, cctx_T *cctx,
 	    if (*skipwhite(*arg) == ':')
 		semsg(_(e_no_white_space_allowed_before_str_str), ":", *arg);
 	    else
-		semsg(_(e_missing_dict_colon), *arg);
+		semsg(_(e_missing_colon_in_dictionary), *arg);
 	    return FAIL;
 	}
 	whitep = *arg + 1;
@@ -1140,7 +1140,7 @@ compile_dict(char_u **arg, cctx_T *cctx,
 	    break;
 	if (**arg != ',')
 	{
-	    semsg(_(e_missing_dict_comma), *arg);
+	    semsg(_(e_missing_comma_in_dictionary), *arg);
 	    goto failret;
 	}
 	if (IS_WHITE_OR_NUL(*whitep))
@@ -1711,7 +1711,7 @@ compile_subscript(
 		p = *arg;
 		if (!eval_isnamec1(*p))
 		{
-		    semsg(_(e_trailing_arg), pstart);
+		    semsg(_(e_trailing_characters_str), pstart);
 		    return FAIL;
 		}
 		if (ASCII_ISALPHA(*p) && p[1] == ':')
--- a/src/window.c
+++ b/src/window.c
@@ -2496,7 +2496,7 @@ win_close(win_T *win, int free_buf)
 	return FAIL; // window is already being closed
     if (win_unlisted(win))
     {
-	emsg(_(e_autocmd_close));
+	emsg(_(e_cannot_close_autocmd_or_popup_window));
 	return FAIL;
     }
     if ((firstwin == aucmd_win || lastwin == aucmd_win) && one_window())