changeset 26915:3631d2deb36c v8.2.3986

patch 8.2.3986: error messages are spread out Commit: https://github.com/vim/vim/commit/b09feaa86ecc53b9b953710082496951776dc5c6 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jan 2 20:20:45 2022 +0000 patch 8.2.3986: 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 Sun, 02 Jan 2022 21:30:04 +0100
parents 21f9376239a4
children f0c665c309f4
files src/errors.h src/evalvars.c src/ex_cmds.c src/ex_docmd.c src/fileio.c src/fold.c src/gui_x11.c src/hardcopy.c src/help.c src/highlight.c src/if_cscope.c src/json.c src/map.c src/netbeans.c src/popupwin.c src/usercmd.c src/userfunc.c src/version.c
diffstat 18 files changed, 141 insertions(+), 69 deletions(-) [+]
line wrap: on
line diff
--- a/src/errors.h
+++ b/src/errors.h
@@ -1027,21 +1027,58 @@ EXTERN char e_could_not_load_library_fun
 EXTERN char e_invalid_expression_received[]
 	INIT(= N_("E449: Invalid expression received"));
 #endif
-
+EXTERN char e_buffer_number_text_or_list_required[]
+	INIT(= N_("E450: buffer number, text or a list required"));
+EXTERN char e_expected_right_curly_str[]
+	INIT(= N_("E451: Expected }: %s"));
+#ifdef FEAT_EVAL
+EXTERN char e_double_semicolon_in_list_of_variables[]
+	INIT(= N_("E452: Double ; in list of variables"));
+#endif
+EXTERN char e_ul_color_unknown[]
+	INIT(= N_("E453: UL color unknown"));
+EXTERN char e_function_list_was_modified[]
+	INIT(= N_("E454: function list was modified"));
+#ifdef FEAT_POSTSCRIPT
+EXTERN char e_error_writing_to_postscript_output_file[]
+	INIT(= N_("E455: Error writing to PostScript output file"));
+EXTERN char e_cant_open_file_str_2[]
+	INIT(= N_("E456: Can't open file \"%s\""));
+EXTERN char e_cant_find_postscript_resource_file_str_ps[]
+	INIT(= N_("E456: Can't find PostScript resource file \"%s.ps\""));
+EXTERN char e_cant_read_postscript_resource_file_str[]
+	INIT(= N_("E457: Can't read PostScript resource file \"%s\""));
+#endif
+EXTERN char e_cannot_allocate_colormap_entry_some_colors_may_be_incorrect[]
+	INIT(= N_("E458: Cannot allocate colormap entry, some colors may be incorrect"));
 #if defined(UNIX) || defined(FEAT_SESSION)
 EXTERN char e_cannot_go_back_to_previous_directory[]
 	INIT(= N_("E459: Cannot go back to previous directory"));
 #endif
+EXTERN char e_entries_missing_in_mapset_dict_argument[]
+	INIT(= N_("E460: entries missing in mapset() dict argument"));
 #ifdef FEAT_EVAL
 EXTERN char e_illegal_variable_name_str[]
 	INIT(= N_("E461: Illegal variable name: %s"));
 #endif
+EXTERN char e_could_not_prepare_for_reloading_str[]
+	INIT(= N_("E462: Could not prepare for reloading \"%s\""));
 #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_winsize_requires_two_number_arguments[]
+	INIT(= N_("E465: :winsize requires two number arguments"));
+EXTERN char e_winpos_requires_two_number_arguments[]
+	INIT(= N_("E466: :winpos requires two number arguments"));
+EXTERN char e_custom_completion_requires_function_argument[]
+	INIT(= N_("E467: Custom completion requires a function argument"));
+EXTERN char e_completion_argument_only_allowed_for_custom_completion[]
+	INIT(= N_("E468: Completion argument only allowed for custom completion"));
+EXTERN char e_invalid_cscopequickfix_flag_chr_for_chr[]
+	INIT(= N_("E469: invalid cscopequickfix flag %c for %c"));
 EXTERN char e_command_aborted[]
 	INIT(= N_("E470: Command aborted"));
 EXTERN char e_argument_required[]
