changeset 25064:8f2262c72178 v8.2.3069

patch 8.2.3069: error messages are spread out Commit: https://github.com/vim/vim/commit/108010aa4720ef023a8ac59004fc0f2bc11125af Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jun 27 22:03:33 2021 +0200 patch 8.2.3069: error messages are spread out Problem: Error messages are spread out. Solution: Move some error messages to errors.h. Use clearer names.
author Bram Moolenaar <Bram@vim.org>
date Sun, 27 Jun 2021 22:15:04 +0200
parents 8722607c5e3f
children 433a418acc77
files src/arglist.c src/buffer.c src/channel.c src/errors.h src/eval.c src/evalfunc.c src/evalvars.c src/evalwindow.c src/ex_cmds.c src/ex_docmd.c src/ex_getln.c src/filepath.c src/fold.c src/getchar.c src/globals.h src/indent.c src/list.c src/map.c src/mark.c src/normal.c src/ops.c src/optionstr.c src/popupwin.c src/quickfix.c src/spellfile.c src/textprop.c src/typval.c src/undo.c src/userfunc.c src/version.c src/vim9compile.c src/window.c
diffstat 32 files changed, 130 insertions(+), 109 deletions(-) [+]
line wrap: on
line diff
--- a/src/arglist.c
+++ b/src/arglist.c
@@ -832,7 +832,7 @@ ex_argdelete(exarg_T *eap)
 	{
 	    // Don't give an error for ":%argdel" if the list is empty.
 	    if (eap->line1 != 1 || eap->line2 != 0)
-		emsg(_(e_invrange));
+		emsg(_(e_invalid_range));
 	}
 	else
 	{
@@ -920,7 +920,7 @@ do_arg_all(
 #ifdef FEAT_CMDWIN
     if (cmdwin_type != 0)
     {
-	emsg(_(e_cmdwin));
+	emsg(_(e_invalid_in_cmdline_window));
 	return;
     }
 #endif
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -2407,7 +2407,7 @@ buflist_getfile(
     if (buf == NULL)
     {
 	if ((options & GETF_ALT) && n == 0)
-	    emsg(_(e_noalt));
+	    emsg(_(e_no_alternate_file));
 	else
 	    semsg(_("E92: Buffer %d not found"), n);
 	return FAIL;
@@ -3516,7 +3516,7 @@ getaltfname(
     if (buflist_name_nr(0, &fname, &dummy) == FAIL)
     {
 	if (errmsg)
-	    emsg(_(e_noalt));
+	    emsg(_(e_no_alternate_file));
 	return NULL;
     }
     return fname;
--- a/src/channel.c
+++ b/src/channel.c
@@ -1232,7 +1232,7 @@ channel_set_options(channel_T *channel, 
 
 	    if (!buf->b_p_ma && !channel->ch_part[PART_OUT].ch_nomodifiable)
 	    {
-		emsg(_(e_modifiable));
+		emsg(_(e_cannot_make_changes_modifiable_is_off));
 	    }
 	    else
 	    {
@@ -1278,7 +1278,7 @@ channel_set_options(channel_T *channel, 
 						!opt->jo_modifiable[PART_ERR];
 	    if (!buf->b_p_ma && !channel->ch_part[PART_ERR].ch_nomodifiable)
 	    {
-		emsg(_(e_modifiable));
+		emsg(_(e_cannot_make_changes_modifiable_is_off));
 	    }
 	    else
 	    {
--- a/src/errors.h
+++ b/src/errors.h
@@ -10,6 +10,44 @@
  * Definition of error messages, sorted on error number.
  */
 
+EXTERN char e_backslash_should_be_followed_by[]
+	INIT(= N_("E10: \\ should be followed by /, ? or &"));
+#ifdef FEAT_CMDWIN
+EXTERN char e_invalid_in_cmdline_window[]
+	INIT(= N_("E11: Invalid in command-line window; <CR> executes, CTRL-C quits"));
+#endif
+EXTERN char e_command_not_allowed_from_vimrc_in_current_dir_or_tag_search[]
+	INIT(= N_("E12: Command not allowed from exrc/vimrc in current dir or tag search"));
+EXTERN char e_file_exists[]
+	INIT(= N_("E13: File exists (add ! to override)"));
+#ifdef FEAT_EVAL
+EXTERN char e_invalid_expression_str[]
+	INIT(= N_("E15: Invalid expression: \"%s\""));
+#endif
+EXTERN char e_invalid_range[]
+	INIT(= N_("E16: Invalid range"));
+#if defined(UNIX) || defined(FEAT_SYN_HL) || defined(FEAT_SPELL)
+EXTERN char e_src_is_directory[]
+	INIT(= N_("E17: \"%s\" is a directory"));
+#endif
+#ifdef FEAT_EVAL
+EXTERN char e_unexpected_characters_in_let[]
+	INIT(= N_("E18: Unexpected characters in :let"));
+EXTERN char e_unexpected_characters_in_assignment[]
+	INIT(= N_("E18: Unexpected characters in assignment"));
+#endif
+EXTERN char e_mark_has_invalid_line_number[]
+	INIT(= N_("E19: Mark has invalid line number"));
+EXTERN char e_mark_not_set[]
+	INIT(= N_("E20: Mark not set"));
+EXTERN char e_cannot_make_changes_modifiable_is_off[]
+	INIT(= N_("E21: Cannot make changes, 'modifiable' is off"));
+EXTERN char e_scripts_nested_too_deep[]
+	INIT(= N_("E22: Scripts nested too deep"));
+EXTERN char e_no_alternate_file[]
+	INIT(= N_("E23: No alternate file"));
+EXTERN char e_no_such_abbreviation[]
+	INIT(= N_("E24: No such abbreviation"));
 #ifdef FEAT_EVAL
 EXTERN char e_undefined_variable_str[]
 	INIT(= N_("E121: Undefined variable: %s"));
--- a/src/eval.c
+++ b/src/eval.c
@@ -216,7 +216,7 @@ eval1_emsg(char_u **arg, typval_T *rettv
 	// Also check called_emsg for when using assert_fails().
 	if (!aborting() && did_emsg == did_emsg_before
 					  && called_emsg == called_emsg_before)
-	    semsg(_(e_invexpr2), start);
+	    semsg(_(e_invalid_expression_str), start);
     }
     clear_evalarg(&evalarg, eap);
     return ret;
@@ -297,7 +297,7 @@ eval_expr_typval(typval_T *expr, typval_
 	if (*skipwhite(s) != NUL)  // check for trailing chars after expr
 	{
 	    clear_tv(rettv);
-	    semsg(_(e_invexpr2), s);
+	    semsg(_(e_invalid_expression_str), s);
 	    return FAIL;
 	}
     }
@@ -2268,7 +2268,7 @@ eval0(
 	    if (end_error)
 		semsg(_(e_trailing_arg), p);
 	    else
-		semsg(_(e_invexpr2), arg);
+		semsg(_(e_invalid_expression_str), arg);
 	}
 
 	// Some of the expression may not have been consumed.  Do not check for
@@ -2758,7 +2758,7 @@ eval4(char_u **arg, typval_T *rettv, eva
 
 	if (vim9script && type_is && (p[len] == '?' || p[len] == '#'))
 	{
-	    semsg(_(e_invexpr2), p);
+	    semsg(_(e_invalid_expression_str), p);
 	    clear_tv(rettv);
 	    return FAIL;
 	}
@@ -3367,7 +3367,7 @@ eval_leader(char_u **arg, int vim9)
 	// ++, --, -+ and +- are not accepted in Vim9 script
 	if (vim9 && (*p == '-' || *p == '+') && (*n == '-' || *n == '+'))
 	{
-	    semsg(_(e_invexpr2), s);
+	    semsg(_(e_invalid_expression_str), s);
 	    return FAIL;
 	}
 	p = n;
@@ -3441,7 +3441,7 @@ eval7(
 #endif
 	    ))
     {
-	semsg(_(e_invexpr2), *arg);
+	semsg(_(e_invalid_expression_str), *arg);
 	++*arg;
 	return FAIL;
     }
@@ -5607,7 +5607,7 @@ get_name_len(
     // Only give an error when there is something, otherwise it will be
     // reported at a higher level.
     if (len == 0 && verbose && **arg != NUL)
-	semsg(_(e_invexpr2), *arg);
+	semsg(_(e_invalid_expression_str), *arg);
 
     return len;
 }
@@ -6153,7 +6153,7 @@ ex_echo(exarg_T *eap)
 	     */
 	    if (!aborting() && did_emsg == did_emsg_before
 					  && called_emsg == called_emsg_before)
-		semsg(_(e_invexpr2), arg_start);
+		semsg(_(e_invalid_expression_str), arg_start);
 	    need_clr_eos = FALSE;
 	    break;
 	}
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -2923,7 +2923,7 @@ f_eval(typval_T *argvars, typval_T *rett
     if (s == NULL || eval1(&s, rettv, &EVALARG_EVALUATE) == FAIL)
     {
 	if (p != NULL && !aborting())
-	    semsg(_(e_invexpr2), p);
+	    semsg(_(e_invalid_expression_str), p);
 	need_clr_eos = FALSE;
 	rettv->v_type = VAR_NUMBER;
 	rettv->vval.v_number = 0;
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -1334,7 +1334,7 @@ ex_let_one(
 		semsg(_(e_letwrong), op);
 	    else if (endchars != NULL
 			     && vim_strchr(endchars, *skipwhite(arg)) == NULL)
-		emsg(_(e_letunexp));
+		emsg(_(e_unexpected_characters_in_let));
 	    else if (!check_secure())
 	    {
 		c1 = name[len];
@@ -1379,7 +1379,7 @@ ex_let_one(
 	p = find_option_end(&arg, &opt_flags);
 	if (p == NULL || (endchars != NULL
 			      && vim_strchr(endchars, *skipwhite(p)) == NULL))
-	    emsg(_(e_letunexp));
+	    emsg(_(e_unexpected_characters_in_let));
 	else
 	{
 	    long	n = 0;
@@ -1481,7 +1481,7 @@ ex_let_one(
 	    semsg(_(e_letwrong), op);
 	else if (endchars != NULL
 			 && vim_strchr(endchars, *skipwhite(arg + 1)) == NULL)
-	    emsg(_(e_letunexp));
+	    emsg(_(e_unexpected_characters_in_let));
 	else
 	{
 	    char_u	*ptofree = NULL;
@@ -1520,7 +1520,7 @@ ex_let_one(
 	{
 	    if (endchars != NULL && vim_strchr(endchars,
 					   *skipwhite(lv.ll_name_end)) == NULL)
-		emsg(_(e_letunexp));
+		emsg(_(e_unexpected_characters_in_let));
 	    else
 	    {
 		set_var_lval(&lv, p, tv, copy, flags, op, var_idx);
--- a/src/evalwindow.c
+++ b/src/evalwindow.c
@@ -363,7 +363,7 @@ get_winnr(tabpage_T *tp, typval_T *argva
 
 	if (invalid_arg)
 	{
-	    semsg(_(e_invexpr2), arg);
+	    semsg(_(e_invalid_expression_str), arg);
 	    nr = 0;
 	}
     }
@@ -636,7 +636,7 @@ f_tabpagenr(typval_T *argvars UNUSED, ty
 		nr = valid_tabpage(lastused_tabpage) ?
 					tabpage_index(lastused_tabpage) : 0;
 	    else
-		semsg(_(e_invexpr2), arg);
+		semsg(_(e_invalid_expression_str), arg);
 	}
     }
     else
@@ -726,7 +726,7 @@ f_win_gotoid(typval_T *argvars, typval_T
 #ifdef FEAT_CMDWIN
     if (cmdwin_type != 0)
     {
-	emsg(_(e_cmdwin));
+	emsg(_(e_invalid_in_cmdline_window));
 	return;
     }
 #endif
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -2120,7 +2120,7 @@ check_overwrite(
 	    // with UNIX it is possible to open a directory
 	    if (mch_isdir(ffname))
 	    {
-		semsg(_(e_isadir2), ffname);
+		semsg(_(e_src_is_directory), ffname);
 		return FAIL;
 	    }
 #endif
@@ -2137,7 +2137,7 @@ check_overwrite(
 	    else
 #endif
 	    {
-		emsg(_(e_exists));
+		emsg(_(e_file_exists));
 		return FAIL;
 	    }
 	}
@@ -3586,7 +3586,7 @@ check_secure(void)
     if (secure)
     {
 	secure = 2;
-	emsg(_(e_curdir));
+	emsg(_(e_command_not_allowed_from_vimrc_in_current_dir_or_tag_search));
 	return TRUE;
     }
 #ifdef HAVE_SANDBOX
@@ -3729,7 +3729,7 @@ ex_substitute(exarg_T *eap)
 	    ++cmd;
 	    if (vim_strchr((char_u *)"/?&", *cmd) == NULL)
 	    {
-		emsg(_(e_backslash));
+		emsg(_(e_backslash_should_be_followed_by));
 		return;
 	    }
 	    if (*cmd != '&')
@@ -3944,7 +3944,7 @@ ex_substitute(exarg_T *eap)
     if (!subflags.do_count && !curbuf->b_p_ma)
     {
 	// Substitution is not allowed in non-'modifiable' buffer
-	emsg(_(e_modifiable));
+	emsg(_(e_cannot_make_changes_modifiable_is_off));
 	return;
     }
 
@@ -4903,7 +4903,7 @@ ex_global(exarg_T *eap)
 	++cmd;
 	if (vim_strchr((char_u *)"/?&", *cmd) == NULL)
 	{
-	    emsg(_(e_backslash));
+	    emsg(_(e_backslash_should_be_followed_by));
 	    return;
 	}
 	if (*cmd == '&')
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -1997,7 +1997,7 @@ do_one_cmd(
 	    }
 
 	    if (ea.line2 < 0)
-		errormsg = _(e_invrange);
+		errormsg = _(e_invalid_range);
 	    else
 	    {
 		if (ea.line2 == 0)
@@ -2124,7 +2124,7 @@ do_one_cmd(
 	if (!curbuf->b_p_ma && (ea.argt & EX_MODIFY))
 	{
 	    // Command not allowed in non-'modifiable' buffer
-	    errormsg = _(e_modifiable);
+	    errormsg = _(e_cannot_make_changes_modifiable_is_off);
 	    goto doend;
 	}
 
@@ -2134,7 +2134,7 @@ do_one_cmd(
 	    if (cmdwin_type != 0 && !(ea.argt & EX_CMDWIN))
 	    {
 		// Command not allowed in the command line window
-		errormsg = _(e_cmdwin);
+		errormsg = _(e_invalid_in_cmdline_window);
 		goto doend;
 	    }
 #endif
@@ -2996,7 +2996,7 @@ parse_command_modifiers(
 				{
 				    if (tabnr < 0 || tabnr > LAST_TAB_NR)
 				    {
-					*errormsg = _(e_invrange);
+					*errormsg = _(e_invalid_range);
 					return FAIL;
 				    }
 				    cmod->cmod_tab = tabnr + 1;
@@ -3239,14 +3239,14 @@ parse_cmd_address(exarg_T *eap, char **e
 			{
 			    // there is no Vim command which uses '%' and
 			    // ADDR_WINDOWS or ADDR_TABS
-			    *errormsg = _(e_invrange);
+			    *errormsg = _(e_invalid_range);
 			    return FAIL;
 			}
 			break;
 		    case ADDR_TABS_RELATIVE:
 		    case ADDR_UNSIGNED:
 		    case ADDR_QUICKFIX:
-			*errormsg = _(e_invrange);
+			*errormsg = _(e_invalid_range);
 			return FAIL;
 		    case ADDR_ARGUMENTS:
 			if (ARGCOUNT == 0)
@@ -3278,7 +3278,7 @@ parse_cmd_address(exarg_T *eap, char **e
 		// '*' - visual area
 		if (eap->addr_type != ADDR_LINES)
 		{
-		    *errormsg = _(e_invrange);
+		    *errormsg = _(e_invalid_range);
 		    return FAIL;
 		}
 
@@ -3923,7 +3923,7 @@ addr_error(cmd_addr_T addr_type)
     if (addr_type == ADDR_NONE)
 	emsg(_(e_norange));
     else
-	emsg(_(e_invrange));
+	emsg(_(e_invalid_range));
 }
 
 /*
@@ -4210,7 +4210,7 @@ get_address(
 		    i = RE_SEARCH;
 		else
 		{
-		    emsg(_(e_backslash));
+		    emsg(_(e_backslash_should_be_followed_by));
 		    cmd = NULL;
 		    goto error;
 		}
@@ -4312,7 +4312,7 @@ get_address(
 
 	    if (addr_type == ADDR_TABS_RELATIVE)
 	    {
-		emsg(_(e_invrange));
+		emsg(_(e_invalid_range));
 		cmd = NULL;
 		goto error;
 	    }
@@ -4460,7 +4460,7 @@ invalid_range(exarg_T *eap)
     if (       eap->line1 < 0
 	    || eap->line2 < 0
 	    || eap->line1 > eap->line2)
-	return _(e_invrange);
+	return _(e_invalid_range);
 
     if (eap->argt & EX_RANGE)
     {
@@ -4472,46 +4472,46 @@ invalid_range(exarg_T *eap)
 			    + (eap->cmdidx == CMD_diffget)
 #endif
 		   )
-		    return _(e_invrange);
+		    return _(e_invalid_range);
 		break;
 	    case ADDR_ARGUMENTS:
 		// add 1 if ARGCOUNT is 0
 		if (eap->line2 > ARGCOUNT + (!ARGCOUNT))
-		    return _(e_invrange);
+		    return _(e_invalid_range);
 		break;
 	    case ADDR_BUFFERS:
 		// Only a boundary check, not whether the buffers actually
 		// exist.
 		if (eap->line1 < 1 || eap->line2 > get_highest_fnum())
-		    return _(e_invrange);
+		    return _(e_invalid_range);
 		break;
 	    case ADDR_LOADED_BUFFERS:
 		buf = firstbuf;
 		while (buf->b_ml.ml_mfp == NULL)
 		{
 		    if (buf->b_next == NULL)
-			return _(e_invrange);
+			return _(e_invalid_range);
 		    buf = buf->b_next;
 		}
 		if (eap->line1 < buf->b_fnum)
-		    return _(e_invrange);
+		    return _(e_invalid_range);
 		buf = lastbuf;
 		while (buf->b_ml.ml_mfp == NULL)
 		{
 		    if (buf->b_prev == NULL)
-			return _(e_invrange);
+			return _(e_invalid_range);
 		    buf = buf->b_prev;
 		}
 		if (eap->line2 > buf->b_fnum)
-		    return _(e_invrange);
+		    return _(e_invalid_range);
 		break;
 	    case ADDR_WINDOWS:
 		if (eap->line2 > LAST_WIN_NR)
-		    return _(e_invrange);
+		    return _(e_invalid_range);
 		break;
 	    case ADDR_TABS:
 		if (eap->line2 > LAST_TAB_NR)
-		    return _(e_invrange);
+		    return _(e_invalid_range);
 		break;
 	    case ADDR_TABS_RELATIVE:
 	    case ADDR_OTHER:
@@ -4521,14 +4521,14 @@ invalid_range(exarg_T *eap)
 #ifdef FEAT_QUICKFIX
 		// No error for value that is too big, will use the last entry.
 		if (eap->line2 <= 0)
-		    return _(e_invrange);
+		    return _(e_invalid_range);
 #endif
 		break;
 	    case ADDR_QUICKFIX_VALID:
 #ifdef FEAT_QUICKFIX
 		if ((eap->line2 != 1 && eap->line2 > qf_get_valid_size(eap))
 			|| eap->line2 < 0)
-		    return _(e_invrange);
+		    return _(e_invalid_range);
 #endif
 		break;
 	    case ADDR_UNSIGNED:
@@ -5187,7 +5187,8 @@ ex_autocmd(exarg_T *eap)
     if (secure)
     {
 	secure = 2;
-	eap->errmsg = _(e_curdir);
+	eap->errmsg =
+	      _(e_command_not_allowed_from_vimrc_in_current_dir_or_tag_search);
     }
     else if (eap->cmdidx == CMD_autocmd)
 	do_autocmd(eap->arg, eap->forceit);
@@ -5842,7 +5843,7 @@ get_tabpage_arg(exarg_T *eap)
     {
 	if (unaccept_arg0 && eap->line2 == 0)
 	{
-	    eap->errmsg = _(e_invrange);
+	    eap->errmsg = _(e_invalid_range);
 	    tab_number = 0;
 	}
 	else
@@ -5852,7 +5853,7 @@ get_tabpage_arg(exarg_T *eap)
 	    {
 		--tab_number;
 		if (tab_number < unaccept_arg0)
-		    eap->errmsg = _(e_invrange);
+		    eap->errmsg = _(e_invalid_range);
 	    }
 	}
     }
@@ -6564,7 +6565,7 @@ ex_tabnext(exarg_T *eap)
 		    tab_number = eap->line2;
 		    if (tab_number < 1)
 		    {
-			eap->errmsg = _(e_invrange);
+			eap->errmsg = _(e_invalid_range);
 			return;
 		    }
 		}
@@ -7715,7 +7716,7 @@ ex_copymove(exarg_T *eap)
      */
     if (n == MAXLNUM || n < 0 || n > curbuf->b_ml.ml_line_count)
     {
-	emsg(_(e_invrange));
+	emsg(_(e_invalid_range));
 	return;
     }
 
@@ -8163,7 +8164,7 @@ open_exfile(
     // with Unix it is possible to open a directory
     if (mch_isdir(fname))
     {
-	semsg(_(e_isadir2), fname);
+	semsg(_(e_src_is_directory), fname);
 	return NULL;
     }
 #endif
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -2622,7 +2622,7 @@ get_text_locked_msg(void)
 {
 #ifdef FEAT_CMDWIN
     if (cmdwin_type != 0)
-	return e_cmdwin;
+	return e_invalid_in_cmdline_window;
 #endif
     if (textwinlock != 0)
 	return e_textwinlock;
--- a/src/filepath.c
+++ b/src/filepath.c
@@ -856,7 +856,7 @@ f_delete(typval_T *argvars, typval_T *re
 	// delete a directory recursively
 	rettv->vval.v_number = delete_recursive(name);
     else
-	semsg(_(e_invexpr2), flags);
+	semsg(_(e_invalid_expression_str), flags);
 }
 
 /*
@@ -1685,7 +1685,7 @@ read_file_or_blob(typval_T *argvars, typ
 
     if (mch_isdir(fname))
     {
-	semsg(_(e_isadir2), fname);
+	semsg(_(e_src_is_directory), fname);
 	return;
     }
     if (*fname == NUL || (fd = mch_fopen((char *)fname, READBIN)) == NULL)
--- a/src/fold.c
+++ b/src/fold.c
@@ -1762,7 +1762,7 @@ foldCreateMarkers(linenr_T start, linenr
 {
     if (!curbuf->b_p_ma)
     {
-	emsg(_(e_modifiable));
+	emsg(_(e_cannot_make_changes_modifiable_is_off));
 	return;
     }
     parseMarker(curwin);
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -1447,7 +1447,7 @@ openscript(
 {
     if (curscript + 1 == NSCRIPT)
     {
-	emsg(_(e_nesting));
+	emsg(_(e_scripts_nested_too_deep));
 	return;
     }
 
--- a/src/globals.h
+++ b/src/globals.h
@@ -1581,11 +1581,6 @@ EXTERN int netbeansSuppressNoLines INIT(
  */
 EXTERN char e_abort[]		INIT(= N_("E470: Command aborted"));
 EXTERN char e_argreq[]		INIT(= N_("E471: Argument required"));
-EXTERN char e_backslash[]	INIT(= N_("E10: \\ should be followed by /, ? or &"));
-#ifdef FEAT_CMDWIN
-EXTERN char e_cmdwin[]	INIT(= N_("E11: Invalid in command-line window; <CR> executes, CTRL-C quits"));
-#endif
-EXTERN char e_curdir[]	INIT(= N_("E12: Command not allowed from exrc/vimrc in current dir or tag search"));
 #ifdef FEAT_EVAL
 EXTERN char e_endif[]		INIT(= N_("E171: Missing :endif"));
 EXTERN char e_catch[]		INIT(= N_("E603: :catch without :try"));
@@ -1598,7 +1593,6 @@ EXTERN char e_endfor[]		INIT(= N_("E170:
 EXTERN char e_while[]		INIT(= N_("E588: :endwhile without :while"));
 EXTERN char e_for[]		INIT(= N_("E588: :endfor without :for"));
 #endif
-EXTERN char e_exists[]	INIT(= N_("E13: File exists (add ! to override)"));
 EXTERN char e_failed[]	INIT(= N_("E472: Command failed"));
 #if defined(FEAT_GUI) && defined(FEAT_XFONTSET)
 EXTERN char e_fontset[]	INIT(= N_("E234: Unknown fontset: %s"));
@@ -1618,13 +1612,6 @@ EXTERN char e_invarg2[]		INIT(= N_("E475
 EXTERN char e_duparg2[]		INIT(= N_("E983: Duplicate argument: %s"));
 EXTERN char e_invargval[]	INIT(= N_("E475: Invalid value for argument %s"));
 EXTERN char e_invargNval[]	INIT(= N_("E475: Invalid value for argument %s: %s"));
-#ifdef FEAT_EVAL
-EXTERN char e_invexpr2[]	INIT(= N_("E15: Invalid expression: \"%s\""));
-#endif
-EXTERN char e_invrange[]	INIT(= N_("E16: Invalid range"));
-#if defined(UNIX) || defined(FEAT_SYN_HL) || defined(FEAT_SPELL)
-EXTERN char e_isadir2[]		INIT(= N_("E17: \"%s\" is a directory"));
-#endif
 #ifdef FEAT_SPELL
 EXTERN char e_no_spell[]	INIT(= N_("E756: Spell checking is not possible"));
 #endif
@@ -1646,12 +1633,6 @@ EXTERN char e_fsync[]		INIT(= N_("E667: 
 EXTERN char e_loadlib[]	INIT(= N_("E370: Could not load library %s"));
 EXTERN char e_loadfunc[]	INIT(= N_("E448: Could not load library function %s"));
 #endif
-EXTERN char e_markinval[]	INIT(= N_("E19: Mark has invalid line number"));
-EXTERN char e_marknotset[]	INIT(= N_("E20: Mark not set"));
-EXTERN char e_modifiable[]	INIT(= N_("E21: Cannot make changes, 'modifiable' is off"));
-EXTERN char e_nesting[]	INIT(= N_("E22: Scripts nested too deep"));
-EXTERN char e_noalt[]		INIT(= N_("E23: No alternate file"));
-EXTERN char e_noabbr[]	INIT(= N_("E24: No such abbreviation"));
 EXTERN char e_nobang[]	INIT(= N_("E477: No ! allowed"));
 #if !defined(FEAT_GUI) || defined(VIMDLL)
 EXTERN char e_nogvim[]	INIT(= N_("E25: GUI cannot be used: Not enabled at compile time"));
@@ -1733,7 +1714,6 @@ EXTERN char e_listdictblobarg[]	INIT(= N
 EXTERN char e_modulus[]		INIT(= N_("E804: Cannot use '%' with Float"));
 EXTERN char e_const_option[]	INIT(= N_("E996: Cannot lock an option"));
 EXTERN char e_unknown_option[]	INIT(= N_("E113: Unknown option: %s"));
-EXTERN char e_letunexp[]	INIT(= N_("E18: Unexpected characters in :let"));
 EXTERN char e_reduceempty[]	INIT(= N_("E998: Reduce of an empty %s with no initial value"));
 EXTERN char e_no_dict_key[]	INIT(= N_("E857: Dictionary key \"%s\" required"));
 #endif
--- a/src/indent.c
+++ b/src/indent.c
@@ -991,7 +991,7 @@ op_reindent(oparg_T *oap, int (*how)(voi
     // Don't even try when 'modifiable' is off.
     if (!curbuf->b_p_ma)
     {
-	emsg(_(e_modifiable));
+	emsg(_(e_cannot_make_changes_modifiable_is_off));
 	return;
     }
 
--- a/src/list.c
+++ b/src/list.c
@@ -1556,7 +1556,7 @@ list_remove(typval_T *argvars, typval_T 
 			break;
 		}
 		if (li == NULL)  // didn't find "item2" after "item"
-		    emsg(_(e_invrange));
+		    emsg(_(e_invalid_range));
 		else
 		{
 		    vimlist_remove(l, item, item2);
--- a/src/map.c
+++ b/src/map.c
@@ -2717,7 +2717,7 @@ do_exmap(exarg_T *eap, int isabbrev)
     {
 	case 1: emsg(_(e_invarg));
 		break;
-	case 2: emsg((isabbrev ? _(e_noabbr) : _(e_nomap)));
+	case 2: emsg((isabbrev ? _(e_no_such_abbreviation) : _(e_nomap)));
 		break;
     }
 }
--- a/src/mark.c
+++ b/src/mark.c
@@ -588,12 +588,12 @@ check_mark(pos_T *pos)
 	// lnum is negative if mark is in another file can can't get that
 	// file, error message already give then.
 	if (pos->lnum == 0)
-	    emsg(_(e_marknotset));
+	    emsg(_(e_mark_not_set));
 	return FAIL;
     }
     if (pos->lnum > curbuf->b_ml.ml_line_count)
     {
-	emsg(_(e_markinval));
+	emsg(_(e_mark_has_invalid_line_number));
 	return FAIL;
     }
     return OK;
--- a/src/normal.c
+++ b/src/normal.c
@@ -5210,7 +5210,7 @@ nv_Replace(cmdarg_T *cap)
     else if (!checkclearopq(cap->oap))
     {
 	if (!curbuf->b_p_ma)
-	    emsg(_(e_modifiable));
+	    emsg(_(e_cannot_make_changes_modifiable_is_off));
 	else
 	{
 	    if (virtual_active())
@@ -5235,7 +5235,7 @@ nv_vreplace(cmdarg_T *cap)
     else if (!checkclearopq(cap->oap))
     {
 	if (!curbuf->b_p_ma)
-	    emsg(_(e_modifiable));
+	    emsg(_(e_cannot_make_changes_modifiable_is_off));
 	else
 	{
 	    if (cap->extra_char == Ctrl_V)	// get another character
@@ -7075,7 +7075,7 @@ nv_edit(cmdarg_T *cap)
     else if (!curbuf->b_p_ma && !p_im)
     {
 	// Only give this error when 'insertmode' is off.
-	emsg(_(e_modifiable));
+	emsg(_(e_cannot_make_changes_modifiable_is_off));
 	clearop(cap->oap);
 	if (cap->cmdchar == K_PS)
 	    // drop the pasted text
--- a/src/ops.c
+++ b/src/ops.c
@@ -621,7 +621,7 @@ op_delete(oparg_T *oap)
 
     if (!curbuf->b_p_ma)
     {
-	emsg(_(e_modifiable));
+	emsg(_(e_cannot_make_changes_modifiable_is_off));
 	return FAIL;
     }
 
--- a/src/optionstr.c
+++ b/src/optionstr.c
@@ -971,7 +971,7 @@ ambw_end:
 	if (gvarp == &p_fenc)
 	{
 	    if (!curbuf->b_p_ma && opt_flags != OPT_GLOBAL)
-		errmsg = e_modifiable;
+		errmsg = e_cannot_make_changes_modifiable_is_off;
 	    else if (vim_strchr(*varp, ',') != NULL)
 		// No comma allowed in 'fileencoding'; catches confusing it
 		// with 'fileencodings'.
@@ -1130,7 +1130,7 @@ ambw_end:
     else if (gvarp == &p_ff)
     {
 	if (!curbuf->b_p_ma && !(opt_flags & OPT_GLOBAL))
-	    errmsg = e_modifiable;
+	    errmsg = e_cannot_make_changes_modifiable_is_off;
 	else if (check_opt_strings(*varp, p_ff_values, FALSE) != OK)
 	    errmsg = e_invarg;
 	else
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -61,7 +61,7 @@ popup_options_one(dict_T *dict, char_u *
 	    n = strtol((char *)s, (char **)&endp, 10);
 	if (endp != NULL && *skipwhite(endp) != NUL)
 	{
-	    semsg(_(e_invexpr2), val);
+	    semsg(_(e_invalid_expression_str), val);
 	    return 0;
 	}
     }
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -3830,7 +3830,7 @@ qf_history(exarg_T *eap)
 	    qf_update_buffer(qi, NULL);
 	}
 	else
-	    emsg(_(e_invrange));
+	    emsg(_(e_invalid_range));
 
 	return;
     }
@@ -5655,7 +5655,7 @@ ex_cbelow(exarg_T *eap)
 
     if (eap->addr_count > 0 && eap->line2 <= 0)
     {
-	emsg(_(e_invrange));
+	emsg(_(e_invalid_range));
 	return;
     }
 
@@ -7817,7 +7817,7 @@ cbuffer_process_args(
     if (eap->line1 < 1 || eap->line1 > buf->b_ml.ml_line_count
 	    || eap->line2 < 1 || eap->line2 > buf->b_ml.ml_line_count)
     {
-	emsg(_(e_invrange));
+	emsg(_(e_invalid_range));
 	return FAIL;
     }
 
--- a/src/spellfile.c
+++ b/src/spellfile.c
@@ -5972,12 +5972,12 @@ mkspell(
 	// time.
 	if (!over_write && mch_stat((char *)wfname, &st) >= 0)
 	{
-	    emsg(_(e_exists));
+	    emsg(_(e_file_exists));
 	    goto theend;
 	}
 	if (mch_isdir(wfname))
 	{
-	    semsg(_(e_isadir2), wfname);
+	    semsg(_(e_src_is_directory), wfname);
 	    goto theend;
 	}
 
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -549,7 +549,7 @@ f_prop_clear(typval_T *argvars, typval_T
     }
     if (start < 1 || end < 1)
     {
-	emsg(_(e_invrange));
+	emsg(_(e_invalid_range));
 	return;
     }
 
@@ -646,7 +646,7 @@ f_prop_find(typval_T *argvars, typval_T 
 
     if (lnum < 1 || lnum > buf->b_ml.ml_line_count)
     {
-	emsg(_(e_invrange));
+	emsg(_(e_invalid_range));
 	return;
     }
 
@@ -779,7 +779,7 @@ f_prop_list(typval_T *argvars, typval_T 
     }
     if (lnum < 1 || lnum > buf->b_ml.ml_line_count)
     {
-	emsg(_(e_invrange));
+	emsg(_(e_invalid_range));
 	return;
     }
 
@@ -839,7 +839,7 @@ f_prop_remove(typval_T *argvars, typval_
 	    end = tv_get_number(&argvars[2]);
 	if (start < 1 || end < 1)
 	{
-	    emsg(_(e_invrange));
+	    emsg(_(e_invalid_range));
 	    return;
 	}
     }
--- a/src/typval.c
+++ b/src/typval.c
@@ -1328,7 +1328,7 @@ eval_number(
 		      : STR2NR_ALL, &n, NULL, 0, TRUE);
 	if (len == 0)
 	{
-	    semsg(_(e_invexpr2), *arg);
+	    semsg(_(e_invalid_expression_str), *arg);
 	    return FAIL;
 	}
 	*arg += len;
--- a/src/undo.c
+++ b/src/undo.c
@@ -316,7 +316,7 @@ undo_allowed(void)
     // Don't allow changes when 'modifiable' is off.
     if (!curbuf->b_p_ma)
     {
-	emsg(_(e_modifiable));
+	emsg(_(e_cannot_make_changes_modifiable_is_off));
 	return FALSE;
     }
 
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -4864,7 +4864,7 @@ ex_call(exarg_T *eap)
 	    {
 		// If the function deleted lines or switched to another buffer
 		// the line number may become invalid.
-		emsg(_(e_invrange));
+		emsg(_(e_invalid_range));
 		break;
 	    }
 	    curwin->w_cursor.lnum = lnum;
--- a/src/version.c
+++ b/src/version.c
@@ -756,6 +756,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    3069,
+/**/
     3068,
 /**/
     3067,
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -4991,7 +4991,7 @@ compile_expr4(char_u **arg, cctx_T *cctx
 	}
 	if (type_is && (p[len] == '?' || p[len] == '#'))
 	{
-	    semsg(_(e_invexpr2), *arg);
+	    semsg(_(e_invalid_expression_str), *arg);
 	    return FAIL;
 	}
 	// extra question mark appended: ignore case
@@ -5821,7 +5821,7 @@ get_var_dest(
 	if (p == NULL)
 	{
 	    // cannot happen?
-	    emsg(_(e_letunexp));
+	    emsg(_(e_unexpected_characters_in_assignment));
 	    return FAIL;
 	}
 	cc = *p;
--- a/src/window.c
+++ b/src/window.c
@@ -130,7 +130,7 @@ do_window(
     do { \
 	if (cmdwin_type != 0) \
 	{ \
-	    emsg(_(e_cmdwin)); \
+	    emsg(_(e_invalid_in_cmdline_window)); \
 	    return; \
 	} \
     } while (0)
@@ -187,7 +187,7 @@ do_window(
 					? curwin->w_alt_fnum : Prenum) == NULL)
 		{
 		    if (Prenum == 0)
-			emsg(_(e_noalt));
+			emsg(_(e_no_alternate_file));
 		    else
 			semsg(_("E92: Buffer %ld not found"), Prenum);
 		    break;