@@ -1060,12 +1097,20 @@ EXTERN char e_invalid_value_for_argument
 	INIT(= N_("E475: Invalid value for argument %s: %s"));
 EXTERN char e_invalid_command[]
 	INIT(= N_("E476: Invalid command"));
-EXTERN char e_no_bang_allowed[]
-	INIT(= N_("E477: No ! allowed"));
 #ifdef FEAT_EVAL
 EXTERN char e_invalid_command_str[]
 	INIT(= N_("E476: Invalid command: %s"));
 #endif
+EXTERN char e_no_bang_allowed[]
+	INIT(= N_("E477: No ! allowed"));
+EXTERN char e_dont_panic[]
+	INIT(= N_("E478: Don't panic!"));
+EXTERN char e_no_match[]
+	INIT(= N_("E479: No match"));
+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_cant_create_file_str[]
 	INIT(= N_("E482: Can't create file %s"));
 EXTERN char e_cant_get_temp_file_name[]
@@ -1080,30 +1125,56 @@ EXTERN char e_pattern_not_found_str[]
 	INIT(= N_("E486: Pattern not found: %s"));
 EXTERN char e_argument_must_be_positive[]
 	INIT(= N_("E487: Argument must be positive"));
-EXTERN char e_no_match[]
-	INIT(= N_("E479: No match"));
-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"));
-
+EXTERN char e_no_call_stack_to_substitute_for_stack[]
+	INIT(= N_("E489: no call stack to substitute for \"<stack>\""));
+#ifdef FEAT_FOLDING
+EXTERN char e_no_fold_found[]
+	INIT(= N_("E490: No fold found"));
+#endif
+#ifdef FEAT_EVAL
+EXTERN char e_json_decode_error_at_str[]
+	INIT(= N_("E491: json decode error at '%s'"));
+#endif
+EXTERN char e_not_an_editor_command[]
+	INIT(= N_("E492: Not an editor command"));
+EXTERN char e_backwards_range_given[]
+	INIT(= N_("E493: Backwards range given"));
+EXTERN char e_use_w_or_w_gt_gt[]
+	INIT(= N_("E494: Use w or w>>"));
+EXTERN char e_no_autocommand_file_name_to_substitute_for_afile[]
+	INIT(= N_("E495: no autocommand file name to substitute for \"<afile>\""));
+EXTERN char e_no_autocommand_buffer_name_to_substitute_for_abuf[]
+	INIT(= N_("E496: no autocommand buffer number to substitute for \"<abuf>\""));
+EXTERN char e_no_autocommand_match_name_to_substitute_for_amatch[]
+	INIT(= N_("E497: no autocommand match name to substitute for \"<amatch>\""));
+EXTERN char e_no_source_file_name_to_substitute_for_sfile[]
+	INIT(= N_("E498: no :source file name to substitute for \"<sfile>\""));
+EXTERN char e_empty_file_name_for_percent_or_hash_only_works_with_ph[]
+	INIT(= N_("E499: Empty file name for '%' or '#', only works with \":p:h\""));
+EXTERN char e_evaluates_to_an_empty_string[]
+	INIT(= N_("E500: Evaluates to an empty string"));
+EXTERN char e_at_end_of_file[]
+	INIT(= N_("E501: At end-of-file"));
 	// E502
 EXTERN char e_is_a_directory[]
 	INIT(= N_("is a directory"));
 	// E503
 EXTERN char e_is_not_file_or_writable_device[]
 	INIT(= N_("is not a file or writable device"));
-
+EXTERN char e_str_is_not_file_or_writable_device[]
+	INIT(= N_("E503: \"%s\" is not a file or writable device"));
 	// E504
 EXTERN char e_is_read_only_cannot_override_W_in_cpoptions[]
 	INIT(= N_("is read-only (cannot override: \"W\" in 'cpoptions')"));
 	// E505
 EXTERN char e_is_read_only_add_bang_to_override[]
 	INIT(= N_("is read-only (add ! to override)"));
+EXTERN char e_str_is_read_only_add_bang_to_override[]
+	INIT(= N_("E505: \"%s\" is read-only (add ! to override)"));
 EXTERN char e_canot_write_to_backup_file_add_bang_to_override[]
 	INIT(= N_("E506: Can't write to backup file (add ! to override)"));
 EXTERN char e_close_error_for_backup_file_add_bang_to_write_anyway[]
@@ -1114,6 +1185,10 @@ EXTERN char e_cannot_create_backup_file_
 	INIT(= N_("E509: Cannot create backup file (add ! to override)"));
 EXTERN char e_cant_make_backup_file_add_bang_to_write_anyway[]
 	INIT(= N_("E510: Can't make backup file (add ! to write anyway)"));
+#ifdef FEAT_NETBEANS_INTG
+EXTERN char e_netbeans_already_connected[]
+	INIT(= N_("E511: netbeans already connected"));
+#endif
 EXTERN char e_close_failed[]
 	INIT(= N_("E512: Close failed"));
 EXTERN char e_write_error_conversion_failed_make_fenc_empty_to_override[]
@@ -1128,6 +1203,7 @@ 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[]
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -1063,7 +1063,7 @@ skip_var_list(
 	    {
 		if (*semicolon == 1)
 		{
-		    emsg(_("E452: Double ; in list of variables"));
+		    emsg(_(e_double_semicolon_in_list_of_variables));
 		    return NULL;
 		}
 		*semicolon = 1;
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -1862,7 +1862,7 @@ check_writable(char_u *fname)
 {
     if (mch_nodetype(fname) == NODE_OTHER)
     {
-	semsg(_("E503: \"%s\" is not a file or writable device"), fname);
+	semsg(_(e_str_is_not_file_or_writable_device), fname);
 	return FAIL;
     }
     return OK;
@@ -2357,8 +2357,7 @@ check_readonly(int *forceit, buf_T *buf)
 	if (buf->b_p_ro)
 	    emsg(_(e_readonly_option_is_set_add_bang_to_override));
 	else
-	    semsg(_("E505: \"%s\" is read-only (add ! to override)"),
-		    buf->b_fname);
+	    semsg(_(e_str_is_read_only_add_bang_to_override), buf->b_fname);
 	return TRUE;
     }
 
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -543,7 +543,7 @@ do_exmode(
 	    if (curbuf->b_ml.ml_flags & ML_EMPTY)
 		emsg(_(e_empty_buffer));
 	    else
-		emsg(_("E501: At end-of-file"));
+		emsg(_(e_at_end_of_file));
 	}
     }
 
@@ -2015,7 +2015,7 @@ do_one_cmd(
     {
 	if (!ea.skip)
 	{
-	    STRCPY(IObuff, _("E492: Not an editor command"));
+	    STRCPY(IObuff, _(e_not_an_editor_command));
 	    if (!sourcing)
 	    {
 		// If the modifier was parsed OK the error must be in the
@@ -2152,7 +2152,7 @@ do_one_cmd(
 	    {
 		if (sourcing || exmode_active)
 		{
-		    errormsg = _("E493: Backwards range given");
+		    errormsg = _(e_backwards_range_given);
 		    goto doend;
 		}
 		if (ask_yesno((char_u *)
@@ -2225,7 +2225,7 @@ do_one_cmd(
 	{
 	    if (*++ea.arg != '>')		// typed wrong
 	    {
-		errormsg = _("E494: Use w or w>>");
+		errormsg = _(e_use_w_or_w_gt_gt);
 		goto doend;
 	    }
 	    ea.arg = skipwhite(ea.arg + 1);
@@ -7644,7 +7644,7 @@ ex_winsize(exarg_T *eap)
     if (*p != NUL && *arg == NUL)
 	set_shellsize(w, h, TRUE);
     else
-	emsg(_("E465: :winsize requires two number arguments"));
+	emsg(_(e_winsize_requires_two_number_arguments));
 }
 
     static void
@@ -7725,7 +7725,7 @@ ex_winpos(exarg_T *eap)
 	y = getdigits(&arg);
 	if (*p == NUL || *arg != NUL)
 	{
-	    emsg(_("E466: :winpos requires two number arguments"));
+	    emsg(_(e_winpos_requires_two_number_arguments));
 	    return;
 	}
 # ifdef FEAT_GUI
@@ -9104,7 +9104,7 @@ eval_vars(
 		}
 		if (result == NULL)
 		{
-		    *errormsg = _("E495: no autocommand file name to substitute for \"<afile>\"");
+		    *errormsg = _(e_no_autocommand_file_name_to_substitute_for_afile);
 		    return NULL;
 		}
 		result = shorten_fname1(result);
@@ -9113,7 +9113,7 @@ eval_vars(
 	case SPEC_ABUF:		// buffer number for autocommand
 		if (autocmd_bufnr <= 0)
 		{
-		    *errormsg = _("E496: no autocommand buffer number to substitute for \"<abuf>\"");
+		    *errormsg = _(e_no_autocommand_buffer_name_to_substitute_for_abuf);
 		    return NULL;
 		}
 		sprintf((char *)strbuf, "%d", autocmd_bufnr);
@@ -9124,7 +9124,7 @@ eval_vars(
 		result = autocmd_match;
 		if (result == NULL)
 		{
-		    *errormsg = _("E497: no autocommand match name to substitute for \"<amatch>\"");
+		    *errormsg = _(e_no_autocommand_match_name_to_substitute_for_amatch);
 		    return NULL;
 		}
 		break;
@@ -9136,8 +9136,8 @@ eval_vars(
 		if (result == NULL)
 		{
 		    *errormsg = spec_idx == SPEC_SFILE
-			? _("E498: no :source file name to substitute for \"<sfile>\"")
-			: _("E489: no call stack to substitute for \"<stack>\"");
+			? _(e_no_source_file_name_to_substitute_for_sfile)
+			: _(e_no_call_stack_to_substitute_for_stack);
 		    return NULL;
 		}
 		resultbuf = result;	    // remember allocated string
@@ -9212,9 +9212,9 @@ eval_vars(
     {
 	if (valid != VALID_HEAD + VALID_PATH)
 	    // xgettext:no-c-format
-	    *errormsg = _("E499: Empty file name for '%' or '#', only works with \":p:h\"");
+	    *errormsg = _(e_empty_file_name_for_percent_or_hash_only_works_with_ph);
 	else
-	    *errormsg = _("E500: Evaluates to an empty string");
+	    *errormsg = _(e_evaluates_to_an_empty_string);
 	result = NULL;
     }
     else
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -4385,8 +4385,7 @@ buf_reload(buf_T *buf, int orig_mode)
 	    if (savebuf == NULL || saved == FAIL || buf != curbuf
 				      || move_lines(buf, savebuf) == FAIL)
 	    {
-		semsg(_("E462: Could not prepare for reloading \"%s\""),
-							    buf->b_fname);
+		semsg(_(e_could_not_prepare_for_reloading_str), buf->b_fname);
 		saved = FAIL;
 	    }
 	}
--- a/src/fold.c
+++ b/src/fold.c
@@ -65,8 +65,6 @@ static void foldDelMarker(linenr_T lnum,
 static void foldUpdateIEMS(win_T *wp, linenr_T top, linenr_T bot);
 static void parseMarker(win_T *wp);
 
-static char *e_nofold = N_("E490: No fold found");
-
 /*
  * While updating the folds lines between invalid_top and invalid_bot have an
  * undefined fold level.  Only used for the window currently being updated.
@@ -412,7 +410,7 @@ opFoldRange(
 	    (void)hasFolding(lnum, NULL, &lnum_next);
     }
     if (done == DONE_NOTHING)
-	emsg(_(e_nofold));
+	emsg(_(e_no_fold_found));
     // Force a redraw to remove the Visual highlighting.
     if (had_visual)
 	redraw_curbuf_later(INVERTED);
@@ -785,7 +783,7 @@ deleteFold(
     }
     if (!did_one)
     {
-	emsg(_(e_nofold));
+	emsg(_(e_no_fold_found));
 	// Force a redraw to remove the Visual highlighting.
 	if (had_visual)
 	    redraw_curbuf_later(INVERTED);
@@ -1235,7 +1233,7 @@ setFoldRepeat(linenr_T lnum, long count,
 	{
 	    // Only give an error message when no fold could be opened.
 	    if (n == 0 && !(done & DONE_FOLD))
-		emsg(_(e_nofold));
+		emsg(_(e_no_fold_found));
 	    break;
 	}
     }
@@ -1387,7 +1385,7 @@ setManualFoldWin(
 	done |= DONE_FOLD;
     }
     else if (donep == NULL && wp == curwin)
-	emsg(_(e_nofold));
+	emsg(_(e_no_fold_found));
 
     if (donep != NULL)
 	*donep |= done;
--- a/src/gui_x11.c
+++ b/src/gui_x11.c
@@ -1463,7 +1463,7 @@ gui_mch_init(void)
     }
 
     if (gui.color_approx)
-	emsg(_("Vim E458: Cannot allocate colormap entry, some colors may be incorrect"));
+	emsg(_(e_cannot_allocate_colormap_entry_some_colors_may_be_incorrect));
 
 #ifdef FEAT_BEVAL_GUI
     gui_init_tooltip_font();
--- a/src/hardcopy.c
+++ b/src/hardcopy.c
@@ -1405,7 +1405,7 @@ prt_write_file_raw_len(char_u *buffer, i
 	    && fwrite(buffer, sizeof(char_u), bytes, prt_ps_fd)
 							     != (size_t)bytes)
     {
-	emsg(_("E455: Error writing to PostScript output file"));
+	emsg(_(e_error_writing_to_postscript_output_file));
 	prt_file_error = TRUE;
     }
 }
@@ -1849,7 +1849,7 @@ prt_open_resource(struct prt_ps_resource
 					    PRT_FILE_BUFFER_LEN, fd_resource);
     if (ferror(fd_resource))
     {
-	semsg(_("E457: Can't read PostScript resource file \"%s\""),
+	semsg(_(e_cant_read_postscript_resource_file_str),
 		resource->filename);
 	fclose(fd_resource);
 	return FALSE;
@@ -2675,7 +2675,7 @@ prt_add_resource(struct prt_ps_resource_
     fd_resource = mch_fopen((char *)resource->filename, READBIN);
     if (fd_resource == NULL)
     {
-	semsg(_("E456: Can't open file \"%s\""), resource->filename);
+	semsg(_(e_cant_open_file_str_2), resource->filename);
 	return FALSE;
     }
     prt_dsc_resources("BeginResource", prt_resource_types[resource->type],
@@ -2689,7 +2689,7 @@ prt_add_resource(struct prt_ps_resource_
 			   sizeof(resource_buffer), fd_resource);
 	if (ferror(fd_resource))
 	{
-	    semsg(_("E457: Can't read PostScript resource file \"%s\""),
+	    semsg(_(e_cant_read_postscript_resource_file_str),
 							    resource->filename);
 	    fclose(fd_resource);
 	    return FALSE;
@@ -2805,7 +2805,7 @@ mch_print_begin(prt_settings_T *psetting
     // Search for external resources VIM supplies
     if (!prt_find_resource("prolog", res_prolog))
     {
-	emsg(_("E456: Can't find PostScript resource file \"prolog.ps\""));
+	semsg(_(e_cant_find_postscript_resource_file_str_ps), "prolog");
 	goto theend;
     }
     if (!prt_open_resource(res_prolog))
@@ -2817,7 +2817,7 @@ mch_print_begin(prt_settings_T *psetting
 	// Look for required version of multi-byte printing procset
 	if (!prt_find_resource("cidfont", res_cidfont))
 	{
-	    emsg(_("E456: Can't find PostScript resource file \"cidfont.ps\""));
+	    semsg(_(e_cant_find_postscript_resource_file_str_ps), "cidfont");
 	    goto theend;
 	}
 	if (!prt_open_resource(res_cidfont))
@@ -2849,7 +2849,7 @@ mch_print_begin(prt_settings_T *psetting
 		p_encoding = (char_u *)"latin1";
 		if (!prt_find_resource((char *)p_encoding, res_encoding))
 		{
-		    semsg(_("E456: Can't find PostScript resource file \"%s.ps\""),
+		    semsg(_(e_cant_find_postscript_resource_file_str_ps),
 			    p_encoding);
 		    goto theend;
 		}
@@ -2870,7 +2870,7 @@ mch_print_begin(prt_settings_T *psetting
 	    // Include ASCII range encoding vector
 	    if (!prt_find_resource(prt_ascii_encoding, res_encoding))
 	    {
-		semsg(_("E456: Can't find PostScript resource file \"%s.ps\""),
+		semsg(_(e_cant_find_postscript_resource_file_str_ps),
 							  prt_ascii_encoding);
 		goto theend;
 	    }
@@ -2899,8 +2899,7 @@ mch_print_begin(prt_settings_T *psetting
 	// Find user supplied CMap
 	if (!prt_find_resource(prt_cmap, res_cmap))
 	{
-	    semsg(_("E456: Can't find PostScript resource file \"%s.ps\""),
-								    prt_cmap);
+	    semsg(_(e_cant_find_postscript_resource_file_str_ps), prt_cmap);
 	    goto theend;
 	}
 	if (!prt_open_resource(res_cmap))
--- a/src/help.c
+++ b/src/help.c
@@ -60,7 +60,7 @@ ex_help(exarg_T *eap)
 
 	if (eap->forceit && *arg == NUL && !curbuf->b_help)
 	{
-	    emsg(_("E478: Don't panic!"));
+	    emsg(_(e_dont_panic));
 	    return;
 	}
 
--- a/src/highlight.c
+++ b/src/highlight.c
@@ -1053,7 +1053,7 @@ highlight_set_cterm_color(
 		color = cterm_normal_ul_color - 1;
 	    else
 	    {
-		emsg(_("E453: UL color unknown"));
+		emsg(_(e_ul_color_unknown));
 		return FALSE;
 	    }
 	}
--- a/src/if_cscope.c
+++ b/src/if_cscope.c
@@ -1105,7 +1105,8 @@ cs_find_common(
 	// next symbol must be + or -
 	if (strchr(CSQF_FLAGS, *qfpos) == NULL)
 	{
-	    (void)semsg(_("E469: invalid cscopequickfix flag %c for %c"), *qfpos, *(qfpos - 1));
+	    (void)semsg(_(e_invalid_cscopequickfix_flag_chr_for_chr),
+							 *qfpos, *(qfpos - 1));
 	    return FALSE;
 	}
 
--- a/src/json.c
+++ b/src/json.c
@@ -20,8 +20,6 @@
 
 static int json_encode_item(garray_T *gap, typval_T *val, int copyID, int options);
 
-static char e_json_error[] = N_("E491: json decode error at '%s'");
-
 /*
  * Encode "val" into a JSON format string.
  * The result is added to "gap"
@@ -740,7 +738,7 @@ json_decode_item(js_read_T *reader, typv
 			retval = json_decode_string(reader, cur_item, *p);
 		    else
 		    {
-			semsg(_(e_json_error), p);
+			semsg(_(e_json_decode_error_at_str), p);
 			retval = FAIL;
 		    }
 		    break;
@@ -748,7 +746,7 @@ json_decode_item(js_read_T *reader, typv
 		case ',': // comma: empty item
 		    if ((options & JSON_JS) == 0)
 		    {
-			semsg(_(e_json_error), p);
+			semsg(_(e_json_decode_error_at_str), p);
 			retval = FAIL;
 			break;
 		    }
@@ -778,7 +776,7 @@ json_decode_item(js_read_T *reader, typv
 			    }
 			    if (!VIM_ISDIGIT(*sp))
 			    {
-				semsg(_(e_json_error), p);
+				semsg(_(e_json_decode_error_at_str), p);
 				retval = FAIL;
 				break;
 			    }
@@ -810,7 +808,7 @@ json_decode_item(js_read_T *reader, typv
 				    &nr, NULL, 0, TRUE);
 			    if (len == 0)
 			    {
-				semsg(_(e_json_error), p);
+				semsg(_(e_json_decode_error_at_str), p);
 				retval = FAIL;
 				goto theend;
 			    }
@@ -971,7 +969,7 @@ item_end:
 			retval = MAYBE;
 		    else
 		    {
-			semsg(_(e_json_error), p);
+			semsg(_(e_json_decode_error_at_str), p);
 			retval = FAIL;
 		    }
 		    goto theend;
@@ -989,7 +987,7 @@ item_end:
 			retval = MAYBE;
 		    else
 		    {
-			semsg(_(e_json_error), p);
+			semsg(_(e_json_decode_error_at_str), p);
 			retval = FAIL;
 		    }
 		    goto theend;
@@ -1044,7 +1042,7 @@ item_end:
 			retval = MAYBE;
 		    else
 		    {
-			semsg(_(e_json_error), p);
+			semsg(_(e_json_decode_error_at_str), p);
 			retval = FAIL;
 		    }
 		    goto theend;
@@ -1063,7 +1061,7 @@ item_end:
 	res->v_type = VAR_SPECIAL;
 	res->vval.v_number = VVAL_NONE;
     }
-    semsg(_(e_json_error), p);
+    semsg(_(e_json_decode_error_at_str), p);
 
 theend:
     for (i = 0; i < stack.ga_len; i++)
@@ -1090,7 +1088,7 @@ json_decode_all(js_read_T *reader, typva
     if (ret != OK)
     {
 	if (ret == MAYBE)
-	    semsg(_(e_json_error), reader->js_buf);
+	    semsg(_(e_json_decode_error_at_str), reader->js_buf);
 	return FAIL;
     }
     json_skip_white(reader);
--- a/src/map.c
+++ b/src/map.c
@@ -2374,7 +2374,7 @@ f_mapset(typval_T *argvars, typval_T *re
     rhs = dict_get_string(d, (char_u *)"rhs", FALSE);
     if (lhs == NULL || lhsraw == NULL || rhs == NULL)
     {
-	emsg(_("E460: entries missing in mapset() dict argument"));
+	emsg(_(e_entries_missing_in_mapset_dict_argument));
 	return;
     }
     orig_rhs = rhs;
--- a/src/netbeans.c
+++ b/src/netbeans.c
@@ -2515,7 +2515,7 @@ netbeans_open(char *params, int doabort)
 
     if (NETBEANS_OPEN)
     {
-	emsg(_("E511: netbeans already connected"));
+	emsg(_(e_netbeans_already_connected));
 	return;
     }
 
@@ -3481,7 +3481,7 @@ print_save_msg(nbbuf_T *buf, off_T nchar
 	char msgbuf[IOSIZE];
 
 	vim_snprintf(msgbuf, IOSIZE,
-		       _("E505: %s is read-only (add ! to override)"), IObuff);
+		       _(e_is_read_only_add_bang_to_override), IObuff);
 	nbdebug(("    %s\n", msgbuf));
 	emsg(msgbuf);
     }
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -1893,7 +1893,7 @@ popup_create(typval_T *argvars, typval_T
 		    && !(argvars[0].v_type == VAR_LIST
 			&& argvars[0].vval.v_list != NULL))
 	{
-	    emsg(_("E450: buffer number, text or a list required"));
+	    emsg(_(e_buffer_number_text_or_list_required));
 	    return NULL;
 	}
 	if (argvars[1].v_type != VAR_DICT || argvars[1].vval.v_dict == NULL)
--- a/src/usercmd.c
+++ b/src/usercmd.c
@@ -689,7 +689,7 @@ parse_compl_arg(
     if (arg != NULL)
 # endif
     {
-	emsg(_("E468: Completion argument only allowed for custom completion"));
+	emsg(_(e_completion_argument_only_allowed_for_custom_completion));
 	return FAIL;
     }
 
@@ -697,7 +697,7 @@ parse_compl_arg(
     if ((*complp == EXPAND_USER_DEFINED || *complp == EXPAND_USER_LIST)
 							       && arg == NULL)
     {
-	emsg(_("E467: Custom completion requires a function argument"));
+	emsg(_(e_custom_completion_requires_function_argument));
 	return FAIL;
     }
 
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -1415,7 +1415,7 @@ get_lambda_tv(
 	*arg = skipwhite_and_linebreak(*arg, evalarg);
 	if (**arg != '}')
 	{
-	    semsg(_("E451: Expected }: %s"), *arg);
+	    semsg(_(e_expected_right_curly_str), *arg);
 	    goto errret;
 	}
 	++*arg;
@@ -4001,7 +4001,7 @@ list_functions(regmatch_T *regmatch)
 		list_func_head(fp, FALSE);
 		if (changed != func_hashtab.ht_changed)
 		{
-		    emsg(_("E454: function list was modified"));
+		    emsg(_(e_function_list_was_modified));
 		    return;
 		}
 	    }
--- 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 */
 /**/
+    3986,
+/**/
     3985,
 /**/
     3984,