changeset 15470:55ccc2d353bd v8.1.0743

patch 8.1.0743: giving error messages is not flexible commit https://github.com/vim/vim/commit/f9e3e09fdc93be9f0d47afbc6c7df1188c2a5a0d Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jan 13 23:38:42 2019 +0100 patch 8.1.0743: giving error messages is not flexible Problem: Giving error messages is not flexible. Solution: Add semsg(). Change argument from "char_u *" to "char *", also for msg() and get rid of most MSG macros. (Ozaki Kiichi, closes #3302) Also make emsg() accept a "char *" argument. Get rid of an enormous number of type casts.
author Bram Moolenaar <Bram@vim.org>
date Sun, 13 Jan 2019 23:45:08 +0100
parents bc9b5261ed01
children c3aa513f6b0b
files src/blob.c src/blowfish.c src/buffer.c src/channel.c src/crypt.c src/dict.c src/diff.c src/digraph.c src/edit.c src/eval.c src/evalfunc.c src/ex_cmds.c src/ex_cmds.h src/ex_cmds2.c src/ex_docmd.c src/ex_eval.c src/ex_getln.c src/farsi.h src/fileio.c src/fold.c src/getchar.c src/globals.h src/gui.c src/gui_at_fs.c src/gui_at_sb.c src/gui_beval.c src/gui_gtk_x11.c src/gui_mac.c src/gui_photon.c src/gui_w32.c src/gui_x11.c src/hangulin.c src/hardcopy.c src/hashtab.c src/if_cscope.c src/if_lua.c src/if_mzsch.c src/if_perl.xs src/if_py_both.h src/if_python.c src/if_python3.c src/if_ruby.c src/if_tcl.c src/if_xcmdsrv.c src/json.c src/list.c src/main.c src/mark.c src/mbyte.c src/memfile.c src/memline.c src/menu.c src/message.c src/misc1.c src/misc2.c src/netbeans.c src/normal.c src/ops.c src/option.c src/os_amiga.c src/os_mswin.c src/os_unix.c src/os_win32.c src/popupmnu.c src/proto.h src/proto/buffer.pro src/proto/digraph.pro src/proto/ex_docmd.pro src/proto/ex_eval.pro src/proto/ex_getln.pro src/proto/hardcopy.pro src/proto/mbyte.pro src/proto/message.pro src/proto/misc2.pro src/proto/option.pro src/proto/spell.pro src/quickfix.c src/regexp.c src/regexp_nfa.c src/search.c src/sign.c src/spell.c src/spellfile.c src/structs.h src/syntax.c src/tag.c src/term.c src/terminal.c src/textprop.c src/ui.c src/undo.c src/userfunc.c src/version.c src/vim.h src/window.c
diffstat 95 files changed, 1967 insertions(+), 2022 deletions(-) [+]
line wrap: on
line diff
--- a/src/blob.c
+++ b/src/blob.c
@@ -161,7 +161,7 @@ write_blob(FILE *fd, blob_T *blob)
     if (fwrite(blob->bv_ga.ga_data, 1, blob->bv_ga.ga_len, fd)
 						  < (size_t)blob->bv_ga.ga_len)
     {
-	EMSG(_(e_write));
+	emsg(_(e_write));
 	return FAIL;
     }
     return OK;
--- a/src/blowfish.c
+++ b/src/blowfish.c
@@ -419,7 +419,7 @@ bf_key_init(
     keylen = (int)STRLEN(key) / 2;
     if (keylen == 0)
     {
-	IEMSG(_("E831: bf_key_init() called with empty password"));
+	iemsg(_("E831: bf_key_init() called with empty password"));
 	return;
     }
     for (i = 0; i < keylen; i++)
@@ -522,7 +522,7 @@ bf_self_test(void)
      * warning. */
     if (ui != 0xffffffffUL || ui + 1 != 0) {
 	err++;
-	EMSG(_("E820: sizeof(uint32_t) != 4"));
+	emsg(_("E820: sizeof(uint32_t) != 4"));
     }
 
     if (!bf_check_tables(pax_init, sbx_init, 0x6ffa520a))
@@ -543,7 +543,7 @@ bf_self_test(void)
 	if (memcmp(bk.uc, bf_test_data[i].cryptxt, 8) != 0)
 	{
 	    if (err == 0 && memcmp(bk.uc, bf_test_data[i].badcryptxt, 8) == 0)
-		EMSG(_("E817: Blowfish big/little endian use wrong"));
+		emsg(_("E817: Blowfish big/little endian use wrong"));
 	    err++;
 	}
     }
@@ -669,12 +669,12 @@ blowfish_self_test(void)
 {
     if (sha256_self_test() == FAIL)
     {
-	EMSG(_("E818: sha256 test failed"));
+	emsg(_("E818: sha256 test failed"));
 	return FAIL;
     }
     if (bf_self_test() == FAIL)
     {
-	EMSG(_("E819: Blowfish test failed"));
+	emsg(_("E819: Blowfish test failed"));
 	return FAIL;
     }
     return OK;
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -162,10 +162,10 @@ open_buffer(
 	 */
 	if (curbuf == NULL)
 	{
-	    EMSG(_("E82: Cannot allocate any buffer, exiting..."));
+	    emsg(_("E82: Cannot allocate any buffer, exiting..."));
 	    getout(2);
 	}
-	EMSG(_("E83: Cannot allocate buffer, using other one..."));
+	emsg(_("E83: Cannot allocate buffer, using other one..."));
 	enter_buffer(curbuf);
 #ifdef FEAT_SYN_HL
 	if (old_tw != curbuf->b_p_tw)
@@ -396,7 +396,7 @@ buf_hashtab_add(buf_T *buf)
 {
     sprintf((char *)buf->b_key, "%x", buf->b_fnum);
     if (hash_add(&buf_hashtab, buf->b_key) == FAIL)
-	EMSG(_("E931: Buffer cannot be registered"));
+	emsg(_("E931: Buffer cannot be registered"));
 }
 
     static void
@@ -430,7 +430,7 @@ can_unload_buffer(buf_T *buf)
 	    }
     }
     if (!can_unload)
-	EMSG(_("E937: Attempt to delete a buffer that is in use"));
+	emsg(_("E937: Attempt to delete a buffer that is in use"));
     return can_unload;
 }
 
@@ -548,7 +548,7 @@ close_buffer(
 	{
 	    /* Autocommands deleted the buffer. */
 aucmd_abort:
-	    EMSG(_(e_auabort));
+	    emsg(_(e_auabort));
 	    return;
 	}
 	--buf->b_locked;
@@ -1115,7 +1115,7 @@ handle_swap_exists(bufref_T *old_curbuf)
  *
  * Returns error message or NULL
  */
-    char_u *
+    char *
 do_bufdel(
     int		command,
     char_u	*arg,		/* pointer to extra arguments */
@@ -1126,7 +1126,7 @@ do_bufdel(
 {
     int		do_current = 0;	/* delete current buffer? */
     int		deleted = 0;	/* number of buffers deleted */
-    char_u	*errormsg = NULL; /* return value */
+    char	*errormsg = NULL; /* return value */
     int		bnr;		/* buffer number */
     char_u	*p;
 
@@ -1139,7 +1139,7 @@ do_bufdel(
 	if (addr_count == 2)
 	{
 	    if (*arg)		/* both range and argument is not allowed */
-		return (char_u *)_(e_trailing);
+		return _(e_trailing);
 	    bnr = start_bnr;
 	}
 	else	/* addr_count == 1 */
@@ -1197,18 +1197,18 @@ do_bufdel(
 		STRCPY(IObuff, _("E516: No buffers were deleted"));
 	    else
 		STRCPY(IObuff, _("E517: No buffers were wiped out"));
-	    errormsg = IObuff;
+	    errormsg = (char *)IObuff;
 	}
 	else if (deleted >= p_report)
 	{
 	    if (command == DOBUF_UNLOAD)
-		smsg((char_u *)NGETTEXT("%d buffer unloaded",
+		smsg(NGETTEXT("%d buffer unloaded",
 			    "%d buffers unloaded", deleted), deleted);
 	    else if (command == DOBUF_DEL)
-		smsg((char_u *)NGETTEXT("%d buffer deleted",
+		smsg(NGETTEXT("%d buffer deleted",
 			    "%d buffers deleted", deleted), deleted);
 	    else
-		smsg((char_u *)NGETTEXT("%d buffer wiped out",
+		smsg(NGETTEXT("%d buffer wiped out",
 			    "%d buffers wiped out", deleted), deleted);
 	}
     }
@@ -1233,7 +1233,7 @@ empty_curbuf(
 
     if (action == DOBUF_UNLOAD)
     {
-	EMSG(_("E90: Cannot unload last buffer"));
+	emsg(_("E90: Cannot unload last buffer"));
 	return FAIL;
     }
 
@@ -1307,7 +1307,7 @@ do_buffer(
 	}
 	if (!bufIsChanged(buf))
 	{
-	    EMSG(_("E84: No modified buffer found"));
+	    emsg(_("E84: No modified buffer found"));
 	    return FAIL;
 	}
     }
@@ -1346,7 +1346,7 @@ do_buffer(
 	    if (bp == buf)
 	    {
 		/* back where we started, didn't find anything. */
-		EMSG(_("E85: There is no listed buffer"));
+		emsg(_("E85: There is no listed buffer"));
 		return FAIL;
 	    }
 	}
@@ -1358,12 +1358,12 @@ do_buffer(
 	{
 	    /* don't warn when deleting */
 	    if (!unload)
-		EMSGN(_(e_nobufnr), count);
+		semsg(_(e_nobufnr), count);
 	}
 	else if (dir == FORWARD)
-	    EMSG(_("E87: Cannot go beyond last buffer"));
+	    emsg(_("E87: Cannot go beyond last buffer"));
 	else
-	    EMSG(_("E88: Cannot go before first buffer"));
+	    emsg(_("E88: Cannot go before first buffer"));
 	return FAIL;
     }
 
@@ -1407,7 +1407,7 @@ do_buffer(
 	    else
 #endif
 	    {
-		EMSGN(_("E89: No write since last change for buffer %ld (add ! to override)"),
+		semsg(_("E89: No write since last change for buffer %ld (add ! to override)"),
 								 buf->b_fnum);
 		return FAIL;
 	    }
@@ -1832,10 +1832,10 @@ no_write_message(void)
 {
 #ifdef FEAT_TERMINAL
     if (term_job_running(curbuf->b_term))
-	EMSG(_("E948: Job still running (add ! to end the job)"));
+	emsg(_("E948: Job still running (add ! to end the job)"));
     else
 #endif
-	EMSG(_("E37: No write since last change (add ! to override)"));
+	emsg(_("E37: No write since last change (add ! to override)"));
 }
 
     void
@@ -1843,10 +1843,10 @@ no_write_message_nobang(buf_T *buf UNUSE
 {
 #ifdef FEAT_TERMINAL
     if (term_job_running(buf->b_term))
-	EMSG(_("E948: Job still running"));
+	emsg(_("E948: Job still running"));
     else
 #endif
-	EMSG(_("E37: No write since last change"));
+	emsg(_("E37: No write since last change"));
 }
 
 /*
@@ -2057,7 +2057,7 @@ buflist_new(
 	buf->b_fnum = top_file_num++;
 	if (top_file_num < 0)		/* wrap around (may cause duplicates) */
 	{
-	    EMSG(_("W14: Warning: List of file names overflow"));
+	    emsg(_("W14: Warning: List of file names overflow"));
 	    if (emsg_silent == 0)
 	    {
 		out_flush();
@@ -2281,9 +2281,9 @@ buflist_getfile(
     if (buf == NULL)
     {
 	if ((options & GETF_ALT) && n == 0)
-	    EMSG(_(e_noalt));
+	    emsg(_(e_noalt));
 	else
-	    EMSGN(_("E92: Buffer %ld not found"), n);
+	    semsg(_("E92: Buffer %ld not found"), n);
 	return FAIL;
     }
 
@@ -2568,9 +2568,9 @@ buflist_findpat(
     }
 
     if (match == -2)
-	EMSG2(_("E93: More than one match for %s"), pattern);
+	semsg(_("E93: More than one match for %s"), pattern);
     else if (match < 0)
-	EMSG2(_("E94: No matching buffer for %s"), pattern);
+	semsg(_("E94: No matching buffer for %s"), pattern);
     return match;
 }
 
@@ -3172,7 +3172,7 @@ setfname(
 	    if (obuf->b_ml.ml_mfp != NULL)	/* it's loaded, fail */
 	    {
 		if (message)
-		    EMSG(_("E95: Buffer with this name already exists"));
+		    emsg(_("E95: Buffer with this name already exists"));
 		vim_free(ffname);
 		return FAIL;
 	    }
@@ -3298,7 +3298,7 @@ getaltfname(
     if (buflist_name_nr(0, &fname, &dummy) == FAIL)
     {
 	if (errmsg)
-	    EMSG(_(e_noalt));
+	    emsg(_(e_noalt));
 	return NULL;
     }
     return fname;
@@ -5730,7 +5730,7 @@ bt_dontwrite_msg(buf_T *buf)
 {
     if (bt_dontwrite(buf))
     {
-	EMSG(_("E382: Cannot write, 'buftype' option is set"));
+	emsg(_("E382: Cannot write, 'buftype' option is set"));
 	return TRUE;
     }
     return FALSE;
--- a/src/channel.c
+++ b/src/channel.c
@@ -116,7 +116,7 @@ ch_logfile(char_u *fname, char_u *opt)
 	file = fopen((char *)fname, *opt == 'w' ? "w" : "a");
 	if (file == NULL)
 	{
-	    EMSG2(_(e_notopen), fname);
+	    semsg(_(e_notopen), fname);
 	    return;
 	}
     }
@@ -209,8 +209,7 @@ ch_error(channel_T *ch, const char *fmt,
 
 #ifdef _WIN32
 # undef PERROR
-# define PERROR(msg) (void)emsg3((char_u *)"%s: %s", \
-	(char_u *)msg, (char_u *)strerror_win32(errno))
+# define PERROR(msg) (void)semsg("%s: %s", msg, strerror_win32(errno))
 
     static char *
 strerror_win32(int eno)
@@ -942,7 +941,7 @@ channel_open_func(typval_T *argvars)
     if (argvars[1].v_type != VAR_UNKNOWN
 	 && (argvars[1].v_type != VAR_DICT || argvars[1].vval.v_dict == NULL))
     {
-	EMSG(_(e_invarg));
+	emsg(_(e_invarg));
 	return NULL;
     }
 
@@ -950,7 +949,7 @@ channel_open_func(typval_T *argvars)
     p = vim_strchr(address, ':');
     if (p == NULL)
     {
-	EMSG2(_(e_invarg2), address);
+	semsg(_(e_invarg2), address);
 	return NULL;
     }
     *p++ = NUL;
@@ -958,7 +957,7 @@ channel_open_func(typval_T *argvars)
     if (*address == NUL || port <= 0 || *rest != NUL)
     {
 	p[-1] = ':';
-	EMSG2(_(e_invarg2), address);
+	semsg(_(e_invarg2), address);
 	return NULL;
     }
 
@@ -971,7 +970,7 @@ channel_open_func(typval_T *argvars)
 	goto theend;
     if (opt.jo_timeout < 0)
     {
-	EMSG(_(e_invarg));
+	emsg(_(e_invarg));
 	goto theend;
     }
 
@@ -1233,7 +1232,7 @@ channel_set_options(channel_T *channel, 
 	{
 	    buf = buflist_findnr(opt->jo_io_buf[PART_OUT]);
 	    if (buf == NULL)
-		EMSGN(_(e_nobufnr), (long)opt->jo_io_buf[PART_OUT]);
+		semsg(_(e_nobufnr), (long)opt->jo_io_buf[PART_OUT]);
 	}
 	else
 	{
@@ -1251,7 +1250,7 @@ channel_set_options(channel_T *channel, 
 
 	    if (!buf->b_p_ma && !channel->ch_part[PART_OUT].ch_nomodifiable)
 	    {
-		EMSG(_(e_modifiable));
+		emsg(_(e_modifiable));
 	    }
 	    else
 	    {
@@ -1280,7 +1279,7 @@ channel_set_options(channel_T *channel, 
 	{
 	    buf = buflist_findnr(opt->jo_io_buf[PART_ERR]);
 	    if (buf == NULL)
-		EMSGN(_(e_nobufnr), (long)opt->jo_io_buf[PART_ERR]);
+		semsg(_(e_nobufnr), (long)opt->jo_io_buf[PART_ERR]);
 	}
 	else
 	{
@@ -1297,7 +1296,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_modifiable));
 	    }
 	    else
 	    {
@@ -1619,7 +1618,7 @@ invoke_callback(channel_T *channel, char
     int		dummy;
 
     if (safe_to_invoke_callback == 0)
-	IEMSG("INTERNAL: Invoking callback when it is not safe");
+	iemsg("INTERNAL: Invoking callback when it is not safe");
 
     argv[0].v_type = VAR_CHANNEL;
     argv[0].vval.v_channel = channel;
@@ -2237,7 +2236,7 @@ channel_exe_cmd(channel_T *channel, ch_p
     {
 	ch_error(channel, "received command with non-string argument");
 	if (p_verbose > 2)
-	    EMSG(_("E903: received command with non-string argument"));
+	    emsg(_("E903: received command with non-string argument"));
 	return;
     }
     arg = argv[1].vval.v_string;
@@ -2289,13 +2288,13 @@ channel_exe_cmd(channel_T *channel, ch_p
 	{
 	    ch_error(channel, "last argument for expr/call must be a number");
 	    if (p_verbose > 2)
-		EMSG(_("E904: last argument for expr/call must be a number"));
+		emsg(_("E904: last argument for expr/call must be a number"));
 	}
 	else if (is_call && argv[2].v_type != VAR_LIST)
 	{
 	    ch_error(channel, "third argument for call must be a list");
 	    if (p_verbose > 2)
-		EMSG(_("E904: third argument for call must be a list"));
+		emsg(_("E904: third argument for call must be a list"));
 	}
 	else
 	{
@@ -2351,7 +2350,7 @@ channel_exe_cmd(channel_T *channel, ch_p
     else if (p_verbose > 2)
     {
 	ch_error(channel, "Received unknown command: %s", (char *)cmd);
-	EMSG2(_("E905: received unknown command: %s"), cmd);
+	semsg(_("E905: received unknown command: %s"), cmd);
     }
 }
 
@@ -3769,7 +3768,7 @@ channel_send(
 	if (!channel->ch_error && fun != NULL)
 	{
 	    ch_error(channel, "%s(): write while not connected", fun);
-	    EMSG2(_("E630: %s(): write while not connected"), fun);
+	    semsg(_("E630: %s(): write while not connected"), fun);
 	}
 	channel->ch_error = TRUE;
 	return FAIL;
@@ -3916,7 +3915,7 @@ channel_send(
 	    if (!channel->ch_error && fun != NULL)
 	    {
 		ch_error(channel, "%s(): write failed", fun);
-		EMSG2(_("E631: %s(): write failed"), fun);
+		semsg(_("E631: %s(): write failed"), fun);
 	    }
 	    channel->ch_error = TRUE;
 	    return FAIL;
@@ -3964,7 +3963,7 @@ send_common(
     {
 	if (eval)
 	{
-	    EMSG2(_("E917: Cannot use a callback with %s()"), fun);
+	    semsg(_("E917: Cannot use a callback with %s()"), fun);
 	    return NULL;
 	}
 	channel_set_req_callback(channel, *part_read,
@@ -4005,7 +4004,7 @@ ch_expr_common(typval_T *argvars, typval
     ch_mode = channel_get_mode(channel, part_send);
     if (ch_mode == MODE_RAW || ch_mode == MODE_NL)
     {
-	EMSG(_("E912: cannot use ch_evalexpr()/ch_sendexpr() with a raw or nl channel"));
+	emsg(_("E912: cannot use ch_evalexpr()/ch_sendexpr() with a raw or nl channel"));
 	return;
     }
 
@@ -4478,7 +4477,7 @@ handle_mode(typval_T *item, jobopt_T *op
 	*modep = MODE_JSON;
     else
     {
-	EMSG2(_(e_invarg2), val);
+	semsg(_(e_invarg2), val);
 	return FAIL;
     }
     return OK;
@@ -4502,7 +4501,7 @@ handle_io(typval_T *item, ch_part_T part
 	opt->jo_io[part] = JIO_OUT;
     else
     {
-	EMSG2(_(e_invarg2), val);
+	semsg(_(e_invarg2), val);
 	return FAIL;
     }
     return OK;
@@ -4576,7 +4575,7 @@ get_job_options(typval_T *tv, jobopt_T *
 	return OK;
     if (tv->v_type != VAR_DICT)
     {
-	EMSG(_(e_dictreq));
+	emsg(_(e_dictreq));
 	return FAIL;
     }
     dict = tv->vval.v_dict;
@@ -4665,12 +4664,12 @@ get_job_options(typval_T *tv, jobopt_T *
 		opt->jo_io_buf[part] = tv_get_number(item);
 		if (opt->jo_io_buf[part] <= 0)
 		{
-		    EMSG3(_(e_invargNval), hi->hi_key, tv_get_string(item));
+		    semsg(_(e_invargNval), hi->hi_key, tv_get_string(item));
 		    return FAIL;
 		}
 		if (buflist_findnr(opt->jo_io_buf[part]) == NULL)
 		{
-		    EMSGN(_(e_nobufnr), (long)opt->jo_io_buf[part]);
+		    semsg(_(e_nobufnr), (long)opt->jo_io_buf[part]);
 		    return FAIL;
 		}
 	    }
@@ -4714,7 +4713,7 @@ get_job_options(typval_T *tv, jobopt_T *
 		*lp = tv_get_number(item);
 		if (*lp < 0)
 		{
-		    EMSG3(_(e_invargNval), hi->hi_key, tv_get_string(item));
+		    semsg(_(e_invargNval), hi->hi_key, tv_get_string(item));
 		    return FAIL;
 		}
 	    }
@@ -4725,7 +4724,7 @@ get_job_options(typval_T *tv, jobopt_T *
 		opt->jo_set |= JO_CHANNEL;
 		if (item->v_type != VAR_CHANNEL)
 		{
-		    EMSG2(_(e_invargval), "channel");
+		    semsg(_(e_invargval), "channel");
 		    return FAIL;
 		}
 		opt->jo_channel = item->vval.v_channel;
@@ -4738,7 +4737,7 @@ get_job_options(typval_T *tv, jobopt_T *
 		opt->jo_callback = get_callback(item, &opt->jo_partial);
 		if (opt->jo_callback == NULL)
 		{
-		    EMSG2(_(e_invargval), "callback");
+		    semsg(_(e_invargval), "callback");
 		    return FAIL;
 		}
 	    }
@@ -4750,7 +4749,7 @@ get_job_options(typval_T *tv, jobopt_T *
 		opt->jo_out_cb = get_callback(item, &opt->jo_out_partial);
 		if (opt->jo_out_cb == NULL)
 		{
-		    EMSG2(_(e_invargval), "out_cb");
+		    semsg(_(e_invargval), "out_cb");
 		    return FAIL;
 		}
 	    }
@@ -4762,7 +4761,7 @@ get_job_options(typval_T *tv, jobopt_T *
 		opt->jo_err_cb = get_callback(item, &opt->jo_err_partial);
 		if (opt->jo_err_cb == NULL)
 		{
-		    EMSG2(_(e_invargval), "err_cb");
+		    semsg(_(e_invargval), "err_cb");
 		    return FAIL;
 		}
 	    }
@@ -4774,7 +4773,7 @@ get_job_options(typval_T *tv, jobopt_T *
 		opt->jo_close_cb = get_callback(item, &opt->jo_close_partial);
 		if (opt->jo_close_cb == NULL)
 		{
-		    EMSG2(_(e_invargval), "close_cb");
+		    semsg(_(e_invargval), "close_cb");
 		    return FAIL;
 		}
 	    }
@@ -4787,7 +4786,7 @@ get_job_options(typval_T *tv, jobopt_T *
 		    never = TRUE;
 		else if (STRCMP(val, "auto") != 0)
 		{
-		    EMSG3(_(e_invargNval), "drop", val);
+		    semsg(_(e_invargNval), "drop", val);
 		    return FAIL;
 		}
 		opt->jo_drop_never = never;
@@ -4800,7 +4799,7 @@ get_job_options(typval_T *tv, jobopt_T *
 		opt->jo_exit_cb = get_callback(item, &opt->jo_exit_partial);
 		if (opt->jo_exit_cb == NULL)
 		{
-		    EMSG2(_(e_invargval), "exit_cb");
+		    semsg(_(e_invargval), "exit_cb");
 		    return FAIL;
 		}
 	    }
@@ -4813,7 +4812,7 @@ get_job_options(typval_T *tv, jobopt_T *
 		opt->jo_term_name = tv_get_string_chk(item);
 		if (opt->jo_term_name == NULL)
 		{
-		    EMSG2(_(e_invargval), "term_name");
+		    semsg(_(e_invargval), "term_name");
 		    return FAIL;
 		}
 	    }
@@ -4824,7 +4823,7 @@ get_job_options(typval_T *tv, jobopt_T *
 		val = tv_get_string(item);
 		if (STRCMP(val, "open") != 0 && STRCMP(val, "close") != 0)
 		{
-		    EMSG3(_(e_invargNval), "term_finish", val);
+		    semsg(_(e_invargNval), "term_finish", val);
 		    return FAIL;
 		}
 		opt->jo_set2 |= JO2_TERM_FINISH;
@@ -4848,7 +4847,7 @@ get_job_options(typval_T *tv, jobopt_T *
 		}
 		if (p == NULL)
 		{
-		    EMSG2(_(e_invargval), "term_opencmd");
+		    semsg(_(e_invargval), "term_opencmd");
 		    return FAIL;
 		}
 	    }
@@ -4862,7 +4861,7 @@ get_job_options(typval_T *tv, jobopt_T *
 		p = opt->jo_eof_chars = tv_get_string_chk(item);
 		if (p == NULL)
 		{
-		    EMSG2(_(e_invargval), "eof_chars");
+		    semsg(_(e_invargval), "eof_chars");
 		    return FAIL;
 		}
 	    }
@@ -4928,7 +4927,7 @@ get_job_options(typval_T *tv, jobopt_T *
 		if (item == NULL || item->v_type != VAR_LIST
 			|| item->vval.v_list == NULL)
 		{
-		    EMSG2(_(e_invargval), "ansi_colors");
+		    semsg(_(e_invargval), "ansi_colors");
 		    return FAIL;
 		}
 
@@ -4951,7 +4950,7 @@ get_job_options(typval_T *tv, jobopt_T *
 
 		if (n != 16 || li != NULL)
 		{
-		    EMSG2(_(e_invargval), "ansi_colors");
+		    semsg(_(e_invargval), "ansi_colors");
 		    return FAIL;
 		}
 
@@ -4966,7 +4965,7 @@ get_job_options(typval_T *tv, jobopt_T *
 		    break;
 		if (item->v_type != VAR_DICT)
 		{
-		    EMSG2(_(e_invargval), "env");
+		    semsg(_(e_invargval), "env");
 		    return FAIL;
 		}
 		opt->jo_set2 |= JO2_ENV;
@@ -4985,7 +4984,7 @@ get_job_options(typval_T *tv, jobopt_T *
 #endif
 				)
 		{
-		    EMSG2(_(e_invargval), "cwd");
+		    semsg(_(e_invargval), "cwd");
 		    return FAIL;
 		}
 		opt->jo_set2 |= JO2_CWD;
@@ -5030,7 +5029,7 @@ get_job_options(typval_T *tv, jobopt_T *
 		    opt->jo_part = PART_OUT;
 		else
 		{
-		    EMSG3(_(e_invargNval), "part", val);
+		    semsg(_(e_invargNval), "part", val);
 		    return FAIL;
 		}
 	    }
@@ -5050,7 +5049,7 @@ get_job_options(typval_T *tv, jobopt_T *
 							     opt->jo_soe_buf);
 		if (opt->jo_stoponexit == NULL)
 		{
-		    EMSG2(_(e_invargval), "stoponexit");
+		    semsg(_(e_invargval), "stoponexit");
 		    return FAIL;
 		}
 	    }
@@ -5067,7 +5066,7 @@ get_job_options(typval_T *tv, jobopt_T *
 	}
     if (todo > 0)
     {
-	EMSG2(_(e_invarg2), hi->hi_key);
+	semsg(_(e_invarg2), hi->hi_key);
 	return FAIL;
     }
 
@@ -5098,7 +5097,7 @@ get_channel_arg(typval_T *tv, int check_
     }
     else
     {
-	EMSG2(_(e_invarg2), tv_get_string(tv));
+	semsg(_(e_invarg2), tv_get_string(tv));
 	return NULL;
     }
     if (channel != NULL && reading)
@@ -5108,7 +5107,7 @@ get_channel_arg(typval_T *tv, int check_
     if (check_open && (channel == NULL || (!channel_is_open(channel)
 					     && !(reading && has_readahead))))
     {
-	EMSG(_("E906: not an open channel"));
+	emsg(_("E906: not an open channel"));
 	return NULL;
     }
     return channel;
@@ -5662,7 +5661,7 @@ job_start(
 		&& (!(opt.jo_set & (JO_OUT_NAME << (part - PART_OUT)))
 		    || *opt.jo_io_name[part] == NUL))
 	{
-	    EMSG(_("E920: _io file requires _name to be set"));
+	    emsg(_("E920: _io file requires _name to be set"));
 	    goto theend;
 	}
 
@@ -5675,11 +5674,11 @@ job_start(
 	{
 	    buf = buflist_findnr(opt.jo_io_buf[PART_IN]);
 	    if (buf == NULL)
-		EMSGN(_(e_nobufnr), (long)opt.jo_io_buf[PART_IN]);
+		semsg(_(e_nobufnr), (long)opt.jo_io_buf[PART_IN]);
 	}
 	else if (!(opt.jo_set & JO_IN_NAME))
 	{
-	    EMSG(_("E915: in_io buffer requires in_buf or in_name to be set"));
+	    emsg(_("E915: in_io buffer requires in_buf or in_name to be set"));
 	}
 	else
 	    buf = buflist_find_by_name(opt.jo_io_name[PART_IN], FALSE);
@@ -5697,7 +5696,7 @@ job_start(
 	    }
 	    else
 		s = opt.jo_io_name[PART_IN];
-	    EMSG2(_("E918: buffer must be loaded: %s"), s);
+	    semsg(_("E918: buffer must be loaded: %s"), s);
 	    goto theend;
 	}
 	job->jv_in_buf = buf;
@@ -5726,7 +5725,7 @@ job_start(
 	cmd = argvars[0].vval.v_string;
 	if (cmd == NULL || *cmd == NUL)
 	{
-	    EMSG(_(e_invarg));
+	    emsg(_(e_invarg));
 	    goto theend;
 	}
 
@@ -5737,7 +5736,7 @@ job_start(
 	    || argvars[0].vval.v_list == NULL
 	    || argvars[0].vval.v_list->lv_len < 1)
     {
-	EMSG(_(e_invarg));
+	emsg(_(e_invarg));
 	goto theend;
     }
     else
@@ -5898,7 +5897,7 @@ job_stop(job_T *job, typval_T *argvars, 
 	arg = tv_get_string_chk(&argvars[1]);
 	if (arg == NULL)
 	{
-	    EMSG(_(e_invarg));
+	    emsg(_(e_invarg));
 	    return 0;
 	}
     }
--- a/src/crypt.c
+++ b/src/crypt.c
@@ -162,7 +162,7 @@ crypt_method_nr_from_magic(char *ptr, in
 
     i = (int)STRLEN(crypt_magic_head);
     if (len >= i && memcmp(ptr, crypt_magic_head, i) == 0)
-	EMSG(_("E821: File is encrypted with unknown method"));
+	emsg(_("E821: File is encrypted with unknown method"));
 
     return -1;
 }
--- a/src/dict.c
+++ b/src/dict.c
@@ -644,7 +644,7 @@ dict_get_tv(char_u **arg, typval_T *rett
 	    goto failret;
 	if (**arg != ':')
 	{
-	    EMSG2(_("E720: Missing colon in Dictionary: %s"), *arg);
+	    semsg(_("E720: Missing colon in Dictionary: %s"), *arg);
 	    clear_tv(&tvkey);
 	    goto failret;
 	}
@@ -671,7 +671,7 @@ dict_get_tv(char_u **arg, typval_T *rett
 	    item = dict_find(d, key, -1);
 	    if (item != NULL)
 	    {
-		EMSG2(_("E721: Duplicate key in Dictionary: \"%s\""), key);
+		semsg(_("E721: Duplicate key in Dictionary: \"%s\""), key);
 		clear_tv(&tvkey);
 		clear_tv(&tv);
 		goto failret;
@@ -691,7 +691,7 @@ dict_get_tv(char_u **arg, typval_T *rett
 	    break;
 	if (**arg != ',')
 	{
-	    EMSG2(_("E722: Missing comma in Dictionary: %s"), *arg);
+	    semsg(_("E722: Missing comma in Dictionary: %s"), *arg);
 	    goto failret;
 	}
 	*arg = skipwhite(*arg + 1);
@@ -699,7 +699,7 @@ dict_get_tv(char_u **arg, typval_T *rett
 
     if (**arg != '}')
     {
-	EMSG2(_("E723: Missing end of Dictionary '}': %s"), *arg);
+	semsg(_("E723: Missing end of Dictionary '}': %s"), *arg);
 failret:
 	if (evaluate)
 	    dict_free(d);
@@ -753,7 +753,7 @@ dict_extend(dict_T *d1, dict_T *d2, char
 	    }
 	    else if (*action == 'e')
 	    {
-		EMSG2(_("E737: Key already exists: %s"), hi2->hi_key);
+		semsg(_("E737: Key already exists: %s"), hi2->hi_key);
 		break;
 	    }
 	    else if (*action == 'f' && HI2DI(hi2) != di1)
@@ -835,7 +835,7 @@ dict_list(typval_T *argvars, typval_T *r
 
     if (argvars[0].v_type != VAR_DICT)
     {
-	EMSG(_(e_dictreq));
+	emsg(_(e_dictreq));
 	return;
     }
     if ((d = argvars[0].vval.v_dict) == NULL)
--- a/src/diff.c
+++ b/src/diff.c
@@ -173,7 +173,7 @@ diff_buf_add(buf_T *buf)
 	    return;
 	}
 
-    EMSGN(_("E96: Cannot diff more than %ld buffers"), DB_COUNT);
+    semsg(_("E96: Cannot diff more than %ld buffers"), DB_COUNT);
 }
 
 /*
@@ -724,8 +724,7 @@ diff_write_buffer(buf_T *buf, diffin_T *
 	if (p_verbose > 0)
 	{
 	    verbose_enter();
-	    smsg((char_u *)
-		 _("Not enough memory to use internal diff for buffer \"%s\""),
+	    smsg(_("Not enough memory to use internal diff for buffer \"%s\""),
 								 buf->b_fname);
 	    verbose_leave();
 	}
@@ -1050,8 +1049,8 @@ check_external_diff(diffio_T *diffio)
     if (!ok)
     {
 	if (io_error)
-	    EMSG(_("E810: Cannot read or write temp files"));
-	EMSG(_("E97: Cannot create diffs"));
+	    emsg(_("E810: Cannot read or write temp files"));
+	emsg(_("E97: Cannot create diffs"));
 	diff_a_works = MAYBE;
 #if defined(MSWIN)
 	diff_bin_works = MAYBE;
@@ -1093,7 +1092,7 @@ diff_file_internal(diffio_T *diffio)
 		&diffio->dio_new.din_mmfile,
 		&param, &emit_cfg, &emit_cb) < 0)
     {
-	EMSG(_("E960: Problem creating the internal diff"));
+	emsg(_("E960: Problem creating the internal diff"));
 	return FAIL;
     }
     return OK;
@@ -1273,7 +1272,7 @@ ex_diffpatch(exarg_T *eap)
     if (dirbuf[0] != NUL)
     {
 	if (mch_chdir((char *)dirbuf) != 0)
-	    EMSG(_(e_prev_dir));
+	    emsg(_(e_prev_dir));
 	shorten_fnames(TRUE);
     }
 #endif
@@ -1291,7 +1290,7 @@ ex_diffpatch(exarg_T *eap)
 
     /* Only continue if the output file was created. */
     if (mch_stat((char *)tmp_new, &st) < 0 || st.st_size == 0)
-	EMSG(_("E816: Cannot read patch output"));
+	emsg(_("E816: Cannot read patch output"));
     else
     {
 	if (curbuf->b_fname != NULL)
@@ -1596,7 +1595,7 @@ diff_read(
 	fd = mch_fopen((char *)dout->dout_fname, "r");
 	if (fd == NULL)
 	{
-	    EMSG(_("E98: Cannot read diff output"));
+	    emsg(_("E98: Cannot read diff output"));
 	    return;
 	}
     }
@@ -1662,7 +1661,7 @@ diff_read(
 	}
 	else
 	{
-	    EMSG(_("E959: Invalid diff format."));
+	    emsg(_("E959: Invalid diff format."));
 	    break;
 	}
 
@@ -2572,7 +2571,7 @@ ex_diffgetput(exarg_T *eap)
     idx_cur = diff_buf_idx(curbuf);
     if (idx_cur == DB_COUNT)
     {
-	EMSG(_("E99: Current buffer is not in diff mode"));
+	emsg(_("E99: Current buffer is not in diff mode"));
 	return;
     }
 
@@ -2591,9 +2590,9 @@ 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(_("E793: No other buffer in diff mode is modifiable"));
 	    else
-		EMSG(_("E100: No other buffer in diff mode"));
+		emsg(_("E100: No other buffer in diff mode"));
 	    return;
 	}
 
@@ -2603,7 +2602,7 @@ ex_diffgetput(exarg_T *eap)
 		    && curtab->tp_diffbuf[i] != NULL
 		    && (eap->cmdidx != CMD_diffput || curtab->tp_diffbuf[i]->b_p_ma))
 	    {
-		EMSG(_("E101: More than two buffers in diff mode, don't know which one to use"));
+		emsg(_("E101: More than two buffers in diff mode, don't know which one to use"));
 		return;
 	    }
     }
@@ -2626,7 +2625,7 @@ ex_diffgetput(exarg_T *eap)
 	buf = buflist_findnr(i);
 	if (buf == NULL)
 	{
-	    EMSG2(_("E102: Can't find buffer \"%s\""), eap->arg);
+	    semsg(_("E102: Can't find buffer \"%s\""), eap->arg);
 	    return;
 	}
 	if (buf == curbuf)
@@ -2634,7 +2633,7 @@ ex_diffgetput(exarg_T *eap)
 	idx_other = diff_buf_idx(buf);
 	if (idx_other == DB_COUNT)
 	{
-	    EMSG2(_("E103: Buffer \"%s\" is not in diff mode"), eap->arg);
+	    semsg(_("E103: Buffer \"%s\" is not in diff mode"), eap->arg);
 	    return;
 	}
     }
@@ -2678,7 +2677,7 @@ ex_diffgetput(exarg_T *eap)
 	change_warning(0);
 	if (diff_buf_idx(curbuf) != idx_to)
 	{
-	    EMSG(_("E787: Buffer changed unexpectedly"));
+	    emsg(_("E787: Buffer changed unexpectedly"));
 	    goto theend;
 	}
     }
--- a/src/digraph.c
+++ b/src/digraph.c
@@ -2218,18 +2218,18 @@ putdigraph(char_u *str)
 	char2 = *str++;
 	if (char2 == 0)
 	{
-	    EMSG(_(e_invarg));
+	    emsg(_(e_invarg));
 	    return;
 	}
 	if (char1 == ESC || char2 == ESC)
 	{
-	    EMSG(_("E104: Escape not allowed in digraph"));
+	    emsg(_("E104: Escape not allowed in digraph"));
 	    return;
 	}
 	str = skipwhite(str);
 	if (!VIM_ISDIGIT(*str))
 	{
-	    EMSG(_(e_number_exp));
+	    emsg(_(e_number_exp));
 	    return;
 	}
 	n = getdigits(&str);
@@ -2446,7 +2446,7 @@ static void keymap_unload(void);
  * used when setting the option, not later when the value has already been
  * checked.
  */
-    char_u *
+    char *
 keymap_init(void)
 {
     curbuf->b_kmap_state &= ~KEYMAP_INIT;
@@ -2487,7 +2487,7 @@ keymap_init(void)
 	    if (source_runtime(buf, 0) == FAIL)
 	    {
 		vim_free(buf);
-		return (char_u *)N_("E544: Keymap file not found");
+		return N_("E544: Keymap file not found");
 	    }
 	}
 	vim_free(buf);
@@ -2513,7 +2513,7 @@ ex_loadkeymap(exarg_T *eap)
 
     if (!getline_equal(eap->getline, eap->cookie, getsourceline))
     {
-	EMSG(_("E105: Using :loadkeymap not in a sourced file"));
+	emsg(_("E105: Using :loadkeymap not in a sourced file"));
 	return;
     }
 
@@ -2552,7 +2552,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(_("E791: Empty keymap entry"));
 		vim_free(kp->from);
 		vim_free(kp->to);
 	    }
--- a/src/edit.c
+++ b/src/edit.c
@@ -360,7 +360,7 @@ edit(
     /* Don't allow inserting in the sandbox. */
     if (sandbox != 0)
     {
-	EMSG(_(e_sandbox));
+	emsg(_(e_sandbox));
 	return FALSE;
     }
 #endif
@@ -368,7 +368,7 @@ edit(
      * caller of getcmdline() may get confused. */
     if (textlock != 0)
     {
-	EMSG(_(e_secure));
+	emsg(_(e_secure));
 	return FALSE;
     }
 
@@ -376,7 +376,7 @@ edit(
     /* Don't allow recursive insert mode when busy with completion. */
     if (compl_started || compl_busy || pum_visible())
     {
-	EMSG(_(e_secure));
+	emsg(_(e_secure));
 	return FALSE;
     }
     ins_compl_clear();	    /* clear stuff for CTRL-X mode */
@@ -476,7 +476,7 @@ edit(
 	if (p_fkmap && p_ri)
 	{
 	    beep_flush();
-	    EMSG(farsi_text_3);	    /* encoded in Farsi */
+	    emsg(farsi_text_3);	    /* encoded in Farsi */
 	    State = INSERT;
 	}
 	else
@@ -4262,14 +4262,14 @@ expand_by_function(
 
     if (curwin_save != curwin || curbuf_save != curbuf)
     {
-	EMSG(_(e_complwin));
+	emsg(_(e_complwin));
 	goto theend;
     }
     curwin->w_cursor = pos;	/* restore the cursor position */
     validate_cursor();
     if (!EQUAL_POS(curwin->w_cursor, pos))
     {
-	EMSG(_(e_compldel));
+	emsg(_(e_compldel));
 	goto theend;
     }
 
@@ -5567,7 +5567,7 @@ ins_complete(int c, int enable_pum)
 					  ? curbuf->b_p_cfu : curbuf->b_p_ofu;
 	    if (*funcname == NUL)
 	    {
-		EMSG2(_(e_notset), ctrl_x_mode == CTRL_X_FUNCTION
+		semsg(_(e_notset), ctrl_x_mode == CTRL_X_FUNCTION
 					     ? "completefunc" : "omnifunc");
 		/* restore did_ai, so that adding comment leader works */
 		did_ai = save_did_ai;
@@ -5587,14 +5587,14 @@ ins_complete(int c, int enable_pum)
 	    State = save_State;
 	    if (curwin_save != curwin || curbuf_save != curbuf)
 	    {
-		EMSG(_(e_complwin));
+		emsg(_(e_complwin));
 		return FAIL;
 	    }
 	    curwin->w_cursor = pos;	/* restore the cursor position */
 	    validate_cursor();
 	    if (!EQUAL_POS(curwin->w_cursor, pos))
 	    {
-		EMSG(_(e_compldel));
+		emsg(_(e_compldel));
 		return FAIL;
 	    }
 
@@ -7678,7 +7678,7 @@ stuff_inserted(
     ptr = get_last_insert();
     if (ptr == NULL)
     {
-	EMSG(_(e_noinstext));
+	emsg(_(e_noinstext));
 	return FAIL;
     }
 
@@ -8969,7 +8969,7 @@ ins_insert(int replaceState)
     if (p_fkmap && p_ri)
     {
 	beep_flush();
-	EMSG(farsi_text_3);	/* encoded in Farsi */
+	emsg(farsi_text_3);	/* encoded in Farsi */
 	return;
     }
 #endif
--- a/src/eval.c
+++ b/src/eval.c
@@ -301,7 +301,7 @@ eval_init(void)
 	p = &vimvars[i];
 	if (STRLEN(p->vv_name) > 16)
 	{
-	    IEMSG("INTERNAL: name too long, increase size of dictitem16_T");
+	    iemsg("INTERNAL: name too long, increase size of dictitem16_T");
 	    getout(1);
 	}
 	STRCPY(p->vv_di.di_key, p->vv_name);
@@ -448,7 +448,7 @@ var_redir_start(char_u *name, int append
     /* Catch a bad name early. */
     if (!eval_isnamec1(*name))
     {
-	EMSG(_(e_invarg));
+	emsg(_(e_invarg));
 	return FAIL;
     }
 
@@ -475,9 +475,9 @@ 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 */
-	    EMSG(_(e_trailing));
+	    emsg(_(e_trailing));
 	else
-	    EMSG(_(e_invarg));
+	    emsg(_(e_invarg));
 	redir_endp = NULL;  /* don't store a value, only cleanup */
 	var_redir_stop();
 	return FAIL;
@@ -734,7 +734,7 @@ eval_expr_typval(typval_T *expr, typval_
 	if (*s != NUL)  /* check for trailing chars after expr */
 	{
 	    clear_tv(rettv);
-	    EMSG2(_(e_invexpr2), s);
+	    semsg(_(e_invexpr2), s);
 	    return FAIL;
 	}
     }
@@ -1202,7 +1202,7 @@ ex_let(exarg_T *eap)
 	 * ":let" without "=": list variables
 	 */
 	if (*arg == '[')
-	    EMSG(_(e_invarg));
+	    emsg(_(e_invarg));
 	else if (!ends_excmd(*arg))
 	    /* ":let var1 var2" */
 	    arg = list_arg_vars(eap, arg, &first);
@@ -1288,19 +1288,19 @@ ex_let_vars(
      */
     if (tv->v_type != VAR_LIST || (l = tv->vval.v_list) == NULL)
     {
-	EMSG(_(e_listreq));
+	emsg(_(e_listreq));
 	return FAIL;
     }
 
     i = list_len(l);
     if (semicolon == 0 && var_count < i)
     {
-	EMSG(_("E687: Less targets than List items"));
+	emsg(_("E687: Less targets than List items"));
 	return FAIL;
     }
     if (var_count - semicolon > i)
     {
-	EMSG(_("E688: More targets than List items"));
+	emsg(_("E688: More targets than List items"));
 	return FAIL;
     }
 
@@ -1374,7 +1374,7 @@ skip_var_list(
 	    s = skip_var_one(p);
 	    if (s == p)
 	    {
-		EMSG2(_(e_invarg2), p);
+		semsg(_(e_invarg2), p);
 		return NULL;
 	    }
 	    ++*var_count;
@@ -1386,14 +1386,14 @@ skip_var_list(
 	    {
 		if (*semicolon == 1)
 		{
-		    EMSG(_("Double ; in list of variables"));
+		    emsg(_("Double ; in list of variables"));
 		    return NULL;
 		}
 		*semicolon = 1;
 	    }
 	    else if (*p != ',')
 	    {
-		EMSG2(_(e_invarg2), p);
+		semsg(_(e_invarg2), p);
 		return NULL;
 	    }
 	}
@@ -1534,7 +1534,7 @@ list_arg_vars(exarg_T *eap, char_u *arg,
 	    if (!VIM_ISWHITE(*arg) && !ends_excmd(*arg))
 	    {
 		emsg_severe = TRUE;
-		EMSG(_(e_trailing));
+		emsg(_(e_trailing));
 		break;
 	    }
 	}
@@ -1550,7 +1550,7 @@ list_arg_vars(exarg_T *eap, char_u *arg,
 		if (len < 0 && !aborting())
 		{
 		    emsg_severe = TRUE;
-		    EMSG2(_(e_invarg2), arg);
+		    semsg(_(e_invarg2), arg);
 		    break;
 		}
 		error = TRUE;
@@ -1581,7 +1581,7 @@ list_arg_vars(exarg_T *eap, char_u *arg,
 				case 's': list_script_vars(first); break;
 				case 'l': list_func_vars(first); break;
 				default:
-					  EMSG2(_("E738: Can't list variables for %s"), name);
+					  semsg(_("E738: Can't list variables for %s"), name);
 			    }
 			}
 			else
@@ -1647,14 +1647,14 @@ ex_let_one(
 	name = arg;
 	len = get_env_len(&arg);
 	if (len == 0)
-	    EMSG2(_(e_invarg2), name - 1);
+	    semsg(_(e_invarg2), name - 1);
 	else
 	{
 	    if (op != NULL && (*op == '+' || *op == '-'))
-		EMSG2(_(e_letwrong), op);
+		semsg(_(e_letwrong), op);
 	    else if (endchars != NULL
 			     && vim_strchr(endchars, *skipwhite(arg)) == NULL)
-		EMSG(_(e_letunexp));
+		emsg(_(e_letunexp));
 	    else if (!check_secure())
 	    {
 		c1 = name[len];
@@ -1701,7 +1701,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_letunexp));
 	else
 	{
 	    long	n;
@@ -1722,7 +1722,7 @@ ex_let_one(
 		if ((opt_type == 1 && *op == '.')
 			|| (opt_type == 0 && *op != '.'))
 		{
-		    EMSG2(_(e_letwrong), op);
+		    semsg(_(e_letwrong), op);
 		    s = NULL;  /* don't set the value */
 		}
 		else
@@ -1759,10 +1759,10 @@ ex_let_one(
     {
 	++arg;
 	if (op != NULL && (*op == '+' || *op == '-'))
-	    EMSG2(_(e_letwrong), op);
+	    semsg(_(e_letwrong), op);
 	else if (endchars != NULL
 			 && vim_strchr(endchars, *skipwhite(arg + 1)) == NULL)
-	    EMSG(_(e_letunexp));
+	    emsg(_(e_letunexp));
 	else
 	{
 	    char_u	*ptofree = NULL;
@@ -1799,7 +1799,7 @@ ex_let_one(
 	if (p != NULL && lv.ll_name != NULL)
 	{
 	    if (endchars != NULL && vim_strchr(endchars, *skipwhite(p)) == NULL)
-		EMSG(_(e_letunexp));
+		emsg(_(e_letunexp));
 	    else
 	    {
 		set_var_lval(&lv, p, tv, copy, op);
@@ -1810,7 +1810,7 @@ ex_let_one(
     }
 
     else
-	EMSG2(_(e_invarg2), arg);
+	semsg(_(e_invarg2), arg);
 
     return arg_end;
 }
@@ -1875,7 +1875,7 @@ get_lval(
 	if (unlet && !VIM_ISWHITE(*p) && !ends_excmd(*p)
 						    && *p != '[' && *p != '.')
 	{
-	    EMSG(_(e_trailing));
+	    emsg(_(e_trailing));
 	    return NULL;
 	}
 
@@ -1888,7 +1888,7 @@ get_lval(
 	    if (!aborting() && !quiet)
 	    {
 		emsg_severe = TRUE;
-		EMSG2(_(e_invarg2), name);
+		semsg(_(e_invarg2), name);
 		return NULL;
 	    }
 	}
@@ -1908,7 +1908,7 @@ get_lval(
     v = find_var(lp->ll_name, (flags & GLV_READ_ONLY) ? NULL : &ht,
 						      flags & GLV_NO_AUTOLOAD);
     if (v == NULL && !quiet)
-	EMSG2(_(e_undefvar), lp->ll_name);
+	semsg(_(e_undefvar), lp->ll_name);
     *p = cc;
     if (v == NULL)
 	return NULL;
@@ -1928,13 +1928,13 @@ get_lval(
 					   && lp->ll_tv->vval.v_blob != NULL))
 	{
 	    if (!quiet)
-		EMSG(_("E689: Can only index a List, Dictionary or Blob"));
+		emsg(_("E689: Can only index a List, Dictionary or Blob"));
 	    return NULL;
 	}
 	if (lp->ll_range)
 	{
 	    if (!quiet)
-		EMSG(_("E708: [:] must come last"));
+		emsg(_("E708: [:] must come last"));
 	    return NULL;
 	}
 
@@ -1947,7 +1947,7 @@ get_lval(
 	    if (len == 0)
 	    {
 		if (!quiet)
-		    EMSG(_(e_emptykey));
+		    emsg(_(e_emptykey));
 		return NULL;
 	    }
 	    p = key + len;
@@ -1977,7 +1977,7 @@ get_lval(
 		if (lp->ll_tv->v_type == VAR_DICT)
 		{
 		    if (!quiet)
-			EMSG(_(e_dictrange));
+			emsg(_(e_dictrange));
 		    clear_tv(&var1);
 		    return NULL;
 		}
@@ -1988,7 +1988,7 @@ get_lval(
 						&& rettv->vval.v_blob != NULL))
 		{
 		    if (!quiet)
-			EMSG(_("E709: [:] requires a List or Blob value"));
+			emsg(_("E709: [:] requires a List or Blob value"));
 		    clear_tv(&var1);
 		    return NULL;
 		}
@@ -2019,7 +2019,7 @@ get_lval(
 	    if (*p != ']')
 	    {
 		if (!quiet)
-		    EMSG(_(e_missbrac));
+		    emsg(_(e_missbrac));
 		clear_tv(&var1);
 		clear_tv(&var2);
 		return NULL;
@@ -2075,7 +2075,7 @@ get_lval(
 		/* Can't add "v:" variable. */
 		if (lp->ll_dict == &vimvardict)
 		{
-		    EMSG2(_(e_illvar), name);
+		    semsg(_(e_illvar), name);
 		    return NULL;
 		}
 
@@ -2083,7 +2083,7 @@ get_lval(
 		if (*p == '[' || *p == '.' || unlet)
 		{
 		    if (!quiet)
-			EMSG2(_(e_dictkey), key);
+			semsg(_(e_dictkey), key);
 		    clear_tv(&var1);
 		    return NULL;
 		}
@@ -2126,7 +2126,7 @@ get_lval(
 		    || (lp->ll_range && lp->ll_n1 == bloblen))
 	    {
 		if (!quiet)
-		    EMSGN(_(e_blobidx), lp->ll_n1);
+		    semsg(_(e_blobidx), lp->ll_n1);
 		clear_tv(&var2);
 		return NULL;
 	    }
@@ -2139,7 +2139,7 @@ get_lval(
 			|| lp->ll_n2 < lp->ll_n1)
 		{
 		    if (!quiet)
-			EMSGN(_(e_blobidx), lp->ll_n2);
+			semsg(_(e_blobidx), lp->ll_n2);
 		    return NULL;
 		}
 	    }
@@ -2173,7 +2173,7 @@ get_lval(
 	    {
 		clear_tv(&var2);
 		if (!quiet)
-		    EMSGN(_(e_listidx), lp->ll_n1);
+		    semsg(_(e_listidx), lp->ll_n1);
 		return NULL;
 	    }
 
@@ -2194,7 +2194,7 @@ get_lval(
 		    if (ni == NULL)
 		    {
 			if (!quiet)
-			    EMSGN(_(e_listidx), lp->ll_n2);
+			    semsg(_(e_listidx), lp->ll_n2);
 			return NULL;
 		    }
 		    lp->ll_n2 = list_idx_of_item(lp->ll_list, ni);
@@ -2206,7 +2206,7 @@ get_lval(
 		if (lp->ll_n2 < lp->ll_n1)
 		{
 		    if (!quiet)
-			EMSGN(_(e_listidx), lp->ll_n2);
+			semsg(_(e_listidx), lp->ll_n2);
 		    return NULL;
 		}
 	    }
@@ -2256,7 +2256,7 @@ set_var_lval(
 
 	    if (op != NULL && *op != '=')
 	    {
-		EMSG2(_(e_letwrong), op);
+		semsg(_(e_letwrong), op);
 		return;
 	    }
 
@@ -2269,7 +2269,7 @@ set_var_lval(
 
 		if (lp->ll_n2 - lp->ll_n1 + 1 != blob_len(rettv->vval.v_blob))
 		{
-		    EMSG(_("E972: Blob value does not have the right number of bytes"));
+		    emsg(_("E972: Blob value does not have the right number of bytes"));
 		    return;
 		}
 		if (lp->ll_empty2)
@@ -2374,11 +2374,11 @@ set_var_lval(
 	    ++lp->ll_n1;
 	}
 	if (ri != NULL)
-	    EMSG(_("E710: List value has more items than target"));
+	    emsg(_("E710: List value has more items than target"));
 	else if (lp->ll_empty2
 		? (lp->ll_li != NULL && lp->ll_li->li_next != NULL)
 		: lp->ll_n1 != lp->ll_n2)
-	    EMSG(_("E711: List value has not enough items"));
+	    emsg(_("E711: List value has not enough items"));
     }
     else
     {
@@ -2389,7 +2389,7 @@ set_var_lval(
 	{
 	    if (op != NULL && *op != '=')
 	    {
-		EMSG2(_(e_letwrong), op);
+		semsg(_(e_letwrong), op);
 		return;
 	    }
 
@@ -2544,7 +2544,7 @@ tv_op(typval_T *tv1, typval_T *tv2, char
 	}
     }
 
-    EMSG2(_(e_letwrong), op);
+    semsg(_(e_letwrong), op);
     return FAIL;
 }
 
@@ -2580,7 +2580,7 @@ eval_for_line(
     expr = skipwhite(expr);
     if (expr[0] != 'i' || expr[1] != 'n' || !VIM_ISWHITE(expr[2]))
     {
-	EMSG(_("E690: Missing \"in\" after :for"));
+	emsg(_("E690: Missing \"in\" after :for"));
 	return fi;
     }
 
@@ -2623,7 +2623,7 @@ eval_for_line(
 	    }
 	    else
 	    {
-		EMSG(_(e_listreq));
+		emsg(_(e_listreq));
 		clear_tv(&tv);
 	    }
 	}
@@ -2860,7 +2860,7 @@ ex_unletlock(
 
 	    if (get_env_len(&arg) == 0)
 	    {
-		EMSG2(_(e_invarg2), name - 1);
+		semsg(_(e_invarg2), name - 1);
 		return;
 	    }
 	    vim_unsetenv(name);
@@ -2879,7 +2879,7 @@ ex_unletlock(
 	    if (name_end != NULL)
 	    {
 		emsg_severe = TRUE;
-		EMSG(_(e_trailing));
+		emsg(_(e_trailing));
 	    }
 	    if (!(eap->skip || error))
 		clear_lval(&lv);
@@ -3022,7 +3022,7 @@ do_unlet(char_u *name, int forceit)
     }
     if (forceit)
 	return OK;
-    EMSG2(_("E108: No such variable: \"%s\""), name);
+    semsg(_("E108: No such variable: \"%s\""), name);
     return FAIL;
 }
 
@@ -3059,7 +3059,7 @@ do_lock_var(
 			&& di->di_tv.v_type != VAR_LIST)
 	    /* For historic reasons this error is not given for a list or dict.
 	     * E.g., the b: dict could be locked/unlocked. */
-	    EMSG2(_("E940: Cannot lock or unlock variable %s"), lp->ll_name);
+	    semsg(_("E940: Cannot lock or unlock variable %s"), lp->ll_name);
 	else
 	{
 	    if (lock)
@@ -3108,7 +3108,7 @@ item_lock(typval_T *tv, int deep, int lo
 
     if (recurse >= DICT_MAXNEST)
     {
-	EMSG(_("E743: variable nested too deep for (un)lock"));
+	emsg(_("E743: variable nested too deep for (un)lock"));
 	return;
     }
     if (deep == 0)
@@ -3393,7 +3393,7 @@ eval0(
 	 */
 	if (!aborting() && did_emsg == did_emsg_before
 					  && called_emsg == called_emsg_before)
-	    EMSG2(_(e_invexpr2), arg);
+	    semsg(_(e_invexpr2), arg);
 	ret = FAIL;
     }
     if (nextcmd != NULL)
@@ -3451,7 +3451,7 @@ eval1(char_u **arg, typval_T *rettv, int
 	 */
 	if ((*arg)[0] != ':')
 	{
-	    EMSG(_("E109: Missing ':' after '?'"));
+	    emsg(_("E109: Missing ':' after '?'"));
 	    if (evaluate && result)
 		clear_tv(rettv);
 	    return FAIL;
@@ -4058,7 +4058,7 @@ eval6(
 		}
 		else
 		{
-		    EMSG(_("E804: Cannot use '%' with Float"));
+		    emsg(_("E804: Cannot use '%' with Float"));
 		    return FAIL;
 		}
 		rettv->v_type = VAR_FLOAT;
@@ -4223,7 +4223,7 @@ eval7(
 			{
 			    if (blob != NULL)
 			    {
-				EMSG(_("E973: Blob literal should have an even number of hex characters"));
+				emsg(_("E973: Blob literal should have an even number of hex characters"));
 				ga_clear(&blob->bv_ga);
 				VIM_CLEAR(blob);
 			    }
@@ -4314,7 +4314,7 @@ eval7(
 		    ++*arg;
 		else if (ret == OK)
 		{
-		    EMSG(_("E110: Missing ')'"));
+		    emsg(_("E110: Missing ')'"));
 		    clear_tv(rettv);
 		    ret = FAIL;
 		}
@@ -4488,19 +4488,19 @@ eval_index(
 	case VAR_FUNC:
 	case VAR_PARTIAL:
 	    if (verbose)
-		EMSG(_("E695: Cannot index a Funcref"));
+		emsg(_("E695: Cannot index a Funcref"));
 	    return FAIL;
 	case VAR_FLOAT:
 #ifdef FEAT_FLOAT
 	    if (verbose)
-		EMSG(_(e_float_as_string));
+		emsg(_(e_float_as_string));
 	    return FAIL;
 #endif
 	case VAR_SPECIAL:
 	case VAR_JOB:
 	case VAR_CHANNEL:
 	    if (verbose)
-		EMSG(_("E909: Cannot index a special variable"));
+		emsg(_("E909: Cannot index a special variable"));
 	    return FAIL;
 	case VAR_UNKNOWN:
 	    if (evaluate)
@@ -4577,7 +4577,7 @@ eval_index(
 	if (**arg != ']')
 	{
 	    if (verbose)
-		EMSG(_(e_missbrac));
+		emsg(_(e_missbrac));
 	    clear_tv(&var1);
 	    if (range)
 		clear_tv(&var2);
@@ -4711,7 +4711,7 @@ eval_index(
 			rettv->vval.v_number = v;
 		    }
 		    else
-			EMSGN(_(e_blobidx), n1);
+			semsg(_(e_blobidx), n1);
 		}
 		break;
 
@@ -4726,7 +4726,7 @@ eval_index(
 		    if (!range)
 		    {
 			if (verbose)
-			    EMSGN(_(e_listidx), n1);
+			    semsg(_(e_listidx), n1);
 			return FAIL;
 		    }
 		    n1 = len;
@@ -4770,7 +4770,7 @@ eval_index(
 		if (range)
 		{
 		    if (verbose)
-			EMSG(_(e_dictrange));
+			emsg(_(e_dictrange));
 		    if (len == -1)
 			clear_tv(&var1);
 		    return FAIL;
@@ -4791,7 +4791,7 @@ eval_index(
 		    item = dict_find(rettv->vval.v_dict, key, (int)len);
 
 		    if (item == NULL && verbose)
-			EMSG2(_(e_dictkey), key);
+			semsg(_(e_dictkey), key);
 		    if (len == -1)
 			clear_tv(&var1);
 		    if (item == NULL)
@@ -4836,7 +4836,7 @@ get_option_tv(
     if (option_end == NULL)
     {
 	if (rettv != NULL)
-	    EMSG2(_("E112: Option name missing: %s"), *arg);
+	    semsg(_("E112: Option name missing: %s"), *arg);
 	return FAIL;
     }
 
@@ -4854,7 +4854,7 @@ get_option_tv(
     if (opt_type == -3)			/* invalid name */
     {
 	if (rettv != NULL)
-	    EMSG2(_("E113: Unknown option: %s"), *arg);
+	    semsg(_("E113: Unknown option: %s"), *arg);
 	ret = FAIL;
     }
     else if (rettv != NULL)
@@ -4917,7 +4917,7 @@ get_string_tv(char_u **arg, typval_T *re
 
     if (*p != '"')
     {
-	EMSG2(_("E114: Missing quote: %s"), *arg);
+	semsg(_("E114: Missing quote: %s"), *arg);
 	return FAIL;
     }
 
@@ -5054,7 +5054,7 @@ get_lit_string_tv(char_u **arg, typval_T
 
     if (*p != '\'')
     {
-	EMSG2(_("E115: Missing quote: %s"), *arg);
+	semsg(_("E115: Missing quote: %s"), *arg);
 	return FAIL;
     }
 
@@ -5798,7 +5798,7 @@ echo_string_core(
 	     * flooding the user with errors.  And stop iterating over lists
 	     * and dicts. */
 	    did_echo_string_emsg = TRUE;
-	    EMSG(_("E724: variable nested too deep for displaying"));
+	    emsg(_("E724: variable nested too deep for displaying"));
 	}
 	*tofree = NULL;
 	return (char_u *)"{E724}";
@@ -6439,7 +6439,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)
-	EMSG2(_(e_invexpr2), *arg);
+	semsg(_(e_invexpr2), *arg);
 
     return len;
 }
@@ -6937,7 +6937,7 @@ get_var_tv(
     if (tv == NULL)
     {
 	if (rettv != NULL && verbose)
-	    EMSG2(_(e_undefvar), name);
+	    semsg(_(e_undefvar), name);
 	ret = FAIL;
     }
     else if (rettv != NULL)
@@ -7251,12 +7251,12 @@ tv_get_number_chk(typval_T *varp, int *d
 	    return varp->vval.v_number;
 	case VAR_FLOAT:
 #ifdef FEAT_FLOAT
-	    EMSG(_("E805: Using a Float as a Number"));
+	    emsg(_("E805: Using a Float as a Number"));
 	    break;
 #endif
 	case VAR_FUNC:
 	case VAR_PARTIAL:
-	    EMSG(_("E703: Using a Funcref as a Number"));
+	    emsg(_("E703: Using a Funcref as a Number"));
 	    break;
 	case VAR_STRING:
 	    if (varp->vval.v_string != NULL)
@@ -7264,26 +7264,26 @@ tv_get_number_chk(typval_T *varp, int *d
 						    STR2NR_ALL, &n, NULL, 0);
 	    return n;
 	case VAR_LIST:
-	    EMSG(_("E745: Using a List as a Number"));
+	    emsg(_("E745: Using a List as a Number"));
 	    break;
 	case VAR_DICT:
-	    EMSG(_("E728: Using a Dictionary as a Number"));
+	    emsg(_("E728: Using a Dictionary as a Number"));
 	    break;
 	case VAR_SPECIAL:
 	    return varp->vval.v_number == VVAL_TRUE ? 1 : 0;
 	    break;
 	case VAR_JOB:
 #ifdef FEAT_JOB_CHANNEL
-	    EMSG(_("E910: Using a Job as a Number"));
+	    emsg(_("E910: Using a Job as a Number"));
 	    break;
 #endif
 	case VAR_CHANNEL:
 #ifdef FEAT_JOB_CHANNEL
-	    EMSG(_("E913: Using a Channel as a Number"));
+	    emsg(_("E913: Using a Channel as a Number"));
 	    break;
 #endif
 	case VAR_BLOB:
-	    EMSG(_("E974: Using a Blob as a Number"));
+	    emsg(_("E974: Using a Blob as a Number"));
 	    break;
 	case VAR_UNKNOWN:
 	    internal_error("tv_get_number(UNKNOWN)");
@@ -7308,32 +7308,32 @@ tv_get_float(typval_T *varp)
 	    return varp->vval.v_float;
 	case VAR_FUNC:
 	case VAR_PARTIAL:
-	    EMSG(_("E891: Using a Funcref as a Float"));
+	    emsg(_("E891: Using a Funcref as a Float"));
 	    break;
 	case VAR_STRING:
-	    EMSG(_("E892: Using a String as a Float"));
+	    emsg(_("E892: Using a String as a Float"));
 	    break;
 	case VAR_LIST:
-	    EMSG(_("E893: Using a List as a Float"));
+	    emsg(_("E893: Using a List as a Float"));
 	    break;
 	case VAR_DICT:
-	    EMSG(_("E894: Using a Dictionary as a Float"));
+	    emsg(_("E894: Using a Dictionary as a Float"));
 	    break;
 	case VAR_SPECIAL:
-	    EMSG(_("E907: Using a special value as a Float"));
+	    emsg(_("E907: Using a special value as a Float"));
 	    break;
 	case VAR_JOB:
 # ifdef FEAT_JOB_CHANNEL
-	    EMSG(_("E911: Using a Job as a Float"));
+	    emsg(_("E911: Using a Job as a Float"));
 	    break;
 # endif
 	case VAR_CHANNEL:
 # ifdef FEAT_JOB_CHANNEL
-	    EMSG(_("E914: Using a Channel as a Float"));
+	    emsg(_("E914: Using a Channel as a Float"));
 	    break;
 # endif
 	case VAR_BLOB:
-	    EMSG(_("E975: Using a Blob as a Float"));
+	    emsg(_("E975: Using a Blob as a Float"));
 	    break;
 	case VAR_UNKNOWN:
 	    internal_error("tv_get_float(UNKNOWN)");
@@ -7391,17 +7391,17 @@ tv_get_string_buf_chk(typval_T *varp, ch
 	    return buf;
 	case VAR_FUNC:
 	case VAR_PARTIAL:
-	    EMSG(_("E729: using Funcref as a String"));
+	    emsg(_("E729: using Funcref as a String"));
 	    break;
 	case VAR_LIST:
-	    EMSG(_("E730: using List as a String"));
+	    emsg(_("E730: using List as a String"));
 	    break;
 	case VAR_DICT:
-	    EMSG(_("E731: using Dictionary as a String"));
+	    emsg(_("E731: using Dictionary as a String"));
 	    break;
 	case VAR_FLOAT:
 #ifdef FEAT_FLOAT
-	    EMSG(_(e_float_as_string));
+	    emsg(_(e_float_as_string));
 	    break;
 #endif
 	case VAR_STRING:
@@ -7412,7 +7412,7 @@ tv_get_string_buf_chk(typval_T *varp, ch
 	    STRCPY(buf, get_var_special_name(varp->vval.v_number));
 	    return buf;
         case VAR_BLOB:
-	    EMSG(_("E976: using Blob as a String"));
+	    emsg(_("E976: using Blob as a String"));
 	    break;
 	case VAR_JOB:
 #ifdef FEAT_JOB_CHANNEL
@@ -7457,7 +7457,7 @@ tv_get_string_buf_chk(typval_T *varp, ch
 #endif
 	    break;
 	case VAR_UNKNOWN:
-	    EMSG(_("E908: using an invalid value as a String"));
+	    emsg(_("E908: using an invalid value as a String"));
 	    break;
     }
     return NULL;
@@ -7839,7 +7839,7 @@ set_var(
     ht = find_var_ht(name, &varname);
     if (ht == NULL || *varname == NUL)
     {
-	EMSG2(_(e_illvar), name);
+	semsg(_(e_illvar), name);
 	return;
     }
     v = find_var_in_ht(ht, 0, varname, TRUE);
@@ -7894,7 +7894,7 @@ set_var(
 	    }
 	    else if (v->di_tv.v_type != tv->v_type)
 	    {
-		EMSG2(_("E963: setting %s to value with wrong type"), name);
+		semsg(_("E963: setting %s to value with wrong type"), name);
 		return;
 	    }
 	}
@@ -7906,7 +7906,7 @@ set_var(
 	/* Can't add "v:" variable. */
 	if (ht == &vimvarht)
 	{
-	    EMSG2(_(e_illvar), name);
+	    semsg(_(e_illvar), name);
 	    return;
 	}
 
@@ -7946,12 +7946,12 @@ var_check_ro(int flags, char_u *name, in
 {
     if (flags & DI_FLAGS_RO)
     {
-	EMSG2(_(e_readonlyvar), use_gettext ? (char_u *)_(name) : name);
+	semsg(_(e_readonlyvar), use_gettext ? (char_u *)_(name) : name);
 	return TRUE;
     }
     if ((flags & DI_FLAGS_RO_SBX) && sandbox)
     {
-	EMSG2(_(e_readonlysbx), use_gettext ? (char_u *)_(name) : name);
+	semsg(_(e_readonlysbx), use_gettext ? (char_u *)_(name) : name);
 	return TRUE;
     }
     return FALSE;
@@ -7966,7 +7966,7 @@ var_check_fixed(int flags, char_u *name,
 {
     if (flags & DI_FLAGS_FIX)
     {
-	EMSG2(_("E795: Cannot delete variable %s"),
+	semsg(_("E795: Cannot delete variable %s"),
 				      use_gettext ? (char_u *)_(name) : name);
 	return TRUE;
     }
@@ -7987,7 +7987,7 @@ var_check_func_name(
 	    && !ASCII_ISUPPER((name[0] != NUL && name[1] == ':')
 						     ? name[2] : name[0]))
     {
-	EMSG2(_("E704: Funcref variable name must start with a capital: %s"),
+	semsg(_("E704: Funcref variable name must start with a capital: %s"),
 									name);
 	return TRUE;
     }
@@ -7996,7 +7996,7 @@ var_check_func_name(
      * below. */
     if (new_var && function_exists(name, FALSE))
     {
-	EMSG2(_("E705: Variable name conflicts with existing function: %s"),
+	semsg(_("E705: Variable name conflicts with existing function: %s"),
 								    name);
 	return TRUE;
     }
@@ -8016,7 +8016,7 @@ valid_varname(char_u *varname)
 	if (!eval_isnamec1(*p) && (p == varname || !VIM_ISDIGIT(*p))
 						   && *p != AUTOLOAD_CHAR)
 	{
-	    EMSG2(_(e_illvar), varname);
+	    semsg(_(e_illvar), varname);
 	    return FALSE;
 	}
     return TRUE;
@@ -8032,7 +8032,7 @@ tv_check_lock(int lock, char_u *name, in
 {
     if (lock & VAR_LOCKED)
     {
-	EMSG2(_("E741: Value is locked: %s"),
+	semsg(_("E741: Value is locked: %s"),
 				name == NULL ? (char_u *)_("Unknown")
 					     : use_gettext ? (char_u *)_(name)
 					     : name);
@@ -8040,7 +8040,7 @@ tv_check_lock(int lock, char_u *name, in
     }
     if (lock & VAR_FIXED)
     {
-	EMSG2(_("E742: Cannot change value of %s"),
+	semsg(_("E742: Cannot change value of %s"),
 				name == NULL ? (char_u *)_("Unknown")
 					     : use_gettext ? (char_u *)_(name)
 					     : name);
@@ -8158,7 +8158,7 @@ item_copy(
 
     if (recurse >= DICT_MAXNEST)
     {
-	EMSG(_("E698: variable nested too deep for making a copy"));
+	emsg(_("E698: variable nested too deep for making a copy"));
 	return FAIL;
     }
     ++recurse;
@@ -8358,7 +8358,7 @@ ex_echo(exarg_T *eap)
 	     */
 	    if (!aborting() && did_emsg == did_emsg_before
 					  && called_emsg == called_emsg_before)
-		EMSG2(_(e_invexpr2), p);
+		semsg(_(e_invexpr2), p);
 	    need_clr_eos = FALSE;
 	    break;
 	}
@@ -8472,7 +8472,7 @@ ex_execute(exarg_T *eap)
 	     * exception.
 	     */
 	    if (!aborting() && did_emsg == save_did_emsg)
-		EMSG2(_(e_invexpr2), p);
+		semsg(_(e_invexpr2), p);
 	    ret = FAIL;
 	    break;
 	}
@@ -8521,7 +8521,7 @@ ex_execute(exarg_T *eap)
 	{
 	    /* We don't want to abort following commands, restore did_emsg. */
 	    save_did_emsg = did_emsg;
-	    EMSG((char_u *)ga.ga_data);
+	    emsg(ga.ga_data);
 	    if (!force_abort)
 		did_emsg = save_did_emsg;
 	}
@@ -9286,7 +9286,7 @@ assert_match_common(typval_T *argvars, a
     char_u	*text = tv_get_string_buf_chk(&argvars[1], buf2);
 
     if (pat == NULL || text == NULL)
-	EMSG(_(e_invarg));
+	emsg(_(e_invarg));
     else if (pattern_match(pat, text, FALSE) != (atype == ASSERT_MATCH))
     {
 	prepare_assert_error(&ga);
@@ -9602,9 +9602,9 @@ typval_compare(
 		|| (type != TYPE_EQUAL && type != TYPE_NEQUAL))
 	{
 	    if (typ1->v_type != typ2->v_type)
-		EMSG(_("E977: Can only compare Blob with Blob"));
+		emsg(_("E977: Can only compare Blob with Blob"));
 	    else
-		EMSG(_(e_invalblob));
+		emsg(_(e_invalblob));
 	    clear_tv(typ1);
 	    return FAIL;
 	}
@@ -9629,9 +9629,9 @@ typval_compare(
 		|| (type != TYPE_EQUAL && type != TYPE_NEQUAL))
 	{
 	    if (typ1->v_type != typ2->v_type)
-		EMSG(_("E691: Can only compare List with List"));
+		emsg(_("E691: Can only compare List with List"));
 	    else
-		EMSG(_("E692: Invalid operation for List"));
+		emsg(_("E692: Invalid operation for List"));
 	    clear_tv(typ1);
 	    return FAIL;
 	}
@@ -9658,9 +9658,9 @@ typval_compare(
 		|| (type != TYPE_EQUAL && type != TYPE_NEQUAL))
 	{
 	    if (typ1->v_type != typ2->v_type)
-		EMSG(_("E735: Can only compare Dictionary with Dictionary"));
+		emsg(_("E735: Can only compare Dictionary with Dictionary"));
 	    else
-		EMSG(_("E736: Invalid operation for Dictionary"));
+		emsg(_("E736: Invalid operation for Dictionary"));
 	    clear_tv(typ1);
 	    return FAIL;
 	}
@@ -9679,7 +9679,7 @@ typval_compare(
     {
 	if (type != TYPE_EQUAL && type != TYPE_NEQUAL)
 	{
-	    EMSG(_("E694: Invalid operation for Funcrefs"));
+	    emsg(_("E694: Invalid operation for Funcrefs"));
 	    clear_tv(typ1);
 	    return FAIL;
 	}
@@ -10672,7 +10672,7 @@ filter_map(typval_T *argvars, typval_T *
     }
     else
     {
-	EMSG2(_(e_listdictarg), ermsg);
+	semsg(_(e_listdictarg), ermsg);
 	return;
     }
 
@@ -10740,7 +10740,7 @@ filter_map(typval_T *argvars, typval_T *
 		    break;
 		if (tv.v_type != VAR_NUMBER)
 		{
-		    EMSG(_(e_invalblob));
+		    emsg(_(e_invalblob));
 		    return;
 		}
 		tv.v_type = VAR_NUMBER;
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -1188,7 +1188,7 @@ get_float_arg(typval_T *argvars, float_T
 	*f = (float_T)argvars[0].vval.v_number;
 	return OK;
     }
-    EMSG(_("E808: Number or Float required"));
+    emsg(_("E808: Number or Float required"));
     return FAIL;
 }
 
@@ -1269,7 +1269,7 @@ f_add(typval_T *argvars, typval_T *rettv
 	}
     }
     else
-	EMSG(_(e_listreq));
+	emsg(_(e_listreq));
 }
 
 /*
@@ -1954,7 +1954,7 @@ get_buf_arg(typval_T *arg)
     buf = tv_get_buf(arg, FALSE);
     --emsg_off;
     if (buf == NULL)
-	EMSG2(_("E158: Invalid buffer name: %s"), tv_get_string(arg));
+	semsg(_("E158: Invalid buffer name: %s"), tv_get_string(arg));
     return buf;
 }
 #endif
@@ -2130,7 +2130,7 @@ f_call(typval_T *argvars, typval_T *rett
 
     if (argvars[1].v_type != VAR_LIST)
     {
-	EMSG(_(e_listreq));
+	emsg(_(e_listreq));
 	return;
     }
     if (argvars[1].vval.v_list == NULL)
@@ -2152,7 +2152,7 @@ f_call(typval_T *argvars, typval_T *rett
     {
 	if (argvars[2].v_type != VAR_DICT)
 	{
-	    EMSG(_(e_dictreq));
+	    emsg(_(e_dictreq));
 	    return;
 	}
 	selfdict = argvars[2].vval.v_dict;
@@ -2563,7 +2563,7 @@ f_complete(typval_T *argvars, typval_T *
 
     if ((State & INSERT) == 0)
     {
-	EMSG(_("E785: complete() can only be used in Insert mode"));
+	emsg(_("E785: complete() can only be used in Insert mode"));
 	return;
     }
 
@@ -2574,7 +2574,7 @@ f_complete(typval_T *argvars, typval_T *
 
     if (argvars[1].v_type != VAR_LIST || argvars[1].vval.v_list == NULL)
     {
-	EMSG(_(e_invarg));
+	emsg(_(e_invarg));
 	return;
     }
 
@@ -2770,7 +2770,7 @@ f_count(typval_T *argvars, typval_T *ret
 		    {
 			li = list_find(l, idx);
 			if (li == NULL)
-			    EMSGN(_(e_listidx), idx);
+			    semsg(_(e_listidx), idx);
 		    }
 		}
 		if (error)
@@ -2793,7 +2793,7 @@ f_count(typval_T *argvars, typval_T *ret
 	    if (argvars[2].v_type != VAR_UNKNOWN)
 	    {
 		if (argvars[3].v_type != VAR_UNKNOWN)
-		    EMSG(_(e_invarg));
+		    emsg(_(e_invarg));
 	    }
 
 	    todo = error ? 0 : (int)d->dv_hashtab.ht_used;
@@ -2809,7 +2809,7 @@ f_count(typval_T *argvars, typval_T *ret
 	}
     }
     else
-	EMSG2(_(e_listdictarg), "count()");
+	semsg(_(e_listdictarg), "count()");
     rettv->vval.v_number = n;
 }
 
@@ -2864,7 +2864,7 @@ f_cursor(typval_T *argvars, typval_T *re
 
 	if (list2fpos(argvars, &pos, NULL, &curswant) == FAIL)
 	{
-	    EMSG(_(e_invarg));
+	    emsg(_(e_invarg));
 	    return;
 	}
 	line = pos.lnum;
@@ -2925,7 +2925,7 @@ f_debugbreak(typval_T *argvars, typval_T
     rettv->vval.v_number = FAIL;
     pid = (int)tv_get_number(&argvars[0]);
     if (pid == 0)
-	EMSG(_(e_invarg));
+	emsg(_(e_invarg));
     else
     {
 	HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, 0, pid);
@@ -2952,7 +2952,7 @@ f_deepcopy(typval_T *argvars, typval_T *
     if (argvars[1].v_type != VAR_UNKNOWN)
 	noref = (int)tv_get_number_chk(&argvars[1], NULL);
     if (noref < 0 || noref > 1)
-	EMSG(_(e_invarg));
+	emsg(_(e_invarg));
     else
     {
 	copyID = get_copyID();
@@ -2977,7 +2977,7 @@ f_delete(typval_T *argvars, typval_T *re
     name = tv_get_string(&argvars[0]);
     if (name == NULL || *name == NUL)
     {
-	EMSG(_(e_invarg));
+	emsg(_(e_invarg));
 	return;
     }
 
@@ -2996,7 +2996,7 @@ f_delete(typval_T *argvars, typval_T *re
 	/* delete a directory recursively */
 	rettv->vval.v_number = delete_recursive(name);
     else
-	EMSG2(_(e_invexpr2), flags);
+	semsg(_(e_invexpr2), flags);
 }
 
 /*
@@ -3255,13 +3255,13 @@ f_eval(typval_T *argvars, typval_T *rett
     if (s == NULL || eval1(&s, rettv, TRUE) == FAIL)
     {
 	if (p != NULL && !aborting())
-	    EMSG2(_(e_invexpr2), p);
+	    semsg(_(e_invexpr2), p);
 	need_clr_eos = FALSE;
 	rettv->v_type = VAR_NUMBER;
 	rettv->vval.v_number = 0;
     }
     else if (*s != NUL)
-	EMSG(_(e_trailing));
+	emsg(_(e_trailing));
 }
 
 /*
@@ -3528,7 +3528,7 @@ f_expand(typval_T *argvars, typval_T *re
 {
     char_u	*s;
     int		len;
-    char_u	*errormsg;
+    char	*errormsg;
     int		options = WILD_SILENT|WILD_USE_NL|WILD_LIST_NOTFOUND;
     expand_T	xpc;
     int		error = FALSE;
@@ -3624,7 +3624,7 @@ f_extend(typval_T *argvars, typval_T *re
 		    item = list_find(l1, before);
 		    if (item == NULL)
 		    {
-			EMSGN(_(e_listidx), before);
+			semsg(_(e_listidx), before);
 			return;
 		    }
 		}
@@ -3660,7 +3660,7 @@ f_extend(typval_T *argvars, typval_T *re
 			break;
 		if (i == 3)
 		{
-		    EMSG2(_(e_invarg2), action);
+		    semsg(_(e_invarg2), action);
 		    return;
 		}
 	    }
@@ -3673,7 +3673,7 @@ f_extend(typval_T *argvars, typval_T *re
 	}
     }
     else
-	EMSG2(_(e_listdictarg), "extend()");
+	semsg(_(e_listdictarg), "extend()");
 }
 
 /*
@@ -4197,12 +4197,12 @@ common_function(typval_T *argvars, typva
 
     if (s == NULL || *s == NUL || (use_string && VIM_ISDIGIT(*s))
 					 || (is_funcref && trans_name == NULL))
-	EMSG2(_(e_invarg2), use_string ? tv_get_string(&argvars[0]) : s);
+	semsg(_(e_invarg2), use_string ? tv_get_string(&argvars[0]) : s);
     /* Don't check an autoload name for existence here. */
     else if (trans_name != NULL && (is_funcref
 				? find_func(trans_name) == NULL
 				: !translated_function_exists(trans_name)))
-	EMSG2(_("E700: Unknown function: %s"), s);
+	semsg(_("E700: Unknown function: %s"), s);
     else
     {
 	int	dict_idx = 0;
@@ -4247,7 +4247,7 @@ common_function(typval_T *argvars, typva
 	    {
 		if (argvars[dict_idx].v_type != VAR_DICT)
 		{
-		    EMSG(_("E922: expected a dict"));
+		    emsg(_("E922: expected a dict"));
 		    vim_free(name);
 		    goto theend;
 		}
@@ -4258,7 +4258,7 @@ common_function(typval_T *argvars, typva
 	    {
 		if (argvars[arg_idx].v_type != VAR_LIST)
 		{
-		    EMSG(_("E923: Second argument of function() must be a list or a dict"));
+		    emsg(_("E923: Second argument of function() must be a list or a dict"));
 		    vim_free(name);
 		    goto theend;
 		}
@@ -4409,7 +4409,7 @@ f_get(typval_T *argvars, typval_T *rettv
 	{
 	    rettv->v_type = VAR_NUMBER;
 	    if (idx >= blob_len(argvars[0].vval.v_blob))
-		EMSGN(_(e_blobidx), idx);
+		semsg(_(e_blobidx), idx);
 	    else
 		rettv->vval.v_number = blob_get(argvars[0].vval.v_blob, idx);
 	}
@@ -4480,12 +4480,12 @@ f_get(typval_T *argvars, typval_T *rettv
 		}
 	    }
 	    else
-		EMSG2(_(e_invarg2), what);
+		semsg(_(e_invarg2), what);
 	    return;
 	}
     }
     else
-	EMSG2(_(e_listdictarg), "get()");
+	semsg(_(e_listdictarg), "get()");
 
     if (tv == NULL)
     {
@@ -5029,9 +5029,9 @@ f_getcompletion(typval_T *argvars, typva
     if (xpc.xp_context == EXPAND_NOTHING)
     {
 	if (argvars[1].v_type == VAR_STRING)
-	    EMSG2(_(e_invarg2), argvars[1].vval.v_string);
-	else
-	    EMSG(_(e_invarg));
+	    semsg(_(e_invarg2), argvars[1].vval.v_string);
+	else
+	    emsg(_(e_invarg));
 	return;
     }
 
@@ -5363,7 +5363,7 @@ get_qf_loc_list(int is_qf, win_T *wp, ty
 			qf_get_properties(wp, d, rettv->vval.v_dict);
 		}
 		else
-		    EMSG(_(e_dictreq));
+		    emsg(_(e_dictreq));
 	    }
     }
 }
@@ -6765,7 +6765,7 @@ f_has_key(typval_T *argvars, typval_T *r
 {
     if (argvars[0].v_type != VAR_DICT)
     {
-	EMSG(_(e_dictreq));
+	emsg(_(e_dictreq));
 	return;
     }
     if (argvars[0].vval.v_dict == NULL)
@@ -7055,7 +7055,7 @@ f_index(typval_T *argvars, typval_T *ret
     }
     else if (argvars[0].v_type != VAR_LIST)
     {
-	EMSG(_(e_listreq));
+	emsg(_(e_listreq));
 	return;
     }
 
@@ -7155,7 +7155,7 @@ f_inputlist(typval_T *argvars, typval_T 
 #endif
     if (argvars[0].v_type != VAR_LIST || argvars[0].vval.v_list == NULL)
     {
-	EMSG2(_(e_listarg), "inputlist()");
+	semsg(_(e_listarg), "inputlist()");
 	return;
     }
 
@@ -7256,7 +7256,7 @@ f_insert(typval_T *argvars, typval_T *re
 		return;		// type error; errmsg already given
 	    if (before < 0 || before > len)
 	    {
-		EMSG2(_(e_invarg2), tv_get_string(&argvars[2]));
+		semsg(_(e_invarg2), tv_get_string(&argvars[2]));
 		return;
 	    }
 	}
@@ -7265,7 +7265,7 @@ f_insert(typval_T *argvars, typval_T *re
 	    return;
 	if (val < 0 || val > 255)
 	{
-	    EMSG2(_(e_invarg2), tv_get_string(&argvars[1]));
+	    semsg(_(e_invarg2), tv_get_string(&argvars[1]));
 	    return;
 	}
 
@@ -7279,7 +7279,7 @@ f_insert(typval_T *argvars, typval_T *re
 	copy_tv(&argvars[0], rettv);
     }
     else if (argvars[0].v_type != VAR_LIST)
-	EMSG2(_(e_listarg), "insert()");
+	semsg(_(e_listarg), "insert()");
     else if ((l = argvars[0].vval.v_list) != NULL && !tv_check_lock(l->lv_lock,
 				      (char_u *)N_("insert() argument"), TRUE))
     {
@@ -7295,7 +7295,7 @@ f_insert(typval_T *argvars, typval_T *re
 	    item = list_find(l, before);
 	    if (item == NULL)
 	    {
-		EMSGN(_(e_listidx), before);
+		semsg(_(e_listidx), before);
 		l = NULL;
 	    }
 	}
@@ -7357,7 +7357,7 @@ f_islocked(typval_T *argvars, typval_T *
     if (end != NULL && lv.ll_name != NULL)
     {
 	if (*end != NUL)
-	    EMSG(_(e_trailing));
+	    emsg(_(e_trailing));
 	else
 	{
 	    if (lv.ll_tv == NULL)
@@ -7375,9 +7375,9 @@ f_islocked(typval_T *argvars, typval_T *
 		}
 	    }
 	    else if (lv.ll_range)
-		EMSG(_("E786: Range not allowed"));
+		emsg(_("E786: Range not allowed"));
 	    else if (lv.ll_newkey != NULL)
-		EMSG2(_(e_dictkey), lv.ll_newkey);
+		semsg(_(e_dictkey), lv.ll_newkey);
 	    else if (lv.ll_list != NULL)
 		/* List item. */
 		rettv->vval.v_number = tv_islocked(&lv.ll_li->li_tv);
@@ -7423,13 +7423,13 @@ get_job_arg(typval_T *tv)
 
     if (tv->v_type != VAR_JOB)
     {
-	EMSG2(_(e_invarg2), tv_get_string(tv));
+	semsg(_(e_invarg2), tv_get_string(tv));
 	return NULL;
     }
     job = tv->vval.v_job;
 
     if (job == NULL)
-	EMSG(_("E916: not a valid job"));
+	emsg(_("E916: not a valid job"));
     return job;
 }
 
@@ -7535,7 +7535,7 @@ f_join(typval_T *argvars, typval_T *rett
 
     if (argvars[0].v_type != VAR_LIST)
     {
-	EMSG(_(e_listreq));
+	emsg(_(e_listreq));
 	return;
     }
     if (argvars[0].vval.v_list == NULL)
@@ -7570,7 +7570,7 @@ f_js_decode(typval_T *argvars, typval_T 
     reader.js_fill = NULL;
     reader.js_used = 0;
     if (json_decode_all(&reader, rettv, JSON_JS) != OK)
-	EMSG(_(e_invarg));
+	emsg(_(e_invarg));
 }
 
 /*
@@ -7661,7 +7661,7 @@ f_len(typval_T *argvars, typval_T *rettv
 	case VAR_PARTIAL:
 	case VAR_JOB:
 	case VAR_CHANNEL:
-	    EMSG(_("E701: Invalid type for len()"));
+	    emsg(_("E701: Invalid type for len()"));
 	    break;
     }
 }
@@ -8199,7 +8199,7 @@ matchadd_dict_arg(typval_T *tv, char_u *
 
     if (tv->v_type != VAR_DICT)
     {
-	EMSG(_(e_dictreq));
+	emsg(_(e_dictreq));
 	return FAIL;
     }
 
@@ -8212,7 +8212,7 @@ matchadd_dict_arg(typval_T *tv, char_u *
 	*win = find_win_by_nr_or_id(&di->di_tv);
 	if (*win == NULL)
 	{
-	    EMSG(_("E957: Invalid window number"));
+	    emsg(_("E957: Invalid window number"));
 	    return FAIL;
 	}
     }
@@ -8256,7 +8256,7 @@ f_matchadd(typval_T *argvars UNUSED, typ
 	return;
     if (id >= 1 && id <= 3)
     {
-	EMSGN(_("E798: ID is reserved for \":match\": %ld"), id);
+	semsg(_("E798: ID is reserved for \":match\": %ld"), id);
 	return;
     }
 
@@ -8289,7 +8289,7 @@ f_matchaddpos(typval_T *argvars UNUSED, 
 
     if (argvars[1].v_type != VAR_LIST)
     {
-	EMSG2(_(e_listarg), "matchaddpos()");
+	semsg(_(e_listarg), "matchaddpos()");
 	return;
     }
     l = argvars[1].vval.v_list;
@@ -8314,7 +8314,7 @@ f_matchaddpos(typval_T *argvars UNUSED, 
     /* id == 3 is ok because matchaddpos() is supposed to substitute :3match */
     if (id == 1 || id == 2)
     {
-	EMSGN(_("E798: ID is reserved for \":match\": %ld"), id);
+	semsg(_("E798: ID is reserved for \":match\": %ld"), id);
 	return;
     }
 
@@ -8461,7 +8461,7 @@ max_min(typval_T *argvars, typval_T *ret
 	}
     }
     else
-	EMSG2(_(e_listdictarg), domax ? "max()" : "min()");
+	semsg(_(e_listdictarg), domax ? "max()" : "min()");
     rettv->vval.v_number = error ? 0 : n;
 }
 
@@ -9027,9 +9027,9 @@ f_range(typval_T *argvars, typval_T *ret
     if (error)
 	return;		/* type error; errmsg already given */
     if (stride == 0)
-	EMSG(_("E726: Stride is zero"));
+	emsg(_("E726: Stride is zero"));
     else if (stride > 0 ? end + 1 < start : end - 1 > start)
-	EMSG(_("E727: Start past end"));
+	emsg(_("E727: Start past end"));
     else
     {
 	if (rettv_list_alloc(rettv) == OK)
@@ -9089,7 +9089,7 @@ f_readfile(typval_T *argvars, typval_T *
     fname = tv_get_string(&argvars[0]);
     if (*fname == NUL || (fd = mch_fopen((char *)fname, READBIN)) == NULL)
     {
-	EMSG2(_(e_notopen), *fname == NUL ? (char_u *)_("<empty>") : fname);
+	semsg(_(e_notopen), *fname == NUL ? (char_u *)_("<empty>") : fname);
 	return;
     }
 
@@ -9097,7 +9097,7 @@ f_readfile(typval_T *argvars, typval_T *
     {
 	if (read_blob(fd, rettv->vval.v_blob) == FAIL)
 	{
-	    EMSG("cannot read file");
+	    emsg("cannot read file");
 	    blob_free(rettv->vval.v_blob);
 	}
 	fclose(fd);
@@ -9437,7 +9437,7 @@ check_connection(void)
     make_connection();
     if (X_DISPLAY == NULL)
     {
-	EMSG(_("E240: No connection to the X server"));
+	emsg(_("E240: No connection to the X server"));
 	return FAIL;
     }
     return OK;
@@ -9483,11 +9483,11 @@ remote_common(typval_T *argvars, typval_
     {
 	if (r != NULL)
 	{
-	    EMSG(r);		/* sending worked but evaluation failed */
+	    emsg((char *)r);	// sending worked but evaluation failed
 	    vim_free(r);
 	}
 	else
-	    EMSG2(_("E241: Unable to send to %s"), server_name);
+	    semsg(_("E241: Unable to send to %s"), server_name);
 	return;
     }
 
@@ -9637,7 +9637,7 @@ f_remote_read(typval_T *argvars UNUSED, 
 		|| serverReadReply(X_DISPLAY, serverStrToWin(serverid),
 						       &r, FALSE, timeout) < 0)
 # endif
-	    EMSG(_("E277: Unable to read a server reply"));
+	    emsg(_("E277: Unable to read a server reply"));
     }
 #endif
     rettv->v_type = VAR_STRING;
@@ -9669,7 +9669,7 @@ f_remote_startserver(typval_T *argvars U
     if (server == NULL)
 	return;		/* type error; errmsg already given */
     if (serverName != NULL)
-	EMSG(_("E941: already started a server"));
+	emsg(_("E941: already started a server"));
     else
     {
 # ifdef FEAT_X11
@@ -9680,7 +9680,7 @@ f_remote_startserver(typval_T *argvars U
 # endif
     }
 #else
-    EMSG(_("E942: +clientserver feature not available"));
+    emsg(_("E942: +clientserver feature not available"));
 #endif
 }
 
@@ -9704,7 +9704,7 @@ f_remove(typval_T *argvars, typval_T *re
     if (argvars[0].v_type == VAR_DICT)
     {
 	if (argvars[2].v_type != VAR_UNKNOWN)
-	    EMSG2(_(e_toomanyarg), "remove()");
+	    semsg(_(e_toomanyarg), "remove()");
 	else if ((d = argvars[0].vval.v_dict) != NULL
 		&& !tv_check_lock(d->dv_lock, arg_errmsg, TRUE))
 	{
@@ -9713,7 +9713,7 @@ f_remove(typval_T *argvars, typval_T *re
 	    {
 		di = dict_find(d, key, -1);
 		if (di == NULL)
-		    EMSG2(_(e_dictkey), key);
+		    semsg(_(e_dictkey), key);
 		else if (!var_check_fixed(di->di_flags, arg_errmsg, TRUE)
 			    && !var_check_ro(di->di_flags, arg_errmsg, TRUE))
 		{
@@ -9738,7 +9738,7 @@ f_remove(typval_T *argvars, typval_T *re
 		idx = len + idx;
 	    if (idx < 0 || idx >= len)
 	    {
-		EMSGN(_(e_blobidx), idx);
+		semsg(_(e_blobidx), idx);
 		return;
 	    }
 	    if (argvars[2].v_type == VAR_UNKNOWN)
@@ -9762,7 +9762,7 @@ f_remove(typval_T *argvars, typval_T *re
 		    end = len + end;
 		if (end >= len || idx > end)
 		{
-		    EMSGN(_(e_blobidx), end);
+		    semsg(_(e_blobidx), end);
 		    return;
 		}
 		blob = blob_alloc();
@@ -9787,7 +9787,7 @@ f_remove(typval_T *argvars, typval_T *re
 	}
     }
     else if (argvars[0].v_type != VAR_LIST)
-	EMSG2(_(e_listdictarg), "remove()");
+	semsg(_(e_listdictarg), "remove()");
     else if ((l = argvars[0].vval.v_list) != NULL
 			       && !tv_check_lock(l->lv_lock, arg_errmsg, TRUE))
     {
@@ -9795,7 +9795,7 @@ f_remove(typval_T *argvars, typval_T *re
 	if (error)
 	    ;		// type error: do nothing, errmsg already given
 	else if ((item = list_find(l, idx)) == NULL)
-	    EMSGN(_(e_listidx), idx);
+	    semsg(_(e_listidx), idx);
 	else
 	{
 	    if (argvars[2].v_type == VAR_UNKNOWN)
@@ -9812,7 +9812,7 @@ f_remove(typval_T *argvars, typval_T *re
 		if (error)
 		    ;		// type error: do nothing
 		else if ((item2 = list_find(l, end)) == NULL)
-		    EMSGN(_(e_listidx), end);
+		    semsg(_(e_listidx), end);
 		else
 		{
 		    int	    cnt = 0;
@@ -9824,7 +9824,7 @@ f_remove(typval_T *argvars, typval_T *re
 			    break;
 		    }
 		    if (li == NULL)  /* didn't find "item2" after "item" */
-			EMSG(_(e_invrange));
+			emsg(_(e_invrange));
 		    else
 		    {
 			vimlist_remove(l, item, item2);
@@ -9976,7 +9976,7 @@ f_resolve(typval_T *argvars, typval_T *r
 		{
 		    vim_free(p);
 		    vim_free(remain);
-		    EMSG(_("E655: Too many symbolic links (cycle?)"));
+		    emsg(_("E655: Too many symbolic links (cycle?)"));
 		    rettv->vval.v_string = NULL;
 		    goto fail;
 		}
@@ -10134,7 +10134,7 @@ f_reverse(typval_T *argvars, typval_T *r
     }
 
     if (argvars[0].v_type != VAR_LIST)
-	EMSG2(_(e_listarg), "reverse()");
+	semsg(_(e_listarg), "reverse()");
     else if ((l = argvars[0].vval.v_list) != NULL
 	    && !tv_check_lock(l->lv_lock,
 				    (char_u *)N_("reverse() argument"), TRUE))
@@ -10202,7 +10202,7 @@ get_search_arg(typval_T *varp, int *flag
 			     }
 			  if (mask == 0)
 			  {
-			      EMSG2(_(e_invarg2), flags);
+			      semsg(_(e_invarg2), flags);
 			      dir = 0;
 			  }
 			  else
@@ -10279,7 +10279,7 @@ search_cmn(typval_T *argvars, pos_T *mat
     if (((flags & (SP_REPEAT | SP_RETCOUNT)) != 0)
 	    || ((flags & SP_NOMOVE) && (flags & SP_SETPCMARK)))
     {
-	EMSG2(_(e_invarg2), tv_get_string(&argvars[1]));
+	semsg(_(e_invarg2), tv_get_string(&argvars[1]));
 	goto theend;
     }
 
@@ -10485,7 +10485,7 @@ searchpair_cmn(typval_T *argvars, pos_T 
     if ((flags & (SP_END | SP_SUBPAT)) != 0
 	    || ((flags & SP_NOMOVE) && (flags & SP_SETPCMARK)))
     {
-	EMSG2(_(e_invarg2), tv_get_string(&argvars[3]));
+	semsg(_(e_invarg2), tv_get_string(&argvars[3]));
 	goto theend;
     }
 
@@ -10504,7 +10504,7 @@ searchpair_cmn(typval_T *argvars, pos_T 
 	    && skip->v_type != VAR_STRING)
 	{
 	    /* Type error */
-	    EMSG2(_(e_invarg2), tv_get_string(&argvars[4]));
+	    semsg(_(e_invarg2), tv_get_string(&argvars[4]));
 	    goto theend;
 	}
 	if (argvars[5].v_type != VAR_UNKNOWN)
@@ -10512,7 +10512,7 @@ searchpair_cmn(typval_T *argvars, pos_T 
 	    lnum_stop = (long)tv_get_number_chk(&argvars[5], NULL);
 	    if (lnum_stop < 0)
 	    {
-		EMSG2(_(e_invarg2), tv_get_string(&argvars[5]));
+		semsg(_(e_invarg2), tv_get_string(&argvars[5]));
 		goto theend;
 	    }
 #ifdef FEAT_RELTIME
@@ -10521,7 +10521,7 @@ searchpair_cmn(typval_T *argvars, pos_T 
 		time_limit = (long)tv_get_number_chk(&argvars[6], NULL);
 		if (time_limit < 0)
 		{
-		    EMSG2(_(e_invarg2), tv_get_string(&argvars[6]));
+		    semsg(_(e_invarg2), tv_get_string(&argvars[6]));
 		    goto theend;
 		}
 	    }
@@ -10786,7 +10786,7 @@ f_server2client(typval_T *argvars UNUSED
 
     if (serverSendReply(server, reply) < 0)
     {
-	EMSG(_("E258: Unable to send to client"));
+	emsg(_("E258: Unable to send to client"));
 	return;
     }
     rettv->vval.v_number = 0;
@@ -10898,7 +10898,7 @@ f_setcharsearch(typval_T *argvars, typva
 
     if (argvars[0].v_type != VAR_DICT)
     {
-	EMSG(_(e_dictreq));
+	emsg(_(e_dictreq));
 	return;
     }
 
@@ -10966,7 +10966,7 @@ f_setfperm(typval_T *argvars, typval_T *
 	return;
     if (STRLEN(mode_str) != 9)
     {
-	EMSG2(_(e_invarg2), mode_str);
+	semsg(_(e_invarg2), mode_str);
 	return;
     }
 
@@ -11013,9 +11013,9 @@ set_qf_ll_list(
 
 #ifdef FEAT_QUICKFIX
     if (list_arg->v_type != VAR_LIST)
-	EMSG(_(e_listreq));
+	emsg(_(e_listreq));
     else if (recursive != 0)
-	EMSG(_(e_au_recursive));
+	emsg(_(e_au_recursive));
     else
     {
 	list_T  *l = list_arg->vval.v_list;
@@ -11031,12 +11031,12 @@ set_qf_ll_list(
 		    act[1] == NUL)
 		action = *act;
 	    else
-		EMSG2(_(e_invact), act);
+		semsg(_(e_invact), act);
 	}
 	else if (action_arg->v_type == VAR_UNKNOWN)
 	    action = ' ';
 	else
-	    EMSG(_(e_stringreq));
+	    emsg(_(e_stringreq));
 
 	if (action_arg->v_type != VAR_UNKNOWN
 		&& what_arg->v_type != VAR_UNKNOWN)
@@ -11045,7 +11045,7 @@ set_qf_ll_list(
 		d = what_arg->vval.v_dict;
 	    else
 	    {
-		EMSG(_(e_dictreq));
+		emsg(_(e_dictreq));
 		valid_dict = FALSE;
 	    }
 	}
@@ -11090,7 +11090,7 @@ f_setmatches(typval_T *argvars UNUSED, t
     rettv->vval.v_number = -1;
     if (argvars[0].v_type != VAR_LIST)
     {
-	EMSG(_(e_listreq));
+	emsg(_(e_listreq));
 	return;
     }
     if ((l = argvars[0].vval.v_list) != NULL)
@@ -11104,7 +11104,7 @@ f_setmatches(typval_T *argvars UNUSED, t
 	    if (li->li_tv.v_type != VAR_DICT
 		    || (d = li->li_tv.vval.v_dict) == NULL)
 	    {
-		EMSG(_(e_invarg));
+		emsg(_(e_invarg));
 		return;
 	    }
 	    if (!(dict_find(d, (char_u *)"group", -1) != NULL
@@ -11113,7 +11113,7 @@ f_setmatches(typval_T *argvars UNUSED, t
 			&& dict_find(d, (char_u *)"priority", -1) != NULL
 			&& dict_find(d, (char_u *)"id", -1) != NULL))
 	    {
-		EMSG(_(e_invarg));
+		emsg(_(e_invarg));
 		return;
 	    }
 	    li = li->li_next;
@@ -11224,7 +11224,7 @@ f_setpos(typval_T *argvars, typval_T *re
 		    rettv->vval.v_number = 0;
 	    }
 	    else
-		EMSG(_(e_invarg));
+		emsg(_(e_invarg));
 	}
     }
 }
@@ -11424,7 +11424,7 @@ f_settagstack(typval_T *argvars, typval_
     // second argument: dict with items to set in the tag stack
     if (argvars[1].v_type != VAR_DICT)
     {
-	EMSG(_(e_dictreq));
+	emsg(_(e_dictreq));
 	return;
     }
     d = argvars[1].vval.v_dict;
@@ -11445,13 +11445,13 @@ f_settagstack(typval_T *argvars, typval_
 	    action = *actstr;
 	else
 	{
-	    EMSG2(_(e_invact2), actstr);
+	    semsg(_(e_invact2), actstr);
 	    return;
 	}
     }
     else
     {
-	EMSG(_(e_stringreq));
+	emsg(_(e_stringreq));
 	return;
     }
 
@@ -11545,7 +11545,7 @@ f_sign_define(typval_T *argvars, typval_
     {
 	if (argvars[1].v_type != VAR_DICT)
 	{
-	    EMSG(_(e_dictreq));
+	    emsg(_(e_dictreq));
 	    return;
 	}
 
@@ -11616,7 +11616,7 @@ f_sign_getplaced(typval_T *argvars, typv
 	    if (argvars[1].v_type != VAR_DICT ||
 				((dict = argvars[1].vval.v_dict) == NULL))
 	    {
-		EMSG(_(e_dictreq));
+		emsg(_(e_dictreq));
 		return;
 	    }
 	    if ((di = dict_find(dict, (char_u *)"lnum", -1)) != NULL)
@@ -11667,7 +11667,7 @@ f_sign_jump(typval_T *argvars, typval_T 
 	return;
     if (sign_id <= 0)
     {
-	EMSG(_(e_invarg));
+	emsg(_(e_invarg));
 	return;
     }
 
@@ -11719,7 +11719,7 @@ f_sign_place(typval_T *argvars, typval_T
 	return;
     if (sign_id < 0)
     {
-	EMSG(_(e_invarg));
+	emsg(_(e_invarg));
 	return;
     }
 
@@ -11751,7 +11751,7 @@ f_sign_place(typval_T *argvars, typval_T
 	if (argvars[4].v_type != VAR_DICT ||
 				((dict = argvars[4].vval.v_dict) == NULL))
 	{
-	    EMSG(_(e_dictreq));
+	    emsg(_(e_dictreq));
 	    goto cleanup;
 	}
 
@@ -11823,7 +11823,7 @@ f_sign_unplace(typval_T *argvars, typval
 
     if (argvars[0].v_type != VAR_STRING)
     {
-	EMSG(_(e_invarg));
+	emsg(_(e_invarg));
 	return;
     }
 
@@ -11841,7 +11841,7 @@ f_sign_unplace(typval_T *argvars, typval
     {
 	if (argvars[1].v_type != VAR_DICT)
 	{
-	    EMSG(_(e_dictreq));
+	    emsg(_(e_dictreq));
 	    goto cleanup;
 	}
 	dict = argvars[1].vval.v_dict;
@@ -12120,7 +12120,7 @@ do_sort_uniq(typval_T *argvars, typval_T
     sortinfo = &info;
 
     if (argvars[0].v_type != VAR_LIST)
-	EMSG2(_(e_listarg), sort ? "sort()" : "uniq()");
+	semsg(_(e_listarg), sort ? "sort()" : "uniq()");
     else
     {
 	l = argvars[0].vval.v_list;
@@ -12163,7 +12163,7 @@ do_sort_uniq(typval_T *argvars, typval_T
 		    info.item_compare_func = tv_get_string(&argvars[1]);
 		else if (i != 0)
 		{
-		    EMSG(_(e_invarg));
+		    emsg(_(e_invarg));
 		    goto theend;
 		}
 		if (info.item_compare_func != NULL)
@@ -12203,7 +12203,7 @@ do_sort_uniq(typval_T *argvars, typval_T
 		/* optional third argument: {dict} */
 		if (argvars[2].v_type != VAR_DICT)
 		{
-		    EMSG(_(e_dictreq));
+		    emsg(_(e_dictreq));
 		    goto theend;
 		}
 		info.item_compare_selfdict = argvars[2].vval.v_dict;
@@ -12233,7 +12233,7 @@ do_sort_uniq(typval_T *argvars, typval_T
 					 || info.item_compare_partial != NULL)
 		    && item_compare2((void *)&ptrs[0], (void *)&ptrs[1])
 							 == ITEM_COMPARE_FAIL)
-		EMSG(_("E702: Sort compare function failed"));
+		emsg(_("E702: Sort compare function failed"));
 	    else
 	    {
 		/* Sort the array with item pointers. */
@@ -12271,7 +12271,7 @@ do_sort_uniq(typval_T *argvars, typval_T
 		    ptrs[i++].item = li;
 		if (info.item_compare_func_err)
 		{
-		    EMSG(_("E882: Uniq compare function failed"));
+		    emsg(_("E882: Uniq compare function failed"));
 		    break;
 		}
 	    }
@@ -12580,7 +12580,7 @@ f_str2nr(typval_T *argvars, typval_T *re
 	base = (int)tv_get_number(&argvars[1]);
 	if (base != 2 && base != 8 && base != 10 && base != 16)
 	{
-	    EMSG(_(e_invarg));
+	    emsg(_(e_invarg));
 	    return;
 	}
     }
@@ -12782,7 +12782,7 @@ f_strchars(typval_T *argvars, typval_T *
     if (argvars[1].v_type != VAR_UNKNOWN)
 	skipcc = (int)tv_get_number_chk(&argvars[1], NULL);
     if (skipcc < 0 || skipcc > 1)
-	EMSG(_(e_invarg));
+	emsg(_(e_invarg));
     else
     {
 #ifdef FEAT_MBYTE
@@ -13022,7 +13022,7 @@ f_submatch(typval_T *argvars, typval_T *
 	return;
     if (no < 0 || no >= NSUBEXP)
     {
-	EMSGN(_("E935: invalid submatch number: %d"), no);
+	semsg(_("E935: invalid submatch number: %d"), no);
 	return;
     }
     if (argvars[1].v_type != VAR_UNKNOWN)
@@ -13357,14 +13357,14 @@ get_cmd_output_as_rettv(
 	 */
 	if ((infile = vim_tempname('i', TRUE)) == NULL)
 	{
-	    EMSG(_(e_notmp));
+	    emsg(_(e_notmp));
 	    goto errret;
 	}
 
 	fd = mch_fopen((char *)infile, WRITEBIN);
 	if (fd == NULL)
 	{
-	    EMSG2(_(e_notopen), infile);
+	    semsg(_(e_notopen), infile);
 	    goto errret;
 	}
 	if (argvars[1].v_type == VAR_NUMBER)
@@ -13375,7 +13375,7 @@ get_cmd_output_as_rettv(
 	    buf = buflist_findnr(argvars[1].vval.v_number);
 	    if (buf == NULL)
 	    {
-		EMSGN(_(e_nobufnr), argvars[1].vval.v_number);
+		semsg(_(e_nobufnr), argvars[1].vval.v_number);
 		fclose(fd);
 		goto errret;
 	    }
@@ -13419,7 +13419,7 @@ get_cmd_output_as_rettv(
 	    err = TRUE;
 	if (err)
 	{
-	    EMSG(_("E677: Error writing temp file"));
+	    emsg(_("E677: Error writing temp file"));
 	    goto errret;
 	}
     }
@@ -13587,7 +13587,7 @@ f_tabpagenr(typval_T *argvars UNUSED, ty
 	    if (STRCMP(arg, "$") == 0)
 		nr = tabpage_index(NULL) - 1;
 	    else
-		EMSG2(_(e_invexpr2), arg);
+		semsg(_(e_invexpr2), arg);
 	}
     }
     else
@@ -13623,7 +13623,7 @@ get_winnr(tabpage_T *tp, typval_T *argva
 	}
 	else
 	{
-	    EMSG2(_(e_invexpr2), arg);
+	    semsg(_(e_invexpr2), arg);
 	    nr = 0;
 	}
     }
@@ -13781,12 +13781,12 @@ f_test_alloc_fail(typval_T *argvars, typ
 	    || argvars[1].v_type != VAR_NUMBER
 	    || argvars[1].vval.v_number < 0
 	    || argvars[2].v_type != VAR_NUMBER)
-	EMSG(_(e_invarg));
+	emsg(_(e_invarg));
     else
     {
 	alloc_fail_id = argvars[0].vval.v_number;
 	if (alloc_fail_id >= aid_last)
-	    EMSG(_(e_invarg));
+	    emsg(_(e_invarg));
 	alloc_fail_countdown = argvars[1].vval.v_number;
 	alloc_fail_repeat = argvars[2].vval.v_number;
 	did_outofmem_msg = FALSE;
@@ -13830,12 +13830,12 @@ f_test_option_not_set(typval_T *argvars,
     char_u *name = (char_u *)"";
 
     if (argvars[0].v_type != VAR_STRING)
-	EMSG(_(e_invarg));
+	emsg(_(e_invarg));
     else
     {
 	name = tv_get_string(&argvars[0]);
 	if (reset_option_was_set(name) == FAIL)
-	    EMSG2(_(e_invarg2), name);
+	    semsg(_(e_invarg2), name);
     }
 }
 
@@ -13851,7 +13851,7 @@ f_test_override(typval_T *argvars, typva
 
     if (argvars[0].v_type != VAR_STRING
 	    || (argvars[1].v_type) != VAR_NUMBER)
-	EMSG(_(e_invarg));
+	emsg(_(e_invarg));
     else
     {
 	name = tv_get_string(&argvars[0]);
@@ -13892,7 +13892,7 @@ f_test_override(typval_T *argvars, typva
 	    }
 	}
 	else
-	    EMSG2(_(e_invarg2), name);
+	    semsg(_(e_invarg2), name);
     }
 }
 
@@ -13980,7 +13980,7 @@ f_test_scrollbar(typval_T *argvars, typv
 	    || (argvars[1].v_type) != VAR_NUMBER
 	    || (argvars[2].v_type) != VAR_NUMBER)
     {
-	EMSG(_(e_invarg));
+	emsg(_(e_invarg));
 	return;
     }
     which = tv_get_string(&argvars[0]);
@@ -13995,7 +13995,7 @@ f_test_scrollbar(typval_T *argvars, typv
 	sb = &gui.bottom_sbar;
     if (sb == NULL)
     {
-	EMSG2(_(e_invarg2), which);
+	semsg(_(e_invarg2), which);
 	return;
     }
     gui_drag_scrollbar(sb, value, dragging);
@@ -14035,7 +14035,7 @@ get_callback(typval_T *arg, partial_T **
     }
     if (arg->v_type == VAR_NUMBER && arg->vval.v_number == 0)
 	return (char_u *)"";
-    EMSG(_("E921: Invalid callback argument"));
+    emsg(_("E921: Invalid callback argument"));
     return NULL;
 }
 
@@ -14069,7 +14069,7 @@ f_timer_info(typval_T *argvars, typval_T
     if (argvars[0].v_type != VAR_UNKNOWN)
     {
 	if (argvars[0].v_type != VAR_NUMBER)
-	    EMSG(_(e_number_exp));
+	    emsg(_(e_number_exp));
 	else
 	{
 	    timer = find_timer((int)tv_get_number(&argvars[0]));
@@ -14091,7 +14091,7 @@ f_timer_pause(typval_T *argvars, typval_
     int		paused = (int)tv_get_number(&argvars[1]);
 
     if (argvars[0].v_type != VAR_NUMBER)
-	EMSG(_(e_number_exp));
+	emsg(_(e_number_exp));
     else
     {
 	timer = find_timer((int)tv_get_number(&argvars[0]));
@@ -14121,7 +14121,7 @@ f_timer_start(typval_T *argvars, typval_
 	if (argvars[2].v_type != VAR_DICT
 				   || (dict = argvars[2].vval.v_dict) == NULL)
 	{
-	    EMSG2(_(e_invarg2), tv_get_string(&argvars[2]));
+	    semsg(_(e_invarg2), tv_get_string(&argvars[2]));
 	    return;
 	}
 	if (dict_find(dict, (char_u *)"repeat", -1) != NULL)
@@ -14157,7 +14157,7 @@ f_timer_stop(typval_T *argvars, typval_T
 
     if (argvars[0].v_type != VAR_NUMBER)
     {
-	EMSG(_(e_number_exp));
+	emsg(_(e_number_exp));
 	return;
     }
     timer = find_timer((int)tv_get_number(&argvars[0]));
@@ -14238,7 +14238,7 @@ f_tr(typval_T *argvars, typval_T *rettv)
 #ifdef FEAT_MBYTE
 error:
 #endif
-	    EMSG2(_(e_invarg2), fromstr);
+	    semsg(_(e_invarg2), fromstr);
 	    ga_clear(&ga);
 	    return;
 	}
@@ -14673,7 +14673,7 @@ f_winrestview(typval_T *argvars, typval_
 
     if (argvars[0].v_type != VAR_DICT
 	    || (dict = argvars[0].vval.v_dict) == NULL)
-	EMSG(_(e_invarg));
+	emsg(_(e_invarg));
     else
     {
 	if (dict_find(dict, (char_u *)"lnum", -1) != NULL)
@@ -14809,7 +14809,7 @@ f_writefile(typval_T *argvars, typval_T 
     }
     else
     {
-	EMSG2(_(e_invarg2), "writefile()");
+	semsg(_(e_invarg2), "writefile()");
 	return;
     }
 
@@ -14840,7 +14840,7 @@ f_writefile(typval_T *argvars, typval_T 
     if (*fname == NUL || (fd = mch_fopen((char *)fname,
 				      append ? APPENDBIN : WRITEBIN)) == NULL)
     {
-	EMSG2(_(e_notcreate), *fname == NUL ? (char_u *)_("<empty>") : fname);
+	semsg(_(e_notcreate), *fname == NUL ? (char_u *)_("<empty>") : fname);
 	ret = -1;
     }
     else if (blob)
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -467,7 +467,7 @@ ex_sort(exarg_T *eap)
 	    s = skip_regexp(p + 1, *p, TRUE, NULL);
 	    if (*s != *p)
 	    {
-		EMSG(_(e_invalpat));
+		emsg(_(e_invalpat));
 		goto sortend;
 	    }
 	    *s = NUL;
@@ -476,7 +476,7 @@ ex_sort(exarg_T *eap)
 	    {
 		if (last_search_pat() == NULL)
 		{
-		    EMSG(_(e_noprevre));
+		    emsg(_(e_noprevre));
 		    goto sortend;
 		}
 		regmatch.regprog = vim_regcomp(last_search_pat(), RE_MAGIC);
@@ -490,7 +490,7 @@ ex_sort(exarg_T *eap)
 	}
 	else
 	{
-	    EMSG2(_(e_invarg2), p);
+	    semsg(_(e_invarg2), p);
 	    goto sortend;
 	}
     }
@@ -498,7 +498,7 @@ ex_sort(exarg_T *eap)
     /* Can only have one of 'n', 'b', 'o' and 'x'. */
     if (format_found > 1)
     {
-	EMSG(_(e_invarg));
+	emsg(_(e_invarg));
 	goto sortend;
     }
 
@@ -668,7 +668,7 @@ sortend:
     vim_free(sortbuf2);
     vim_regfree(regmatch.regprog);
     if (got_int)
-	EMSG(_(e_interr));
+	emsg(_(e_interr));
 }
 
 /*
@@ -725,7 +725,7 @@ ex_retab(exarg_T *eap)
     new_ts = getdigits(&(eap->arg));
     if (new_ts < 0)
     {
-	EMSG(_(e_positive));
+	emsg(_(e_positive));
 	return;
     }
     if (new_ts == 0)
@@ -835,7 +835,7 @@ ex_retab(exarg_T *eap)
 	line_breakcheck();
     }
     if (got_int)
-	EMSG(_(e_interr));
+	emsg(_(e_interr));
 
 #ifdef FEAT_VARTABS
     // If a single value was given then it can be considered equal to
@@ -909,7 +909,7 @@ do_move(linenr_T line1, linenr_T line2, 
 
     if (dest >= line1 && dest < line2)
     {
-	EMSG(_("E134: Cannot move a range of lines into itself"));
+	emsg(_("E134: Cannot move a range of lines into itself"));
 	return FAIL;
     }
 
@@ -1002,7 +1002,7 @@ do_move(linenr_T line1, linenr_T line2, 
 	ml_delete(line1 + extra, TRUE);
 
     if (!global_busy && num_lines > p_report)
-	smsg((char_u *)NGETTEXT("%ld line moved", "%ld lines moved", num_lines),
+	smsg(NGETTEXT("%ld line moved", "%ld lines moved", num_lines),
 			(long)num_lines);
 
     /*
@@ -1147,7 +1147,7 @@ do_bang(
 	{
 	    if (prevcmd == NULL)
 	    {
-		EMSG(_(e_noprev));
+		emsg(_(e_noprev));
 		vim_free(newcmd);
 		return;
 	    }
@@ -1334,7 +1334,7 @@ do_filter(
 	if ((do_in && (itmp = vim_tempname('i', FALSE)) == NULL)
 		|| (do_out && (otmp = vim_tempname('o', FALSE)) == NULL))
 	{
-	    EMSG(_(e_notmp));
+	    emsg(_(e_notmp));
 	    goto filterend;
 	}
 
@@ -1351,7 +1351,7 @@ do_filter(
 #if defined(FEAT_EVAL)
 	if (!aborting())
 #endif
-	    (void)EMSG2(_(e_notcreate), itmp);	/* will call wait_return */
+	    (void)semsg(_(e_notcreate), itmp);	/* will call wait_return */
 	goto filterend;
     }
     if (curbuf != old_curbuf)
@@ -1426,7 +1426,7 @@ do_filter(
 #endif
 		{
 		    msg_putchar('\n');
-		    EMSG2(_(e_notread), otmp);
+		    semsg(_(e_notread), otmp);
 		}
 		goto error;
 	    }
@@ -1514,7 +1514,7 @@ filterend:
     if (curbuf != old_curbuf)
     {
 	--no_wait_return;
-	EMSG(_("E135: *Filter* Autocommands must not change current buffer"));
+	emsg(_("E135: *Filter* Autocommands must not change current buffer"));
     }
     if (itmp != NULL)
 	mch_remove(itmp);
@@ -1871,10 +1871,10 @@ viminfo_error(char *errnum, char *messag
     STRNCAT(IObuff, line, IOSIZE - STRLEN(IObuff) - 1);
     if (IObuff[STRLEN(IObuff) - 1] == '\n')
 	IObuff[STRLEN(IObuff) - 1] = NUL;
-    emsg(IObuff);
+    emsg((char *)IObuff);
     if (++viminfo_errcnt >= 10)
     {
-	EMSG(_("E136: viminfo: Too many errors, skipping rest of file"));
+	emsg(_("E136: viminfo: Too many errors, skipping rest of file"));
 	return TRUE;
     }
     return FALSE;
@@ -1903,7 +1903,7 @@ read_viminfo(
     if (p_verbose > 0)
     {
 	verbose_enter();
-	smsg((char_u *)_("Reading viminfo file \"%s\"%s%s%s"),
+	smsg(_("Reading viminfo file \"%s\"%s%s%s"),
 		fname,
 		(flags & VIF_WANT_INFO) ? _(" info") : "",
 		(flags & VIF_WANT_MARKS) ? _(" marks") : "",
@@ -2003,7 +2003,7 @@ write_viminfo(char_u *file, int forceit)
 	    int	tt = msg_didany;
 
 	    /* avoid a wait_return for this message, it's annoying */
-	    EMSG2(_("E137: Viminfo file is not writable: %s"), fname);
+	    semsg(_("E137: Viminfo file is not writable: %s"), fname);
 	    msg_didany = tt;
 	    fclose(fp_in);
 	    goto end;
@@ -2126,7 +2126,7 @@ write_viminfo(char_u *file, int forceit)
 		{
 		    /* They all exist?  Must be something wrong! Don't write
 		     * the viminfo file then. */
-		    EMSG2(_("E929: Too many viminfo temp files, like %s!"),
+		    semsg(_("E929: Too many viminfo temp files, like %s!"),
 								     tempname);
 		    break;
 		}
@@ -2172,7 +2172,7 @@ write_viminfo(char_u *file, int forceit)
      */
     if (fp_out == NULL)
     {
-	EMSG2(_("E138: Can't write viminfo file %s!"),
+	semsg(_("E138: Can't write viminfo file %s!"),
 		       (fp_in == NULL || tempname == NULL) ? fname : tempname);
 	if (fp_in != NULL)
 	    fclose(fp_in);
@@ -2182,7 +2182,7 @@ write_viminfo(char_u *file, int forceit)
     if (p_verbose > 0)
     {
 	verbose_enter();
-	smsg((char_u *)_("Writing viminfo file \"%s\""), fname);
+	smsg(_("Writing viminfo file \"%s\""), fname);
 	verbose_leave();
     }
 
@@ -2203,7 +2203,7 @@ write_viminfo(char_u *file, int forceit)
 	    if (vim_rename(tempname, fname) == -1)
 	    {
 		++viminfo_errcnt;
-		EMSG2(_("E886: Can't rename viminfo file to %s!"), fname);
+		semsg(_("E886: Can't rename viminfo file to %s!"), fname);
 	    }
 # ifdef WIN3264
 	    /* If the viminfo file was hidden then also hide the new file. */
@@ -3127,7 +3127,7 @@ ex_file(exarg_T *eap)
 		|| eap->line2 > 0
 		|| eap->addr_count > 1))
     {
-	EMSG(_(e_invarg));
+	emsg(_(e_invarg));
 	return;
     }
 
@@ -3205,7 +3205,7 @@ do_write(exarg_T *eap)
     {
 	if (eap->cmdidx == CMD_saveas)
 	{
-	    EMSG(_(e_argreq));
+	    emsg(_(e_argreq));
 	    goto theend;
 	}
 	other = FALSE;
@@ -3237,7 +3237,7 @@ do_write(exarg_T *eap)
 	{
 	    /* Overwriting a file that is loaded in another buffer is not a
 	     * good idea. */
-	    EMSG(_(e_bufloaded));
+	    emsg(_(e_bufloaded));
 	    goto theend;
 	}
     }
@@ -3278,7 +3278,7 @@ do_write(exarg_T *eap)
 	    else
 #endif
 	    {
-		EMSG(_("E140: Use ! to write partial buffer"));
+		emsg(_("E140: Use ! to write partial buffer"));
 		goto theend;
 	    }
 	}
@@ -3417,7 +3417,7 @@ check_overwrite(
 	    /* with UNIX it is possible to open a directory */
 	    if (mch_isdir(ffname))
 	    {
-		EMSG2(_(e_isadir2), ffname);
+		semsg(_(e_isadir2), ffname);
 		return FAIL;
 	    }
 #endif
@@ -3434,7 +3434,7 @@ check_overwrite(
 	    else
 #endif
 	    {
-		EMSG(_(e_exists));
+		emsg(_(e_exists));
 		return FAIL;
 	    }
 	}
@@ -3491,7 +3491,7 @@ check_overwrite(
 		else
 #endif
 		{
-		    EMSG2(_("E768: Swap file exists: %s (:silent! overrides)"),
+		    semsg(_("E768: Swap file exists: %s (:silent! overrides)"),
 								    swapname);
 		    vim_free(swapname);
 		    return FAIL;
@@ -3565,7 +3565,7 @@ do_wqall(exarg_T *eap)
 #endif
 	    if (buf->b_ffname == NULL)
 	    {
-		EMSGN(_("E141: No file name for buffer %ld"), (long)buf->b_fnum);
+		semsg(_("E141: No file name for buffer %ld"), (long)buf->b_fnum);
 		++error;
 	    }
 	    else if (check_readonly(&eap->forceit, buf)
@@ -3605,7 +3605,7 @@ not_writing(void)
 {
     if (p_write)
 	return FALSE;
-    EMSG(_("E142: File not written: Writing is disabled by 'write' option"));
+    emsg(_("E142: File not written: Writing is disabled by 'write' option"));
     return TRUE;
 }
 
@@ -3651,9 +3651,9 @@ check_readonly(int *forceit, buf_T *buf)
 	else
 #endif
 	if (buf->b_p_ro)
-	    EMSG(_(e_readonly));
+	    emsg(_(e_readonly));
 	else
-	    EMSG2(_("E505: \"%s\" is read-only (add ! to override)"),
+	    semsg(_("E505: \"%s\" is read-only (add ! to override)"),
 		    buf->b_fname);
 	return TRUE;
     }
@@ -4488,7 +4488,7 @@ theend:
     static void
 delbuf_msg(char_u *name)
 {
-    EMSG2(_("E143: Autocommands unexpectedly deleted new buffer %s"),
+    semsg(_("E143: Autocommands unexpectedly deleted new buffer %s"),
 	    name == NULL ? (char_u *)"" : name);
     vim_free(name);
     au_new_curbuf.br_buf = NULL;
@@ -4707,7 +4707,7 @@ ex_z(exarg_T *eap)
     {
 	if (!VIM_ISDIGIT(*x))
 	{
-	    EMSG(_("E144: non-numeric argument to :z"));
+	    emsg(_("E144: non-numeric argument to :z"));
 	    return;
 	}
 	else
@@ -4817,7 +4817,7 @@ check_restricted(void)
 {
     if (restricted)
     {
-	EMSG(_("E145: Shell commands not allowed in rvim"));
+	emsg(_("E145: Shell commands not allowed in rvim"));
 	return TRUE;
     }
     return FALSE;
@@ -4834,7 +4834,7 @@ check_secure(void)
     if (secure)
     {
 	secure = 2;
-	EMSG(_(e_curdir));
+	emsg(_(e_curdir));
 	return TRUE;
     }
 #ifdef HAVE_SANDBOX
@@ -4844,7 +4844,7 @@ check_secure(void)
      */
     if (sandbox != 0)
     {
-	EMSG(_(e_sandbox));
+	emsg(_(e_sandbox));
 	return TRUE;
     }
 #endif
@@ -4933,7 +4933,7 @@ do_sub(exarg_T *eap)
 				/* don't accept alphanumeric for separator */
 	if (isalpha(*cmd))
 	{
-	    EMSG(_("E146: Regular expressions can't be delimited by letters"));
+	    emsg(_("E146: Regular expressions can't be delimited by letters"));
 	    return;
 	}
 	/*
@@ -4946,7 +4946,7 @@ do_sub(exarg_T *eap)
 	    ++cmd;
 	    if (vim_strchr((char_u *)"/?&", *cmd) == NULL)
 	    {
-		EMSG(_(e_backslash));
+		emsg(_(e_backslash));
 		return;
 	    }
 	    if (*cmd != '&')
@@ -4994,7 +4994,7 @@ do_sub(exarg_T *eap)
 	    {
 		if (old_sub == NULL)	/* there is no previous command */
 		{
-		    EMSG(_(e_nopresub));
+		    emsg(_(e_nopresub));
 		    return;
 		}
 		sub = old_sub;
@@ -5010,7 +5010,7 @@ do_sub(exarg_T *eap)
     {
 	if (old_sub == NULL)	/* there is no previous command */
 	{
-	    EMSG(_(e_nopresub));
+	    emsg(_(e_nopresub));
 	    return;
 	}
 	pat = NULL;		/* search_regcomp() will use previous pattern */
@@ -5137,7 +5137,7 @@ do_sub(exarg_T *eap)
 	i = getdigits(&cmd);
 	if (i <= 0 && !eap->skip && subflags.do_error)
 	{
-	    EMSG(_(e_zerocount));
+	    emsg(_(e_zerocount));
 	    return;
 	}
 	eap->line1 = eap->line2;
@@ -5155,7 +5155,7 @@ do_sub(exarg_T *eap)
 	eap->nextcmd = check_nextcmd(cmd);
 	if (eap->nextcmd == NULL)
 	{
-	    EMSG(_(e_trailing));
+	    emsg(_(e_trailing));
 	    return;
 	}
     }
@@ -5166,14 +5166,14 @@ do_sub(exarg_T *eap)
     if (!subflags.do_count && !curbuf->b_p_ma)
     {
 	/* Substitution is not allowed in non-'modifiable' buffer */
-	EMSG(_(e_modifiable));
+	emsg(_(e_modifiable));
 	return;
     }
 
     if (search_regcomp(pat, RE_SUBST, which_pat, SEARCH_HIS, &regmatch) == FAIL)
     {
 	if (subflags.do_error)
-	    EMSG(_(e_invcmd));
+	    emsg(_(e_invcmd));
 	return;
     }
 
@@ -5496,7 +5496,7 @@ do_sub(exarg_T *eap)
 			    /* write message same highlighting as for
 			     * wait_return */
 			    smsg_attr(HL_ATTR(HLF_R),
-				    (char_u *)_("replace with %s (y/n/a/q/l/^E/^Y)?"), sub);
+				_("replace with %s (y/n/a/q/l/^E/^Y)?"), sub);
 			    msg_no_more = FALSE;
 			    msg_scroll = i;
 			    showruler(TRUE);
@@ -5949,11 +5949,11 @@ outofmem:
     else if (!global_busy)
     {
 	if (got_int)		/* interrupted */
-	    EMSG(_(e_interr));
+	    emsg(_(e_interr));
 	else if (got_match)	/* did find something but nothing substituted */
 	    MSG("");
 	else if (subflags.do_error)	/* nothing found */
-	    EMSG2(_(e_patnotf2), get_search_pat());
+	    semsg(_(e_patnotf2), get_search_pat());
     }
 
 #ifdef FEAT_FOLDING
@@ -6018,7 +6018,7 @@ do_sub_msg(
     }
     if (got_int)
     {
-	EMSG(_(e_interr));
+	emsg(_(e_interr));
 	return TRUE;
     }
     return FALSE;
@@ -6071,7 +6071,7 @@ ex_global(exarg_T *eap)
 				  || eap->line2 != curbuf->b_ml.ml_line_count))
     {
 	/* will increment global_busy to break out of the loop */
-	EMSG(_("E147: Cannot do :global recursive with a range"));
+	emsg(_("E147: Cannot do :global recursive with a range"));
 	return;
     }
 
@@ -6092,7 +6092,7 @@ ex_global(exarg_T *eap)
 	++cmd;
 	if (vim_strchr((char_u *)"/?&", *cmd) == NULL)
 	{
-	    EMSG(_(e_backslash));
+	    emsg(_(e_backslash));
 	    return;
 	}
 	if (*cmd == '&')
@@ -6104,7 +6104,7 @@ ex_global(exarg_T *eap)
     }
     else if (*cmd == NUL)
     {
-	EMSG(_("E148: Regular expression missing from global"));
+	emsg(_("E148: Regular expression missing from global"));
 	return;
     }
     else
@@ -6125,7 +6125,7 @@ ex_global(exarg_T *eap)
 
     if (search_regcomp(pat, RE_BOTH, which_pat, SEARCH_HIS, &regmatch) == FAIL)
     {
-	EMSG(_(e_invcmd));
+	emsg(_(e_invcmd));
 	return;
     }
 
@@ -6163,9 +6163,9 @@ ex_global(exarg_T *eap)
 	else if (ndone == 0)
 	{
 	    if (type == 'v')
-		smsg((char_u *)_("Pattern found in every line: %s"), pat);
+		smsg(_("Pattern found in every line: %s"), pat);
 	    else
-		smsg((char_u *)_("Pattern not found: %s"), pat);
+		smsg(_("Pattern not found: %s"), pat);
 	}
 	else
 	{
@@ -6366,7 +6366,7 @@ ex_help(exarg_T *eap)
 
 	if (eap->forceit && *arg == NUL && !curbuf->b_help)
 	{
-	    EMSG(_("E478: Don't panic!"));
+	    emsg(_("E478: Don't panic!"));
 	    return;
 	}
 
@@ -6412,10 +6412,10 @@ ex_help(exarg_T *eap)
     {
 #ifdef FEAT_MULTI_LANG
 	if (lang != NULL)
-	    EMSG3(_("E661: Sorry, no '%s' help for %s"), lang, arg);
+	    semsg(_("E661: Sorry, no '%s' help for %s"), lang, arg);
 	else
 #endif
-	    EMSG2(_("E149: Sorry, no help for %s"), arg);
+	    semsg(_("E149: Sorry, no help for %s"), arg);
 	if (n != FAIL)
 	    FreeWild(num_matches, matches);
 	return;
@@ -6451,7 +6451,7 @@ ex_help(exarg_T *eap)
 	     */
 	    if ((helpfd = mch_fopen((char *)p_hf, READBIN)) == NULL)
 	    {
-		smsg((char_u *)_("Sorry, help file \"%s\" not found"), p_hf);
+		smsg(_("Sorry, help file \"%s\" not found"), p_hf);
 		goto erret;
 	    }
 	    fclose(helpfd);
@@ -7230,7 +7230,7 @@ helptags_one(
 	    || filecount == 0)
     {
 	if (!got_int)
-	    EMSG2(_("E151: No match: %s"), NameBuff);
+	    semsg(_("E151: No match: %s"), NameBuff);
 	return;
     }
 
@@ -7244,7 +7244,7 @@ helptags_one(
     fd_tags = mch_fopen((char *)NameBuff, "w");
     if (fd_tags == NULL)
     {
-	EMSG2(_("E152: Cannot open %s for writing"), NameBuff);
+	semsg(_("E152: Cannot open %s for writing"), NameBuff);
 	FreeWild(filecount, files);
 	return;
     }
@@ -7281,7 +7281,7 @@ helptags_one(
 	fd = mch_fopen((char *)files[fi], "r");
 	if (fd == NULL)
 	{
-	    EMSG2(_("E153: Unable to open %s for reading"), files[fi]);
+	    semsg(_("E153: Unable to open %s for reading"), files[fi]);
 	    continue;
 	}
 	fname = files[fi] + dirlen + 1;
@@ -7317,7 +7317,7 @@ helptags_one(
 		    utf8 = this_utf8;
 		else if (utf8 != this_utf8)
 		{
-		    EMSG2(_("E670: Mix of help file encodings within a language: %s"), files[fi]);
+		    semsg(_("E670: Mix of help file encodings within a language: %s"), files[fi]);
 		    mix = !got_int;
 		    got_int = TRUE;
 		}
@@ -7401,7 +7401,7 @@ helptags_one(
 		    vim_snprintf((char *)NameBuff, MAXPATHL,
 			    _("E154: Duplicate tag \"%s\" in file %s/%s"),
 				     ((char_u **)ga.ga_data)[i], dir, p2 + 1);
-		    EMSG(NameBuff);
+		    emsg((char *)NameBuff);
 		    *p2 = '\t';
 		    break;
 		}
@@ -7473,7 +7473,7 @@ do_helptags(char_u *dirname, int add_hel
 						    EW_FILE|EW_SILENT) == FAIL
 	    || filecount == 0)
     {
-	EMSG2(_("E151: No match: %s"), NameBuff);
+	semsg(_("E151: No match: %s"), NameBuff);
 	return;
     }
 
@@ -7586,7 +7586,7 @@ ex_helptags(exarg_T *eap)
 	dirname = ExpandOne(&xpc, eap->arg, NULL,
 			    WILD_LIST_NOTFOUND|WILD_SILENT, WILD_EXPAND_FREE);
 	if (dirname == NULL || !mch_isdir(dirname))
-	    EMSG2(_("E150: Not a directory: %s"), eap->arg);
+	    semsg(_("E150: Not a directory: %s"), eap->arg);
 	else
 	    do_helptags(dirname, add_help_tags);
 	vim_free(dirname);
--- a/src/ex_cmds.h
+++ b/src/ex_cmds.h
@@ -1799,7 +1799,7 @@ struct exarg
 #ifdef FEAT_USR_CMDS
     int		useridx;	/* user command index */
 #endif
-    char_u	*errmsg;	/* returned error message */
+    char	*errmsg;	/* returned error message */
     char_u	*(*getline)(int, void *, int);
     void	*cookie;	/* argument for getline() */
 #ifdef FEAT_EVAL
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -146,22 +146,22 @@ do_debug(char_u *cmd)
 	MSG(_("Entering Debug mode.  Type \"cont\" to continue."));
     if (debug_oldval != NULL)
     {
-	smsg((char_u *)_("Oldval = \"%s\""), debug_oldval);
+	smsg(_("Oldval = \"%s\""), debug_oldval);
 	vim_free(debug_oldval);
 	debug_oldval = NULL;
     }
     if (debug_newval != NULL)
     {
-	smsg((char_u *)_("Newval = \"%s\""), debug_newval);
+	smsg(_("Newval = \"%s\""), debug_newval);
 	vim_free(debug_newval);
 	debug_newval = NULL;
     }
     if (sourcing_name != NULL)
 	msg(sourcing_name);
     if (sourcing_lnum != 0)
-	smsg((char_u *)_("line %ld: %s"), (long)sourcing_lnum, cmd);
+	smsg(_("line %ld: %s"), (long)sourcing_lnum, cmd);
     else
-	smsg((char_u *)_("cmd: %s"), cmd);
+	smsg(_("cmd: %s"), cmd);
     /*
      * Repeat getting a command and executing it.
      */
@@ -399,7 +399,7 @@ do_checkbacktracelevel(void)
 	if (debug_backtrace_level > max)
 	{
 	    debug_backtrace_level = max;
-	    smsg((char_u *)_("frame at highest level: %d"), max);
+	    smsg(_("frame at highest level: %d"), max);
 	}
     }
 }
@@ -421,9 +421,9 @@ do_showbacktrace(char_u *cmd)
 	    if (next != NULL)
 		*next = NUL;
 	    if (i == max - debug_backtrace_level)
-		smsg((char_u *)"->%d %s", max - i, cur);
+		smsg("->%d %s", max - i, cur);
 	    else
-		smsg((char_u *)"  %d %s", max - i, cur);
+		smsg("  %d %s", max - i, cur);
 	    ++i;
 	    if (next == NULL)
 		break;
@@ -432,9 +432,9 @@ do_showbacktrace(char_u *cmd)
 	}
     }
     if (sourcing_lnum != 0)
-       smsg((char_u *)_("line %ld: %s"), (long)sourcing_lnum, cmd);
+       smsg(_("line %ld: %s"), (long)sourcing_lnum, cmd);
     else
-       smsg((char_u *)_("cmd: %s"), cmd);
+       smsg(_("cmd: %s"), cmd);
 }
 
 /*
@@ -487,7 +487,7 @@ dbg_check_breakpoint(exarg_T *eap)
 		p = (char_u *)"<SNR>";
 	    else
 		p = (char_u *)"";
-	    smsg((char_u *)_("Breakpoint in \"%s%s\" line %ld"),
+	    smsg(_("Breakpoint in \"%s%s\" line %ld"),
 		    p,
 		    debug_breakpoint_name + (*p == NUL ? 0 : 3),
 		    (long)debug_breakpoint_lnum);
@@ -607,7 +607,7 @@ dbg_parsearg(
     {
 	if (curbuf->b_ffname == NULL)
 	{
-	    EMSG(_(e_noname));
+	    emsg(_(e_noname));
 	    return FAIL;
 	}
 	bp->dbg_type = DBG_FILE;
@@ -621,7 +621,7 @@ dbg_parsearg(
 	bp->dbg_type = DBG_EXPR;
     else
     {
-	EMSG2(_(e_invarg2), p);
+	semsg(_(e_invarg2), p);
 	return FAIL;
     }
     p = skipwhite(p + 4);
@@ -646,7 +646,7 @@ dbg_parsearg(
 	    || (here && *p != NUL)
 	    || (bp->dbg_type == DBG_FUNC && strstr((char *)p, "()") != NULL))
     {
-	EMSG2(_(e_invarg2), arg);
+	semsg(_(e_invarg2), arg);
 	return FAIL;
     }
 
@@ -817,7 +817,7 @@ ex_breakdel(exarg_T *eap)
     }
 
     if (todel < 0)
-	EMSG2(_("E161: Breakpoint not found: %s"), eap->arg);
+	semsg(_("E161: Breakpoint not found: %s"), eap->arg);
     else
     {
 	while (gap->ga_len > 0)
@@ -865,13 +865,13 @@ ex_breaklist(exarg_T *eap UNUSED)
 	    if (bp->dbg_type == DBG_FILE)
 		home_replace(NULL, bp->dbg_name, NameBuff, MAXPATHL, TRUE);
 	    if (bp->dbg_type != DBG_EXPR)
-		smsg((char_u *)_("%3d  %s %s  line %ld"),
+		smsg(_("%3d  %s %s  line %ld"),
 		    bp->dbg_nr,
 		    bp->dbg_type == DBG_FUNC ? "func" : "file",
 		    bp->dbg_type == DBG_FUNC ? bp->dbg_name : NameBuff,
 		    (long)bp->dbg_lnum);
 	    else
-		smsg((char_u *)_("%3d  expr %s"),
+		smsg(_("%3d  expr %s"),
 		    bp->dbg_nr, bp->dbg_name);
 	}
 }
@@ -1726,7 +1726,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(_("E750: First use \":profile start {fname}\""));
     else if (STRCMP(eap->arg, "pause") == 0)
     {
 	if (do_profiling == PROF_YES)
@@ -1828,7 +1828,7 @@ profile_dump(void)
     {
 	fd = mch_fopen((char *)profile_fname, "w");
 	if (fd == NULL)
-	    EMSG2(_(e_notopen), profile_fname);
+	    semsg(_(e_notopen), profile_fname);
 	else
 	{
 	    script_dump_profile(fd);
@@ -2357,11 +2357,11 @@ check_changed_any(
 	if (
 #ifdef FEAT_TERMINAL
 		term_job_running(buf->b_term)
-		    ? EMSG2(_("E947: Job still running in buffer \"%s\""),
+		    ? semsg(_("E947: Job still running in buffer \"%s\""),
 								  buf->b_fname)
 		    :
 #endif
-		EMSG2(_("E162: No write since last change for buffer \"%s\""),
+		semsg(_("E162: No write since last change for buffer \"%s\""),
 		    buf_spname(buf) != NULL ? buf_spname(buf) : buf->b_fname))
 	{
 	    save = no_wait_return;
@@ -2407,7 +2407,7 @@ check_fname(void)
 {
     if (curbuf->b_ffname == NULL)
     {
-	EMSG(_(e_noname));
+	emsg(_(e_noname));
 	return FAIL;
     }
     return OK;
@@ -2629,7 +2629,7 @@ do_arglist(
 	    vim_regfree(regmatch.regprog);
 	    vim_free(p);
 	    if (!didone)
-		EMSG2(_(e_nomatch2), ((char_u **)new_ga.ga_data)[i]);
+		semsg(_(e_nomatch2), ((char_u **)new_ga.ga_data)[i]);
 	}
 	ga_clear(&new_ga);
     }
@@ -2640,7 +2640,7 @@ do_arglist(
 	ga_clear(&new_ga);
 	if (i == FAIL || exp_count == 0)
 	{
-	    EMSG(_(e_nomatch));
+	    emsg(_(e_nomatch));
 	    return FAIL;
 	}
 
@@ -2847,11 +2847,11 @@ do_argfile(exarg_T *eap, int argn)
     if (argn < 0 || argn >= ARGCOUNT)
     {
 	if (ARGCOUNT <= 1)
-	    EMSG(_("E163: There is only one file to edit"));
+	    emsg(_("E163: There is only one file to edit"));
 	else if (argn < 0)
-	    EMSG(_("E164: Cannot go before first file"));
+	    emsg(_("E164: Cannot go before first file"));
 	else
-	    EMSG(_("E165: Cannot go beyond last file"));
+	    emsg(_("E165: Cannot go beyond last file"));
     }
     else
     {
@@ -2992,12 +2992,12 @@ ex_argdelete(exarg_T *eap)
 	n = eap->line2 - eap->line1 + 1;
 	if (*eap->arg != NUL)
 	    /* Can't have both a range and an argument. */
-	    EMSG(_(e_invarg));
+	    emsg(_(e_invarg));
 	else if (n <= 0)
 	{
 	    /* Don't give an error for ":%argdel" if the list is empty. */
 	    if (eap->line1 != 1 || eap->line2 != 0)
-		EMSG(_(e_invrange));
+		emsg(_(e_invrange));
 	}
 	else
 	{
@@ -3017,7 +3017,7 @@ ex_argdelete(exarg_T *eap)
 	}
     }
     else if (*eap->arg == NUL)
-	EMSG(_(e_argreq));
+	emsg(_(e_argreq));
     else
 	do_arglist(eap->arg, AL_DEL, 0, FALSE);
 #ifdef FEAT_TITLE
@@ -3364,7 +3364,7 @@ ex_compiler(exarg_T *eap)
 
 	    sprintf((char *)buf, "compiler/%s.vim", eap->arg);
 	    if (source_runtime(buf, DIP_ALL) == FAIL)
-		EMSG2(_("E666: compiler not supported: %s"), eap->arg);
+		semsg(_("E666: compiler not supported: %s"), eap->arg);
 	    vim_free(buf);
 
 	    do_cmdline_cmd((char_u *)":delcommand CompilerSet");
@@ -3476,7 +3476,7 @@ do_in_path(
 	if (p_verbose > 1 && name != NULL)
 	{
 	    verbose_enter();
-	    smsg((char_u *)_("Searching for \"%s\" in \"%s\""),
+	    smsg(_("Searching for \"%s\" in \"%s\""),
 						 (char *)name, (char *)path);
 	    verbose_leave();
 	}
@@ -3524,7 +3524,7 @@ do_in_path(
 		    if (p_verbose > 2)
 		    {
 			verbose_enter();
-			smsg((char_u *)_("Searching for \"%s\""), buf);
+			smsg(_("Searching for \"%s\""), buf);
 			verbose_leave();
 		    }
 
@@ -3552,11 +3552,11 @@ do_in_path(
 	char *basepath = path == p_rtp ? "runtimepath" : "packpath";
 
 	if (flags & DIP_ERR)
-	    EMSG3(_(e_dirnotf), basepath, name);
+	    semsg(_(e_dirnotf), basepath, name);
 	else if (p_verbose > 0)
 	{
 	    verbose_enter();
-	    smsg((char_u *)_("not found in '%s': \"%s\""), basepath, name);
+	    smsg(_("not found in '%s': \"%s\""), basepath, name);
 	    verbose_leave();
 	}
     }
@@ -4208,7 +4208,7 @@ ex_source(exarg_T *eap)
 cmd_source(char_u *fname, exarg_T *eap)
 {
     if (*fname == NUL)
-	EMSG(_(e_argreq));
+	emsg(_(e_argreq));
 
     else if (eap != NULL && eap->forceit)
 	/* ":source!": read Normal mode commands
@@ -4227,7 +4227,7 @@ cmd_source(char_u *fname, exarg_T *eap)
 
     /* ":source" read ex commands */
     else if (do_source(fname, FALSE, DOSO_NONE) == FAIL)
-	EMSG2(_(e_notopen), fname);
+	semsg(_(e_notopen), fname);
 }
 
 /*
@@ -4371,7 +4371,7 @@ do_source(
 	return retval;
     if (mch_isdir(fname_exp))
     {
-	smsg((char_u *)_("Cannot source a directory: \"%s\""), fname);
+	smsg(_("Cannot source a directory: \"%s\""), fname);
 	goto theend;
     }
 
@@ -4430,9 +4430,9 @@ do_source(
 	{
 	    verbose_enter();
 	    if (sourcing_name == NULL)
-		smsg((char_u *)_("could not source \"%s\""), fname);
+		smsg(_("could not source \"%s\""), fname);
 	    else
-		smsg((char_u *)_("line %ld: could not source \"%s\""),
+		smsg(_("line %ld: could not source \"%s\""),
 							sourcing_lnum, fname);
 	    verbose_leave();
 	}
@@ -4448,9 +4448,9 @@ do_source(
     {
 	verbose_enter();
 	if (sourcing_name == NULL)
-	    smsg((char_u *)_("sourcing \"%s\""), fname);
+	    smsg(_("sourcing \"%s\""), fname);
 	else
-	    smsg((char_u *)_("line %ld: sourcing \"%s\""),
+	    smsg(_("line %ld: sourcing \"%s\""),
 							sourcing_lnum, fname);
 	verbose_leave();
     }
@@ -4638,15 +4638,15 @@ do_source(
 #endif
 
     if (got_int)
-	EMSG(_(e_interr));
+	emsg(_(e_interr));
     sourcing_name = save_sourcing_name;
     sourcing_lnum = save_sourcing_lnum;
     if (p_verbose > 1)
     {
 	verbose_enter();
-	smsg((char_u *)_("finished sourcing %s"), fname);
+	smsg(_("finished sourcing %s"), fname);
 	if (sourcing_name != NULL)
-	    smsg((char_u *)_("continuing in %s"), sourcing_name);
+	    smsg(_("continuing in %s"), sourcing_name);
 	verbose_leave();
     }
 #ifdef STARTUPTIME
@@ -4709,7 +4709,7 @@ ex_scriptnames(exarg_T *eap)
     {
 	// :script {scriptId}: edit the script
 	if (eap->line2 < 1 || eap->line2 > script_items.ga_len)
-	    EMSG(_(e_invarg));
+	    emsg(_(e_invarg));
 	else
 	{
 	    eap->arg = SCRIPT_ITEM(eap->line2).sn_name;
@@ -4723,7 +4723,7 @@ ex_scriptnames(exarg_T *eap)
 	{
 	    home_replace(NULL, SCRIPT_ITEM(i).sn_name,
 						    NameBuff, MAXPATHL, TRUE);
-	    smsg((char_u *)"%3d: %s", i, NameBuff);
+	    smsg("%3d: %s", i, NameBuff);
 	}
 }
 
@@ -5067,7 +5067,7 @@ get_one_sourceline(struct source_cookie 
 		    if (!sp->error)
 		    {
 			msg_source(HL_ATTR(HLF_W));
-			EMSG(_("W15: Warning: Wrong line separator, ^M may be missing"));
+			emsg(_("W15: Warning: Wrong line separator, ^M may be missing"));
 		    }
 		    sp->error = TRUE;
 		    sp->fileformat = EOL_UNIX;
@@ -5200,7 +5200,7 @@ ex_scriptencoding(exarg_T *eap UNUSED)
 
     if (!getline_equal(eap->getline, eap->cookie, getsourceline))
     {
-	EMSG(_("E167: :scriptencoding used outside of a sourced file"));
+	emsg(_("E167: :scriptencoding used outside of a sourced file"));
 	return;
     }
 
@@ -5232,7 +5232,7 @@ ex_finish(exarg_T *eap)
     if (getline_equal(eap->getline, eap->cookie, getsourceline))
 	do_finish(eap, FALSE);
     else
-	EMSG(_("E168: :finish used outside of a sourced file"));
+	emsg(_("E168: :finish used outside of a sourced file"));
 }
 
 /*
@@ -5553,7 +5553,7 @@ ex_language(exarg_T *eap)
 	    p = (char_u *)setlocale(what, NULL);
 	if (p == NULL || *p == NUL)
 	    p = (char_u *)"Unknown";
-	smsg((char_u *)_("Current %slanguage: \"%s\""), whatstr, p);
+	smsg(_("Current %slanguage: \"%s\""), whatstr, p);
     }
     else
     {
@@ -5570,7 +5570,7 @@ ex_language(exarg_T *eap)
 #endif
 	}
 	if (loc == NULL)
-	    EMSG2(_("E197: Cannot set language to \"%s\""), name);
+	    semsg(_("E197: Cannot set language to \"%s\""), name);
 	else
 	{
 #ifdef HAVE_NL_MSG_CAT_CNTR
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -126,7 +126,7 @@ static void	get_flags(exarg_T *eap);
 # define HAVE_EX_SCRIPT_NI
 static void	ex_script_ni(exarg_T *eap);
 #endif
-static char_u	*invalid_range(exarg_T *eap);
+static char	*invalid_range(exarg_T *eap);
 static void	correct_range(exarg_T *eap);
 #ifdef FEAT_QUICKFIX
 static char_u	*replace_makeprg(exarg_T *eap, char_u *p, char_u **cmdlinep);
@@ -301,7 +301,7 @@ static void	close_redir(void);
 static void	ex_mkrc(exarg_T *eap);
 static void	ex_mark(exarg_T *eap);
 #ifdef FEAT_USR_CMDS
-static char_u	*uc_fun_cmd(void);
+static char	*uc_fun_cmd(void);
 static char_u	*find_ucmd(exarg_T *eap, char_u *p, int *full, expand_T *xp, int *compl);
 #endif
 static void	ex_startinsert(exarg_T *eap);
@@ -594,7 +594,7 @@ do_exmode(
 		   || changedtick != CHANGEDTICK(curbuf)) && !ex_no_reprint)
 	{
 	    if (curbuf->b_ml.ml_flags & ML_EMPTY)
-		EMSG(_(e_emptybuf));
+		emsg(_(e_emptybuf));
 	    else
 	    {
 		if (ex_pressedreturn)
@@ -613,9 +613,9 @@ 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_emptybuf));
 	    else
-		EMSG(_("E501: At end-of-file"));
+		emsg(_("E501: At end-of-file"));
 	}
     }
 
@@ -718,7 +718,7 @@ do_cmdline(
 #endif
 	    )
     {
-	EMSG(_("E169: Command too recursive"));
+	emsg(_("E169: Command too recursive"));
 #ifdef FEAT_EVAL
 	/* When converting to an exception, we do not include the command name
 	 * since this is not an error of the specific command. */
@@ -967,7 +967,7 @@ do_cmdline(
 	    next_cmdline = vim_strsave(next_cmdline);
 	    if (next_cmdline == NULL)
 	    {
-		EMSG(_(e_outofmem));
+		emsg(_(e_outofmem));
 		retval = FAIL;
 		break;
 	    }
@@ -1019,7 +1019,7 @@ do_cmdline(
 	    ++no_wait_return;
 	    verbose_enter_scroll();
 
-	    smsg((char_u *)_("line %ld: %s"),
+	    smsg(_("line %ld: %s"),
 					   (long)sourcing_lnum, cmdline_copy);
 	    if (msg_silent == 0)
 		msg_puts((char_u *)"\n");   /* don't overwrite this */
@@ -1251,13 +1251,13 @@ do_cmdline(
 					    && !func_has_ended(real_cookie))))
 	{
 	    if (cstack.cs_flags[cstack.cs_idx] & CSF_TRY)
-		EMSG(_(e_endtry));
+		emsg(_(e_endtry));
 	    else if (cstack.cs_flags[cstack.cs_idx] & CSF_WHILE)
-		EMSG(_(e_endwhile));
+		emsg(_(e_endwhile));
 	    else if (cstack.cs_flags[cstack.cs_idx] & CSF_FOR)
-		EMSG(_(e_endfor));
+		emsg(_(e_endfor));
 	    else
-		EMSG(_(e_endif));
+		emsg(_(e_endif));
 	}
 
 	/*
@@ -1347,7 +1347,7 @@ do_cmdline(
 	    }
 	    else if (p != NULL)
 	    {
-		emsg(p);
+		semsg(p);
 		vim_free(p);
 	    }
 	    vim_free(sourcing_name);
@@ -1700,7 +1700,7 @@ do_one_cmd(
     char_u		*p;
     linenr_T		lnum;
     long		n;
-    char_u		*errormsg = NULL;	/* error message */
+    char		*errormsg = NULL;	/* error message */
     char_u		*after_modifier = NULL;
     exarg_T		ea;			/* Ex command arguments */
     int			save_msg_scroll = msg_scroll;
@@ -1898,7 +1898,7 @@ do_one_cmd(
 	    }
 
 	    if (ea.line2 < 0)
-		errormsg = (char_u *)_(e_invrange);
+		errormsg = _(e_invrange);
 	    else
 	    {
 		if (ea.line2 == 0)
@@ -1938,7 +1938,7 @@ do_one_cmd(
     if (p == NULL)
     {
 	if (!ea.skip)
-	    errormsg = (char_u *)_("E464: Ambiguous use of user-defined command");
+	    errormsg = _("E464: Ambiguous use of user-defined command");
 	goto doend;
     }
     /* Check for wrong commands. */
@@ -1963,7 +1963,7 @@ do_one_cmd(
 		else
 		    append_command(*cmdlinep);
 	    }
-	    errormsg = IObuff;
+	    errormsg = (char *)IObuff;
 	    did_emsg_syntax = TRUE;
 	}
 	goto doend;
@@ -2014,14 +2014,14 @@ do_one_cmd(
 	if (sandbox != 0 && !(ea.argt & SBOXOK))
 	{
 	    /* Command not allowed in sandbox. */
-	    errormsg = (char_u *)_(e_sandbox);
+	    errormsg = _(e_sandbox);
 	    goto doend;
 	}
 #endif
 	if (!curbuf->b_p_ma && (ea.argt & MODIFY))
 	{
 	    /* Command not allowed in non-'modifiable' buffer */
-	    errormsg = (char_u *)_(e_modifiable);
+	    errormsg = _(e_modifiable);
 	    goto doend;
 	}
 
@@ -2029,7 +2029,7 @@ do_one_cmd(
 		&& !IS_USER_CMDIDX(ea.cmdidx))
 	{
 	    /* Command not allowed when editing the command line. */
-	    errormsg = (char_u *)_(get_text_locked_msg());
+	    errormsg = _(get_text_locked_msg());
 	    goto doend;
 	}
 
@@ -2048,14 +2048,14 @@ do_one_cmd(
 	if (!ni && !(ea.argt & RANGE) && ea.addr_count > 0)
 	{
 	    /* no range allowed */
-	    errormsg = (char_u *)_(e_norange);
+	    errormsg = _(e_norange);
 	    goto doend;
 	}
     }
 
     if (!ni && !(ea.argt & BANG) && ea.forceit)	/* no <!> allowed */
     {
-	errormsg = (char_u *)_(e_nobang);
+	errormsg = _(e_nobang);
 	goto doend;
     }
 
@@ -2076,7 +2076,7 @@ do_one_cmd(
 	    {
 		if (sourcing || exmode_active)
 		{
-		    errormsg = (char_u *)_("E493: Backwards range given");
+		    errormsg = _("E493: Backwards range given");
 		    goto doend;
 		}
 		if (ask_yesno((char_u *)
@@ -2138,7 +2138,7 @@ do_one_cmd(
 	while (ea.arg[0] == '+' && ea.arg[1] == '+')
 	    if (getargopt(&ea) == FAIL && !ni)
 	    {
-		errormsg = (char_u *)_(e_invarg);
+		errormsg = _(e_invarg);
 		goto doend;
 	    }
 
@@ -2148,7 +2148,7 @@ do_one_cmd(
 	{
 	    if (*++ea.arg != '>')		/* typed wrong */
 	    {
-		errormsg = (char_u *)_("E494: Use w or w>>");
+		errormsg = _("E494: Use w or w>>");
 		goto doend;
 	    }
 	    ea.arg = skipwhite(ea.arg + 1);
@@ -2322,7 +2322,7 @@ do_one_cmd(
 	ea.arg = skipwhite(ea.arg);
 	if (n <= 0 && !ni && (ea.argt & ZEROR) == 0)
 	{
-	    errormsg = (char_u *)_(e_zerocount);
+	    errormsg = _(e_zerocount);
 	    goto doend;
 	}
 	if (ea.argt & NOTADR)	/* e.g. :buffer 2, :sleep 3 */
@@ -2354,13 +2354,13 @@ do_one_cmd(
     if (!ni && !(ea.argt & EXTRA) && *ea.arg != NUL
 	    && *ea.arg != '"' && (*ea.arg != '|' || (ea.argt & TRLBAR) == 0))
     {
-	errormsg = (char_u *)_(e_trailing);
+	errormsg = _(e_trailing);
 	goto doend;
     }
 
     if (!ni && (ea.argt & NEEDARG) && *ea.arg == NUL)
     {
-	errormsg = (char_u *)_(e_argreq);
+	errormsg = _(e_argreq);
 	goto doend;
     }
 
@@ -2525,7 +2525,7 @@ do_one_cmd(
 	ea.errmsg = NULL;
 	(cmdnames[ea.cmdidx].cmd_func)(&ea);
 	if (ea.errmsg != NULL)
-	    errormsg = (char_u *)_(ea.errmsg);
+	    errormsg = _(ea.errmsg);
     }
 
 #ifdef FEAT_EVAL
@@ -2560,10 +2560,10 @@ doend:
     {
 	if (sourcing)
 	{
-	    if (errormsg != IObuff)
+	    if (errormsg != (char *)IObuff)
 	    {
 		STRCPY(IObuff, errormsg);
-		errormsg = IObuff;
+		errormsg = (char *)IObuff;
 	    }
 	    append_command(*cmdlinep);
 	}
@@ -2633,7 +2633,7 @@ doend:
  * May set "errormsg" to an error message.
  */
     int
-parse_command_modifiers(exarg_T *eap, char_u **errormsg, int skip_only)
+parse_command_modifiers(exarg_T *eap, char **errormsg, int skip_only)
 {
     char_u *p;
 
@@ -2839,7 +2839,7 @@ parse_command_modifiers(exarg_T *eap, ch
 				{
 				    if (tabnr < 0 || tabnr > LAST_TAB_NR)
 				    {
-					*errormsg = (char_u *)_(e_invrange);
+					*errormsg = _(e_invrange);
 					return FAIL;
 				    }
 				    cmdmod.tab = tabnr + 1;
@@ -2912,7 +2912,7 @@ free_cmdmod(void)
  * Return FAIL and set "errormsg" or return OK.
  */
     int
-parse_cmd_address(exarg_T *eap, char_u **errormsg, int silent)
+parse_cmd_address(exarg_T *eap, char **errormsg, int silent)
 {
     int		address_count = 1;
     linenr_T	lnum;
@@ -2998,13 +2998,13 @@ parse_cmd_address(exarg_T *eap, char_u *
 			{
 			    // there is no Vim command which uses '%' and
 			    // ADDR_WINDOWS or ADDR_TABS
-			    *errormsg = (char_u *)_(e_invrange);
+			    *errormsg = _(e_invrange);
 			    return FAIL;
 			}
 			break;
 		    case ADDR_TABS_RELATIVE:
 		    case ADDR_OTHER:
-			*errormsg = (char_u *)_(e_invrange);
+			*errormsg = _(e_invrange);
 			return FAIL;
 		    case ADDR_ARGUMENTS:
 			if (ARGCOUNT == 0)
@@ -3033,7 +3033,7 @@ parse_cmd_address(exarg_T *eap, char_u *
 		// '*' - visual area
 		if (eap->addr_type != ADDR_LINES)
 		{
-		    *errormsg = (char_u *)_(e_invrange);
+		    *errormsg = _(e_invrange);
 		    return FAIL;
 		}
 
@@ -3216,7 +3216,7 @@ find_command(exarg_T *eap, int *full UNU
 
 	    if (command_count != (int)CMD_SIZE)
 	    {
-		iemsg((char_u *)_("E943: Command table needs to be updated, run 'make cmdidxs'"));
+		iemsg(_("E943: Command table needs to be updated, run 'make cmdidxs'"));
 		getout(1);
 	    }
 
@@ -4491,7 +4491,7 @@ get_address(
 			lnum = CURRENT_TAB_NR;
 			break;
 		    case ADDR_TABS_RELATIVE:
-			EMSG(_(e_invrange));
+			emsg(_(e_invrange));
 			cmd = NULL;
 			goto error;
 			break;
@@ -4533,7 +4533,7 @@ get_address(
 			lnum = LAST_TAB_NR;
 			break;
 		    case ADDR_TABS_RELATIVE:
-			EMSG(_(e_invrange));
+			emsg(_(e_invrange));
 			cmd = NULL;
 			goto error;
 			break;
@@ -4555,7 +4555,7 @@ get_address(
 		}
 		if (addr_type != ADDR_LINES)
 		{
-		    EMSG(_(e_invaddr));
+		    emsg(_(e_invaddr));
 		    cmd = NULL;
 		    goto error;
 		}
@@ -4587,7 +4587,7 @@ get_address(
 		c = *cmd++;
 		if (addr_type != ADDR_LINES)
 		{
-		    EMSG(_(e_invaddr));
+		    emsg(_(e_invaddr));
 		    cmd = NULL;
 		    goto error;
 		}
@@ -4637,7 +4637,7 @@ get_address(
 		++cmd;
 		if (addr_type != ADDR_LINES)
 		{
-		    EMSG(_(e_invaddr));
+		    emsg(_(e_invaddr));
 		    cmd = NULL;
 		    goto error;
 		}
@@ -4647,7 +4647,7 @@ get_address(
 		    i = RE_SEARCH;
 		else
 		{
-		    EMSG(_(e_backslash));
+		    emsg(_(e_backslash));
 		    cmd = NULL;
 		    goto error;
 		}
@@ -4742,7 +4742,7 @@ get_address(
 
 	    if (addr_type == ADDR_TABS_RELATIVE)
 	    {
-		EMSG(_(e_invrange));
+		emsg(_(e_invrange));
 		cmd = NULL;
 		goto error;
 	    }
@@ -4797,7 +4797,7 @@ get_flags(exarg_T *eap)
 ex_ni(exarg_T *eap)
 {
     if (!eap->skip)
-	eap->errmsg = (char_u *)N_("E319: Sorry, the command is not available in this version");
+	eap->errmsg = N_("E319: Sorry, the command is not available in this version");
 }
 
 #ifdef HAVE_EX_SCRIPT_NI
@@ -4819,14 +4819,14 @@ ex_script_ni(exarg_T *eap)
  * Check range in Ex command for validity.
  * Return NULL when valid, error message when invalid.
  */
-    static char_u *
+    static char *
 invalid_range(exarg_T *eap)
 {
     buf_T	*buf;
     if (       eap->line1 < 0
 	    || eap->line2 < 0
 	    || eap->line1 > eap->line2)
-	return (char_u *)_(e_invrange);
+	return _(e_invrange);
 
     if (eap->argt & RANGE)
     {
@@ -4839,45 +4839,45 @@ invalid_range(exarg_T *eap)
 			    + (eap->cmdidx == CMD_diffget)
 #endif
 		   )
-		    return (char_u *)_(e_invrange);
+		    return _(e_invrange);
 		break;
 	    case ADDR_ARGUMENTS:
 		/* add 1 if ARGCOUNT is 0 */
 		if (eap->line2 > ARGCOUNT + (!ARGCOUNT))
-		    return (char_u *)_(e_invrange);
+		    return _(e_invrange);
 		break;
 	    case ADDR_BUFFERS:
 		if (eap->line1 < firstbuf->b_fnum
 			|| eap->line2 > lastbuf->b_fnum)
-		    return (char_u *)_(e_invrange);
+		    return _(e_invrange);
 		break;
 	    case ADDR_LOADED_BUFFERS:
 		buf = firstbuf;
 		while (buf->b_ml.ml_mfp == NULL)
 		{
 		    if (buf->b_next == NULL)
-			return (char_u *)_(e_invrange);
+			return _(e_invrange);
 		    buf = buf->b_next;
 		}
 		if (eap->line1 < buf->b_fnum)
-		    return (char_u *)_(e_invrange);
+		    return _(e_invrange);
 		buf = lastbuf;
 		while (buf->b_ml.ml_mfp == NULL)
 		{
 		    if (buf->b_prev == NULL)
-			return (char_u *)_(e_invrange);
+			return _(e_invrange);
 		    buf = buf->b_prev;
 		}
 		if (eap->line2 > buf->b_fnum)
-		    return (char_u *)_(e_invrange);
+		    return _(e_invrange);
 		break;
 	    case ADDR_WINDOWS:
 		if (eap->line2 > LAST_WIN_NR)
-		    return (char_u *)_(e_invrange);
+		    return _(e_invrange);
 		break;
 	    case ADDR_TABS:
 		if (eap->line2 > LAST_TAB_NR)
-		    return (char_u *)_(e_invrange);
+		    return _(e_invrange);
 		break;
 	    case ADDR_TABS_RELATIVE:
 		/* Do nothing */
@@ -4885,7 +4885,7 @@ invalid_range(exarg_T *eap)
 #ifdef FEAT_QUICKFIX
 	    case ADDR_QUICKFIX:
 		if (eap->line2 != 1 && eap->line2 > qf_get_size(eap))
-		    return (char_u *)_(e_invrange);
+		    return _(e_invrange);
 		break;
 #endif
 	}
@@ -5020,7 +5020,7 @@ replace_makeprg(exarg_T *eap, char_u *p,
 expand_filename(
     exarg_T	*eap,
     char_u	**cmdlinep,
-    char_u	**errormsgp)
+    char	**errormsgp)
 {
     int		has_wildcards;	/* need to expand wildcards */
     char_u	*repl;
@@ -5788,7 +5788,7 @@ check_more(
 		return FAIL;
 	    }
 #endif
-	    EMSGN(NGETTEXT("E173: %ld more file to edit",
+	    semsg(NGETTEXT("E173: %ld more file to edit",
 			"E173: %ld more files to edit", n), n);
 	    quitmore = 2;	    /* next try to quit is allowed */
 	}
@@ -5879,7 +5879,7 @@ uc_add_command(
 	    if (!force && (cmd->uc_script_ctx.sc_sid != current_sctx.sc_sid
 			  || cmd->uc_script_ctx.sc_seq == current_sctx.sc_seq))
 	    {
-		EMSG2(_("E174: Command already exists: add ! to replace it: %s"),
+		semsg(_("E174: Command already exists: add ! to replace it: %s"),
 									 name);
 		goto fail;
 	    }
@@ -6156,7 +6156,7 @@ uc_list(char_u *name, size_t name_len)
 	MSG(_("No user-defined commands found"));
 }
 
-    static char_u *
+    static char *
 uc_fun_cmd(void)
 {
     static char_u fcmd[] = {0x84, 0xaf, 0x60, 0xb9, 0xaf, 0xb5, 0x60, 0xa4,
@@ -6168,7 +6168,7 @@ uc_fun_cmd(void)
     for (i = 0; fcmd[i]; ++i)
 	IObuff[i] = fcmd[i] - 0x40;
     IObuff[i] = 0;
-    return IObuff;
+    return (char *)IObuff;
 }
 
     static int
@@ -6186,7 +6186,7 @@ uc_scan_attr(
 
     if (len == 0)
     {
-	EMSG(_("E175: No attribute specified"));
+	emsg(_("E175: No attribute specified"));
 	return FAIL;
     }
 
@@ -6238,7 +6238,7 @@ uc_scan_attr(
 	    else
 	    {
 wrong_nargs:
-		EMSG(_("E176: Invalid number of arguments"));
+		emsg(_("E176: Invalid number of arguments"));
 		return FAIL;
 	    }
 	}
@@ -6253,7 +6253,7 @@ wrong_nargs:
 		if (*def >= 0)
 		{
 two_count:
-		    EMSG(_("E177: Count cannot be specified twice"));
+		    emsg(_("E177: Count cannot be specified twice"));
 		    return FAIL;
 		}
 
@@ -6263,7 +6263,7 @@ two_count:
 		if (p != val + vallen || vallen == 0)
 		{
 invalid_count:
-		    EMSG(_("E178: Invalid default value for count"));
+		    emsg(_("E178: Invalid default value for count"));
 		    return FAIL;
 		}
 	    }
@@ -6291,7 +6291,7 @@ invalid_count:
 	{
 	    if (val == NULL)
 	    {
-		EMSG(_("E179: argument required for -complete"));
+		emsg(_("E179: argument required for -complete"));
 		return FAIL;
 	    }
 
@@ -6304,7 +6304,7 @@ invalid_count:
 	    *argt |= RANGE;
 	    if (val == NULL)
 	    {
-		EMSG(_("E179: argument required for -addr"));
+		emsg(_("E179: argument required for -addr"));
 		return FAIL;
 	    }
 	    if (parse_addr_type_arg(val, (int)vallen, argt, addr_type_arg)
@@ -6317,7 +6317,7 @@ invalid_count:
 	{
 	    char_u ch = attr[len];
 	    attr[len] = '\0';
-	    EMSG2(_("E181: Invalid attribute: %s"), attr);
+	    semsg(_("E181: Invalid attribute: %s"), attr);
 	    attr[len] = ch;
 	    return FAIL;
 	}
@@ -6365,7 +6365,7 @@ ex_command(exarg_T *eap)
 	    ++p;
     if (!ends_excmd(*p) && !VIM_ISWHITE(*p))
     {
-	EMSG(_("E182: Invalid command name"));
+	emsg(_("E182: Invalid command name"));
 	return;
     }
     end = p;
@@ -6381,14 +6381,14 @@ ex_command(exarg_T *eap)
     }
     else if (!ASCII_ISUPPER(*name))
     {
-	EMSG(_("E183: User defined commands must start with an uppercase letter"));
+	emsg(_("E183: User defined commands must start with an uppercase letter"));
 	return;
     }
     else if ((name_len == 1 && *name == 'X')
 	  || (name_len <= 4
 		  && STRNCMP(name, "Next", name_len > 4 ? 4 : name_len) == 0))
     {
-	EMSG(_("E841: Reserved name, cannot be used for user defined command"));
+	emsg(_("E841: Reserved name, cannot be used for user defined command"));
 	return;
     }
     else
@@ -6453,7 +6453,7 @@ ex_delcommand(exarg_T *eap)
 
     if (cmp != 0)
     {
-	EMSG2(_("E184: No such user-defined command: %s"), eap->arg);
+	semsg(_("E184: No such user-defined command: %s"), eap->arg);
 	return;
     }
 
@@ -7116,7 +7116,7 @@ parse_addr_type_arg(
 	for (i = 0; err[i] != NUL && !VIM_ISWHITE(err[i]); i++)
 	    ;
 	err[i] = NUL;
-	EMSG2(_("E180: Invalid address type value: %s"), err);
+	semsg(_("E180: Invalid address type value: %s"), err);
 	return FAIL;
     }
 
@@ -7182,7 +7182,7 @@ parse_compl_arg(
 
     if (command_complete[i].expand == 0)
     {
-	EMSG2(_("E180: Invalid complete value: %s"), value);
+	semsg(_("E180: Invalid complete value: %s"), value);
 	return FAIL;
     }
 
@@ -7193,7 +7193,7 @@ parse_compl_arg(
     if (arg != NULL)
 # endif
     {
-	EMSG(_("E468: Completion argument only allowed for custom completion"));
+	emsg(_("E468: Completion argument only allowed for custom completion"));
 	return FAIL;
     }
 
@@ -7201,7 +7201,7 @@ parse_compl_arg(
     if ((*complp == EXPAND_USER_DEFINED || *complp == EXPAND_USER_LIST)
 							       && arg == NULL)
     {
-	EMSG(_("E467: Custom completion requires a function argument"));
+	emsg(_("E467: Custom completion requires a function argument"));
 	return FAIL;
     }
 
@@ -7252,7 +7252,7 @@ ex_colorscheme(exarg_T *eap)
 #endif
     }
     else if (load_colors(eap->arg) == FAIL)
-	EMSG2(_("E185: Cannot find color scheme '%s'"), eap->arg);
+	semsg(_("E185: Cannot find color scheme '%s'"), eap->arg);
 }
 
     static void
@@ -7636,7 +7636,7 @@ ex_tabclose(exarg_T *eap)
     else
 # endif
 	if (first_tabpage->tp_next == NULL)
-	    EMSG(_("E784: Cannot close last tab page"));
+	    emsg(_("E784: Cannot close last tab page"));
 	else
 	{
 	    tab_number = get_tabpage_arg(eap);
@@ -7909,7 +7909,7 @@ ex_exit(exarg_T *eap)
 ex_print(exarg_T *eap)
 {
     if (curbuf->b_ml.ml_flags & ML_EMPTY)
-	EMSG(_(e_emptybuf));
+	emsg(_(e_emptybuf));
     else
     {
 	for ( ;!got_int; ui_breakcheck())
@@ -8199,7 +8199,7 @@ alist_set(
 
     if (recursive)
     {
-	EMSG(_(e_au_recursive));
+	emsg(_(e_au_recursive));
 	return;
     }
     ++recursive;
@@ -8692,7 +8692,7 @@ ex_open(exarg_T *eap)
 	    if (vim_regexec(&regmatch, p, (colnr_T)0))
 		curwin->w_cursor.col = (colnr_T)(regmatch.startp[0] - p);
 	    else
-		EMSG(_(e_nomatch));
+		emsg(_(e_nomatch));
 	    vim_regfree(regmatch.regprog);
 	}
 	/* Move to the NUL, ignore any other arguments. */
@@ -9059,7 +9059,7 @@ ex_read(exarg_T *eap)
 #if defined(FEAT_EVAL)
 	    if (!aborting())
 #endif
-		EMSG2(_(e_notopen), eap->arg);
+		semsg(_(e_notopen), eap->arg);
 	}
 	else
 	{
@@ -9148,7 +9148,7 @@ ex_cd(exarg_T *eap)
 	if (vim_strchr(p_cpo, CPO_CHDIR) != NULL && curbufIsChanged()
 							     && !eap->forceit)
 	{
-	    EMSG(_("E747: Cannot change directory, buffer is modified (add ! to override)"));
+	    emsg(_("E747: Cannot change directory, buffer is modified (add ! to override)"));
 	    return;
 	}
 
@@ -9157,7 +9157,7 @@ ex_cd(exarg_T *eap)
 	{
 	    if (prev_dir == NULL)
 	    {
-		EMSG(_("E186: No previous directory"));
+		emsg(_("E186: No previous directory"));
 		return;
 	    }
 	    new_dir = prev_dir;
@@ -9192,7 +9192,7 @@ ex_cd(exarg_T *eap)
 	dir_differs = new_dir == NULL || prev_dir == NULL
 			|| pathcmp((char *)prev_dir, (char *)new_dir, -1) != 0;
 	if (new_dir == NULL || (dir_differs && vim_chdir(new_dir)))
-	    EMSG(_(e_failed));
+	    emsg(_(e_failed));
 	else
 	{
 	    int is_local_chdir = eap->cmdidx == CMD_lcd
@@ -9227,7 +9227,7 @@ ex_pwd(exarg_T *eap UNUSED)
 	msg(NameBuff);
     }
     else
-	EMSG(_("E187: Unknown"));
+	emsg(_("E187: Unknown"));
 }
 
 /*
@@ -9236,7 +9236,7 @@ ex_pwd(exarg_T *eap UNUSED)
     static void
 ex_equal(exarg_T *eap)
 {
-    smsg((char_u *)"%ld", (long)eap->line2);
+    smsg("%ld", (long)eap->line2);
     ex_may_print(eap);
 }
 
@@ -9258,7 +9258,7 @@ ex_sleep(exarg_T *eap)
     {
 	case 'm': break;
 	case NUL: len *= 1000L; break;
-	default: EMSG2(_(e_invarg2), eap->arg); return;
+	default: semsg(_(e_invarg2), eap->arg); return;
     }
     do_sleep(len);
 }
@@ -9322,9 +9322,9 @@ do_exmap(exarg_T *eap, int isabbrev)
     switch (do_map((*cmdp == 'n') ? 2 : (*cmdp == 'u'),
 						    eap->arg, mode, isabbrev))
     {
-	case 1: EMSG(_(e_invarg));
+	case 1: emsg(_(e_invarg));
 		break;
-	case 2: EMSG(isabbrev ? _(e_noabbr) : _(e_nomap));
+	case 2: emsg((isabbrev ? _(e_noabbr) : _(e_nomap)));
 		break;
     }
 }
@@ -9346,7 +9346,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(_("E465: :winsize requires two number arguments"));
 }
 
     static void
@@ -9360,7 +9360,7 @@ ex_wincmd(exarg_T *eap)
 	/* CTRL-W g and CTRL-W CTRL-G  have an extra command character */
 	if (eap->arg[1] == NUL)
 	{
-	    EMSG(_(e_invarg));
+	    emsg(_(e_invarg));
 	    return;
 	}
 	xchar = eap->arg[1];
@@ -9372,7 +9372,7 @@ ex_wincmd(exarg_T *eap)
     eap->nextcmd = check_nextcmd(p);
     p = skipwhite(p);
     if (*p != NUL && *p != '"' && eap->nextcmd == NULL)
-	EMSG(_(e_invarg));
+	emsg(_(e_invarg));
     else if (!eap->skip)
     {
 	/* Pass flags on for ":vertical wincmd ]". */
@@ -9409,7 +9409,7 @@ ex_winpos(exarg_T *eap)
 	}
 	else
 # endif
-	    EMSG(_("E188: Obtaining window position not implemented for this platform"));
+	    emsg(_("E188: Obtaining window position not implemented for this platform"));
     }
     else
     {
@@ -9419,7 +9419,7 @@ ex_winpos(exarg_T *eap)
 	y = getdigits(&arg);
 	if (*p == NUL || *arg != NUL)
 	{
-	    EMSG(_("E466: :winpos requires two number arguments"));
+	    emsg(_("E466: :winpos requires two number arguments"));
 	    return;
 	}
 # ifdef FEAT_GUI
@@ -9544,7 +9544,7 @@ ex_copymove(exarg_T *eap)
      */
     if (n == MAXLNUM || n < 0 || n > curbuf->b_ml.ml_line_count)
     {
-	EMSG(_(e_invaddr));
+	emsg(_(e_invaddr));
 	return;
     }
 
@@ -9731,7 +9731,7 @@ ex_later(exarg_T *eap)
     }
 
     if (*p != NUL)
-	EMSG2(_(e_invarg2), eap->arg);
+	semsg(_(e_invarg2), eap->arg);
     else
 	undo_time(eap->cmdidx == CMD_earlier ? -count : count,
 							    sec, file, FALSE);
@@ -9750,7 +9750,7 @@ ex_redir(exarg_T *eap)
 #ifdef FEAT_EVAL
     if (redir_execute)
     {
-	EMSG(_("E930: Cannot use :redir inside execute()"));
+	emsg(_("E930: Cannot use :redir inside execute()"));
 	return;
     }
 #endif
@@ -9827,7 +9827,7 @@ ex_redir(exarg_T *eap)
 	    if (*arg != NUL)
 	    {
 		redir_reg = 0;
-		EMSG2(_(e_invarg2), eap->arg);
+		semsg(_(e_invarg2), eap->arg);
 	    }
 	}
 	else if (*arg == '=' && arg[1] == '>')
@@ -9854,7 +9854,7 @@ ex_redir(exarg_T *eap)
 	/* TODO: redirect to a buffer */
 
 	else
-	    EMSG2(_(e_invarg2), eap->arg);
+	    semsg(_(e_invarg2), eap->arg);
     }
 
     /* Make sure redirection is not off.  Can happen for cmdline completion
@@ -10130,7 +10130,7 @@ ex_mkrc(
 			|| ((ssop_flags & SSOP_CURDIR) && globaldir != NULL)))
 		    {
 			if (mch_chdir((char *)dirnow) != 0)
-			    EMSG(_(e_prev_dir));
+			    emsg(_(e_prev_dir));
 			shorten_fnames(TRUE);
 		    }
 		    vim_free(dirnow);
@@ -10163,7 +10163,7 @@ ex_mkrc(
 	failed |= fclose(fd);
 
 	if (failed)
-	    EMSG(_(e_write));
+	    emsg(_(e_write));
 #if defined(FEAT_EVAL) && defined(FEAT_SESSION)
 	else if (eap->cmdidx == CMD_mksession)
 	{
@@ -10200,7 +10200,7 @@ vim_mkdir_emsg(char_u *name, int prot)
 {
     if (vim_mkdir(name, prot) != 0)
     {
-	EMSG2(_("E739: Cannot create directory: %s"), name);
+	semsg(_("E739: Cannot create directory: %s"), name);
 	return FAIL;
     }
     return OK;
@@ -10223,18 +10223,18 @@ open_exfile(
     /* with Unix it is possible to open a directory */
     if (mch_isdir(fname))
     {
-	EMSG2(_(e_isadir2), fname);
+	semsg(_(e_isadir2), fname);
 	return NULL;
     }
 #endif
     if (!forceit && *mode != 'a' && vim_fexists(fname))
     {
-	EMSG2(_("E189: \"%s\" exists (add ! to override)"), fname);
+	semsg(_("E189: \"%s\" exists (add ! to override)"), fname);
 	return NULL;
     }
 
     if ((fd = mch_fopen((char *)fname, mode)) == NULL)
-	EMSG2(_("E190: Cannot open \"%s\" for writing"), fname);
+	semsg(_("E190: Cannot open \"%s\" for writing"), fname);
 
     return fd;
 }
@@ -10248,16 +10248,16 @@ ex_mark(exarg_T *eap)
     pos_T	pos;
 
     if (*eap->arg == NUL)		/* No argument? */
-	EMSG(_(e_argreq));
+	emsg(_(e_argreq));
     else if (eap->arg[1] != NUL)	/* more than one character? */
-	EMSG(_(e_trailing));
+	emsg(_(e_trailing));
     else
     {
 	pos = curwin->w_cursor;		/* save curwin->w_cursor */
 	curwin->w_cursor.lnum = eap->line2;
 	beginline(BL_WHITE | BL_FIX);
 	if (setmark(*eap->arg) == FAIL)	/* set mark */
-	    EMSG(_("E191: Argument must be a letter or forward/backward quote"));
+	    emsg(_("E191: Argument must be a letter or forward/backward quote"));
 	curwin->w_cursor = pos;		/* restore curwin->w_cursor */
     }
 }
@@ -10339,12 +10339,12 @@ ex_normal(exarg_T *eap)
 
     if (ex_normal_lock > 0)
     {
-	EMSG(_(e_secure));
+	emsg(_(e_secure));
 	return;
     }
     if (ex_normal_busy >= p_mmd)
     {
-	EMSG(_("E192: Recursive use of :normal too deep"));
+	emsg(_("E192: Recursive use of :normal too deep"));
 	return;
     }
 
@@ -10817,7 +10817,7 @@ eval_vars(
     char_u	*srcstart,	/* beginning of valid memory for src */
     int		*usedlen,	/* characters after src that are used */
     linenr_T	*lnump,		/* line number for :e command, or NULL */
-    char_u	**errormsg,	/* pointer to error message */
+    char	**errormsg,	/* pointer to error message */
     int		*escaped)	/* return value has escaped white space (can
 				 * be NULL) */
 {
@@ -10872,7 +10872,7 @@ eval_vars(
 	      : FIND_STRING);
 	if (resultlen == 0)
 	{
-	    *errormsg = (char_u *)"";
+	    *errormsg = "";
 	    return NULL;
 	}
     }
@@ -10938,7 +10938,7 @@ eval_vars(
 								     (long)i);
 		    if (result == NULL)
 		    {
-			*errormsg = (char_u *)"";
+			*errormsg = "";
 			return NULL;
 		    }
 #else
@@ -10953,7 +10953,7 @@ eval_vars(
 		    buf = buflist_findnr(i);
 		    if (buf == NULL)
 		    {
-			*errormsg = (char_u *)_("E194: No alternate file name to substitute for '#'");
+			*errormsg = _("E194: No alternate file name to substitute for '#'");
 			return NULL;
 		    }
 		    if (lnump != NULL)
@@ -10978,7 +10978,7 @@ eval_vars(
 		result = file_name_at_cursor(FNAME_MESS|FNAME_HYP, 1L, NULL);
 		if (result == NULL)
 		{
-		    *errormsg = (char_u *)"";
+		    *errormsg = "";
 		    return NULL;
 		}
 		resultbuf = result;	    /* remember allocated string */
@@ -10998,7 +10998,7 @@ eval_vars(
 		}
 		if (result == NULL)
 		{
-		    *errormsg = (char_u *)_("E495: no autocommand file name to substitute for \"<afile>\"");
+		    *errormsg = _("E495: no autocommand file name to substitute for \"<afile>\"");
 		    return NULL;
 		}
 		result = shorten_fname1(result);
@@ -11007,7 +11007,7 @@ eval_vars(
 	case SPEC_ABUF:		/* buffer number for autocommand */
 		if (autocmd_bufnr <= 0)
 		{
-		    *errormsg = (char_u *)_("E496: no autocommand buffer number to substitute for \"<abuf>\"");
+		    *errormsg = _("E496: no autocommand buffer number to substitute for \"<abuf>\"");
 		    return NULL;
 		}
 		sprintf((char *)strbuf, "%d", autocmd_bufnr);
@@ -11018,7 +11018,7 @@ eval_vars(
 		result = autocmd_match;
 		if (result == NULL)
 		{
-		    *errormsg = (char_u *)_("E497: no autocommand match name to substitute for \"<amatch>\"");
+		    *errormsg = _("E497: no autocommand match name to substitute for \"<amatch>\"");
 		    return NULL;
 		}
 		break;
@@ -11027,7 +11027,7 @@ eval_vars(
 		result = sourcing_name;
 		if (result == NULL)
 		{
-		    *errormsg = (char_u *)_("E498: no :source file name to substitute for \"<sfile>\"");
+		    *errormsg = _("E498: no :source file name to substitute for \"<sfile>\"");
 		    return NULL;
 		}
 		break;
@@ -11035,7 +11035,7 @@ eval_vars(
 	case SPEC_SLNUM:	/* line in file for ":so" command */
 		if (sourcing_name == NULL || sourcing_lnum == 0)
 		{
-		    *errormsg = (char_u *)_("E842: no line number to use for \"<slnum>\"");
+		    *errormsg = _("E842: no line number to use for \"<slnum>\"");
 		    return NULL;
 		}
 		sprintf((char *)strbuf, "%ld", (long)sourcing_lnum);
@@ -11046,7 +11046,7 @@ eval_vars(
 	case SPEC_SFLNUM:	/* line in script file */
 		if (current_sctx.sc_lnum + sourcing_lnum == 0)
 		{
-		    *errormsg = (char_u *)_("E961: no line number to use for \"<sflnum>\"");
+		    *errormsg = _("E961: no line number to use for \"<sflnum>\"");
 		    return NULL;
 		}
 		sprintf((char *)strbuf, "%ld",
@@ -11082,7 +11082,7 @@ eval_vars(
 								  &resultlen);
 	    if (result == NULL)
 	    {
-		*errormsg = (char_u *)"";
+		*errormsg = "";
 		return NULL;
 	    }
 	}
@@ -11093,9 +11093,9 @@ eval_vars(
     {
 	if (valid != VALID_HEAD + VALID_PATH)
 	    /* xgettext:no-c-format */
-	    *errormsg = (char_u *)_("E499: Empty file name for '%' or '#', only works with \":p:h\"");
+	    *errormsg = _("E499: Empty file name for '%' or '#', only works with \":p:h\"");
 	else
-	    *errormsg = (char_u *)_("E500: Evaluates to an empty string");
+	    *errormsg = _("E500: Evaluates to an empty string");
 	result = NULL;
     }
     else
@@ -11182,7 +11182,7 @@ arg_all(void)
     char_u *
 expand_sfile(char_u *arg)
 {
-    char_u	*errormsg;
+    char	*errormsg;
     int		len;
     char_u	*result;
     char_u	*newres;
@@ -12139,7 +12139,7 @@ get_view_file(int c)
 
     if (curbuf->b_ffname == NULL)
     {
-	EMSG(_(e_noname));
+	emsg(_(e_noname));
 	return NULL;
     }
     sname = home_replace_save(NULL, curbuf->b_ffname);
@@ -12242,7 +12242,7 @@ ex_viminfo(
     {
 	if (read_viminfo(eap->arg, VIF_WANT_INFO | VIF_WANT_MARKS
 				  | (eap->forceit ? VIF_FORCEIT : 0)) == FAIL)
-	    EMSG(_("E195: Cannot open viminfo file for reading"));
+	    emsg(_("E195: Cannot open viminfo file for reading"));
     }
     else
 	write_viminfo(eap->arg, eap->forceit);
@@ -12286,7 +12286,7 @@ ex_behave(exarg_T *eap)
 	set_option_value((char_u *)"keymodel", 0L, (char_u *)"", 0);
     }
     else
-	EMSG2(_(e_invarg2), eap->arg);
+	semsg(_(e_invarg2), eap->arg);
 }
 
 #if defined(FEAT_CMDL_COMPL) || defined(PROTO)
@@ -12348,7 +12348,7 @@ ex_filetype(exarg_T *eap)
     if (*eap->arg == NUL)
     {
 	/* Print current status. */
-	smsg((char_u *)"filetype detection:%s  plugin:%s  indent:%s",
+	smsg("filetype detection:%s  plugin:%s  indent:%s",
 		filetype_detect ? "ON" : "OFF",
 		filetype_plugin ? (filetype_detect ? "ON" : "(on)") : "OFF",
 		filetype_indent ? (filetype_detect ? "ON" : "(on)") : "OFF");
@@ -12417,7 +12417,7 @@ ex_filetype(exarg_T *eap)
 	}
     }
     else
-	EMSG2(_(e_invarg2), arg);
+	semsg(_(e_invarg2), arg);
 }
 
 /*
@@ -12448,7 +12448,7 @@ ex_digraphs(exarg_T *eap UNUSED)
     else
 	listdigraphs(eap->forceit);
 #else
-    EMSG(_("E196: No digraphs in this version"));
+    emsg(_("E196: No digraphs in this version"));
 #endif
 }
 
@@ -12507,7 +12507,7 @@ ex_match(exarg_T *eap)
 	id = eap->line2;
     else
     {
-	EMSG(e_invcmd);
+	emsg(_(e_invcmd));
 	return;
     }
 
@@ -12530,7 +12530,7 @@ ex_match(exarg_T *eap)
 	{
 	    /* There must be two arguments. */
 	    vim_free(g);
-	    EMSG2(_(e_invarg2), eap->arg);
+	    semsg(_(e_invarg2), eap->arg);
 	    return;
 	}
 	end = skip_regexp(p + 1, *p, TRUE, NULL);
@@ -12545,7 +12545,7 @@ ex_match(exarg_T *eap)
 	    if (*end != *p)
 	    {
 		vim_free(g);
-		EMSG2(_(e_invarg2), p);
+		semsg(_(e_invarg2), p);
 		return;
 	    }
 
--- a/src/ex_eval.c
+++ b/src/ex_eval.c
@@ -16,7 +16,7 @@
 #if defined(FEAT_EVAL) || defined(PROTO)
 
 static int	throw_exception(void *, except_type_T, char_u *);
-static char_u	*get_end_emsg(struct condstack *cstack);
+static char	*get_end_emsg(struct condstack *cstack);
 
 /*
  * Exception handling terms:
@@ -255,16 +255,16 @@ cause_errthrow(
 	    if (elem == NULL)
 	    {
 		suppress_errthrow = TRUE;
-		EMSG(_(e_outofmem));
+		emsg(_(e_outofmem));
 	    }
 	    else
 	    {
-		elem->msg = vim_strsave(mesg);
+		elem->msg = (char *)vim_strsave(mesg);
 		if (elem->msg == NULL)
 		{
 		    vim_free(elem);
 		    suppress_errthrow = TRUE;
-		    EMSG(_(e_outofmem));
+		    emsg(_(e_outofmem));
 		}
 		else
 		{
@@ -273,7 +273,7 @@ cause_errthrow(
 		    *plist = elem;
 		    if (plist == msg_list || severe)
 		    {
-			char_u	    *tmsg;
+			char	    *tmsg;
 
 			/* Skip the extra "Vim " prefix for message "E458". */
 			tmsg = elem->msg;
@@ -413,16 +413,17 @@ do_intthrow(struct condstack *cstack)
 /*
  * Get an exception message that is to be stored in current_exception->value.
  */
-    char_u *
+    char *
 get_exception_string(
     void	*value,
     except_type_T type,
     char_u	*cmdname,
     int		*should_free)
 {
-    char_u	*ret, *mesg;
+    char	*ret;
+    char	*mesg;
     int		cmdlen;
-    char_u	*p, *val;
+    char	*p, *val;
 
     if (type == ET_ERROR)
     {
@@ -431,7 +432,7 @@ get_exception_string(
 	if (cmdname != NULL && *cmdname != NUL)
 	{
 	    cmdlen = (int)STRLEN(cmdname);
-	    ret = vim_strnsave((char_u *)"Vim(",
+	    ret = (char *)vim_strnsave((char_u *)"Vim(",
 					   4 + cmdlen + 2 + (int)STRLEN(mesg));
 	    if (ret == NULL)
 		return ret;
@@ -441,7 +442,7 @@ get_exception_string(
 	}
 	else
 	{
-	    ret = vim_strnsave((char_u *)"Vim:", 4 + (int)STRLEN(mesg));
+	    ret = (char *)vim_strnsave((char_u *)"Vim:", 4 + (int)STRLEN(mesg));
 	    if (ret == NULL)
 		return ret;
 	    val = ret + 4;
@@ -483,7 +484,7 @@ get_exception_string(
     else
     {
 	*should_free = FALSE;
-	ret = (char_u *)value;
+	ret = value;
     }
 
     return ret;
@@ -513,7 +514,7 @@ throw_exception(void *value, except_type
 		&& (((char_u *)value)[3] == NUL || ((char_u *)value)[3] == ':'
 		    || ((char_u *)value)[3] == '('))
 	{
-	    EMSG(_("E608: Cannot :throw exceptions with 'Vim' prefix"));
+	    emsg(_("E608: Cannot :throw exceptions with 'Vim' prefix"));
 	    goto fail;
 	}
     }
@@ -554,7 +555,7 @@ throw_exception(void *value, except_type
 	if (debug_break_level > 0 || *p_vfile == NUL)
 	    msg_scroll = TRUE;	    /* always scroll up, don't overwrite */
 
-	smsg((char_u *)_("Exception thrown: %s"), excp->value);
+	smsg(_("Exception thrown: %s"), excp->value);
 	msg_puts((char_u *)"\n");   /* don't overwrite this either */
 
 	if (debug_break_level > 0 || *p_vfile == NUL)
@@ -572,7 +573,7 @@ throw_exception(void *value, except_type
 nomem:
     vim_free(excp);
     suppress_errthrow = TRUE;
-    EMSG(_(e_outofmem));
+    emsg(_(e_outofmem));
 fail:
     current_exception = NULL;
     return FAIL;
@@ -606,8 +607,8 @@ discard_exception(except_T *excp, int wa
 	if (debug_break_level > 0 || *p_vfile == NUL)
 	    msg_scroll = TRUE;	    /* always scroll up, don't overwrite */
 	smsg(was_finished
-		    ? (char_u *)_("Exception finished: %s")
-		    : (char_u *)_("Exception discarded: %s"),
+		    ? _("Exception finished: %s")
+		    : _("Exception discarded: %s"),
 		excp->value);
 	msg_puts((char_u *)"\n");   /* don't overwrite this either */
 	if (debug_break_level > 0 || *p_vfile == NUL)
@@ -651,7 +652,7 @@ catch_exception(except_T *excp)
 {
     excp->caught = caught_stack;
     caught_stack = excp;
-    set_vim_var_string(VV_EXCEPTION, excp->value, -1);
+    set_vim_var_string(VV_EXCEPTION, (char_u *)excp->value, -1);
     if (*excp->throw_name != NUL)
     {
 	if (excp->throw_lnum != 0)
@@ -677,7 +678,7 @@ catch_exception(except_T *excp)
 	if (debug_break_level > 0 || *p_vfile == NUL)
 	    msg_scroll = TRUE;	    /* always scroll up, don't overwrite */
 
-	smsg((char_u *)_("Exception caught: %s"), excp->value);
+	smsg(_("Exception caught: %s"), excp->value);
 	msg_puts((char_u *)"\n");   /* don't overwrite this either */
 
 	if (debug_break_level > 0 || *p_vfile == NUL)
@@ -701,7 +702,7 @@ finish_exception(except_T *excp)
     caught_stack = caught_stack->caught;
     if (caught_stack != NULL)
     {
-	set_vim_var_string(VV_EXCEPTION, caught_stack->value, -1);
+	set_vim_var_string(VV_EXCEPTION, (char_u *)caught_stack->value, -1);
 	if (*caught_stack->throw_name != NUL)
 	{
 	    if (caught_stack->throw_lnum != 0)
@@ -745,7 +746,7 @@ finish_exception(except_T *excp)
     static void
 report_pending(int action, int pending, void *value)
 {
-    char_u	*mesg;
+    char	*mesg;
     char	*s;
     int		save_msg_silent;
 
@@ -753,14 +754,14 @@ report_pending(int action, int pending, 
     switch (action)
     {
 	case RP_MAKE:
-	    mesg = (char_u *)_("%s made pending");
+	    mesg = _("%s made pending");
 	    break;
 	case RP_RESUME:
-	    mesg = (char_u *)_("%s resumed");
+	    mesg = _("%s resumed");
 	    break;
 	/* case RP_DISCARD: */
 	default:
-	    mesg = (char_u *)_("%s discarded");
+	    mesg = _("%s discarded");
 	    break;
     }
 
@@ -786,9 +787,8 @@ report_pending(int action, int pending, 
 	default:
 	    if (pending & CSTP_THROW)
 	    {
-		vim_snprintf((char *)IObuff, IOSIZE,
-						(char *)mesg, _("Exception"));
-		mesg = vim_strnsave(IObuff, (int)STRLEN(IObuff) + 4);
+		vim_snprintf((char *)IObuff, IOSIZE, mesg, _("Exception"));
+		mesg = (char *)vim_strnsave(IObuff, (int)STRLEN(IObuff) + 4);
 		STRCAT(mesg, ": %s");
 		s = (char *)((except_T *)value)->value;
 	    }
@@ -805,7 +805,7 @@ report_pending(int action, int pending, 
 	msg_silent = FALSE;	/* display messages */
     ++no_wait_return;
     msg_scroll = TRUE;		/* always scroll up, don't overwrite */
-    smsg(mesg, (char_u *)s);
+    smsg(mesg, s);
     msg_puts((char_u *)"\n");   /* don't overwrite this either */
     cmdline_row = msg_row;
     --no_wait_return;
@@ -882,7 +882,7 @@ ex_if(exarg_T *eap)
     struct condstack	*cstack = eap->cstack;
 
     if (cstack->cs_idx == CSTACK_LEN - 1)
-	eap->errmsg = (char_u *)N_("E579: :if nesting too deep");
+	eap->errmsg = N_("E579: :if nesting too deep");
     else
     {
 	++cstack->cs_idx;
@@ -918,7 +918,7 @@ ex_endif(exarg_T *eap)
     if (eap->cstack->cs_idx < 0
 	    || (eap->cstack->cs_flags[eap->cstack->cs_idx]
 					   & (CSF_WHILE | CSF_FOR | CSF_TRY)))
-	eap->errmsg = (char_u *)N_("E580: :endif without :if");
+	eap->errmsg = N_("E580: :endif without :if");
     else
     {
 	/*
@@ -962,20 +962,20 @@ ex_else(exarg_T *eap)
     {
 	if (eap->cmdidx == CMD_else)
 	{
-	    eap->errmsg = (char_u *)N_("E581: :else without :if");
+	    eap->errmsg = N_("E581: :else without :if");
 	    return;
 	}
-	eap->errmsg = (char_u *)N_("E582: :elseif without :if");
+	eap->errmsg = N_("E582: :elseif without :if");
 	skip = TRUE;
     }
     else if (cstack->cs_flags[cstack->cs_idx] & CSF_ELSE)
     {
 	if (eap->cmdidx == CMD_else)
 	{
-	    eap->errmsg = (char_u *)N_("E583: multiple :else");
+	    eap->errmsg = N_("E583: multiple :else");
 	    return;
 	}
-	eap->errmsg = (char_u *)N_("E584: :elseif after :else");
+	eap->errmsg = N_("E584: :elseif after :else");
 	skip = TRUE;
     }
 
@@ -1041,7 +1041,7 @@ ex_while(exarg_T *eap)
     struct condstack	*cstack = eap->cstack;
 
     if (cstack->cs_idx == CSTACK_LEN - 1)
-	eap->errmsg = (char_u *)N_("E585: :while/:for nesting too deep");
+	eap->errmsg = N_("E585: :while/:for nesting too deep");
     else
     {
 	/*
@@ -1138,7 +1138,7 @@ ex_continue(exarg_T *eap)
     struct condstack	*cstack = eap->cstack;
 
     if (cstack->cs_looplevel <= 0 || cstack->cs_idx < 0)
-	eap->errmsg = (char_u *)N_("E586: :continue without :while or :for");
+	eap->errmsg = N_("E586: :continue without :while or :for");
     else
     {
 	/* Try to find the matching ":while".  This might stop at a try
@@ -1176,7 +1176,7 @@ ex_break(exarg_T *eap)
     struct condstack	*cstack = eap->cstack;
 
     if (cstack->cs_looplevel <= 0 || cstack->cs_idx < 0)
-	eap->errmsg = (char_u *)N_("E587: :break without :while or :for");
+	eap->errmsg = N_("E587: :break without :while or :for");
     else
     {
 	/* Inactivate conditionals until the matching ":while" or a try
@@ -1200,7 +1200,7 @@ ex_endwhile(exarg_T *eap)
 {
     struct condstack	*cstack = eap->cstack;
     int			idx;
-    char_u		*err;
+    char		*err;
     int			csf;
     int			fl;
 
@@ -1225,9 +1225,9 @@ ex_endwhile(exarg_T *eap)
 	    /* If we are in a ":while" or ":for" but used the wrong endloop
 	     * command, do not rewind to the next enclosing ":for"/":while". */
 	    if (fl & CSF_WHILE)
-		eap->errmsg = (char_u *)_("E732: Using :endfor with :while");
+		eap->errmsg = _("E732: Using :endfor with :while");
 	    else if (fl & CSF_FOR)
-		eap->errmsg = (char_u *)_("E733: Using :endwhile with :for");
+		eap->errmsg = _("E733: Using :endwhile with :for");
 	}
 	if (!(fl & (CSF_WHILE | CSF_FOR)))
 	{
@@ -1291,7 +1291,7 @@ ex_throw(exarg_T *eap)
 	value = eval_to_string_skip(arg, &eap->nextcmd, eap->skip);
     else
     {
-	EMSG(_(e_argreq));
+	emsg(_(e_argreq));
 	value = NULL;
     }
 
@@ -1399,7 +1399,7 @@ ex_try(exarg_T *eap)
     struct condstack	*cstack = eap->cstack;
 
     if (cstack->cs_idx == CSTACK_LEN - 1)
-	eap->errmsg = (char_u *)N_("E601: :try nesting too deep");
+	eap->errmsg = N_("E601: :try nesting too deep");
     else
     {
 	++cstack->cs_idx;
@@ -1443,7 +1443,7 @@ ex_try(exarg_T *eap)
 
 		elem = (eslist_T *)alloc((unsigned)sizeof(struct eslist_elem));
 		if (elem == NULL)
-		    EMSG(_(e_outofmem));
+		    emsg(_(e_outofmem));
 		else
 		{
 		    elem->saved_emsg_silent = emsg_silent;
@@ -1478,7 +1478,7 @@ ex_catch(exarg_T *eap)
 
     if (cstack->cs_trylevel <= 0 || cstack->cs_idx < 0)
     {
-	eap->errmsg = (char_u *)N_("E603: :catch without :try");
+	eap->errmsg = N_("E603: :catch without :try");
 	give_up = TRUE;
     }
     else
@@ -1497,7 +1497,7 @@ ex_catch(exarg_T *eap)
 	{
 	    /* Give up for a ":catch" after ":finally" and ignore it.
 	     * Just parse. */
-	    eap->errmsg = (char_u *)N_("E604: :catch after :finally");
+	    eap->errmsg = N_("E604: :catch after :finally");
 	    give_up = TRUE;
 	}
 	else
@@ -1537,7 +1537,7 @@ ex_catch(exarg_T *eap)
 	{
 	    if (end != NULL && *end != NUL && !ends_excmd(*skipwhite(end + 1)))
 	    {
-		EMSG(_(e_trailing));
+		emsg(_(e_trailing));
 		return;
 	    }
 
@@ -1569,7 +1569,7 @@ ex_catch(exarg_T *eap)
 		    *end = save_char;
 		p_cpo = save_cpo;
 		if (regmatch.regprog == NULL)
-		    EMSG2(_(e_invarg2), pat);
+		    semsg(_(e_invarg2), pat);
 		else
 		{
 		    /*
@@ -1579,8 +1579,8 @@ ex_catch(exarg_T *eap)
 		     */
 		    prev_got_int = got_int;
 		    got_int = FALSE;
-		    caught = vim_regexec_nl(&regmatch, current_exception->value,
-			    (colnr_T)0);
+		    caught = vim_regexec_nl(&regmatch,
+			       (char_u *)current_exception->value, (colnr_T)0);
 		    got_int |= prev_got_int;
 		    vim_regfree(regmatch.regprog);
 		}
@@ -1634,7 +1634,7 @@ ex_finally(exarg_T *eap)
     struct condstack	*cstack = eap->cstack;
 
     if (cstack->cs_trylevel <= 0 || cstack->cs_idx < 0)
-	eap->errmsg = (char_u *)N_("E606: :finally without :try");
+	eap->errmsg = N_("E606: :finally without :try");
     else
     {
 	if (!(cstack->cs_flags[cstack->cs_idx] & CSF_TRY))
@@ -1654,7 +1654,7 @@ ex_finally(exarg_T *eap)
 	if (cstack->cs_flags[idx] & CSF_FINALLY)
 	{
 	    /* Give up for a multiple ":finally" and ignore it. */
-	    eap->errmsg = (char_u *)N_("E607: multiple :finally");
+	    eap->errmsg = N_("E607: multiple :finally");
 	    return;
 	}
 	rewind_conditionals(cstack, idx, CSF_WHILE | CSF_FOR,
@@ -1763,7 +1763,7 @@ ex_endtry(exarg_T *eap)
     struct condstack	*cstack = eap->cstack;
 
     if (cstack->cs_trylevel <= 0 || cstack->cs_idx < 0)
-	eap->errmsg = (char_u *)N_("E602: :endtry without :try");
+	eap->errmsg = N_("E602: :endtry without :try");
     else
     {
 	/*
@@ -2223,7 +2223,7 @@ cleanup_conditionals(
 /*
  * Return an appropriate error message for a missing endwhile/endfor/endif.
  */
-   static char_u *
+   static char *
 get_end_emsg(struct condstack *cstack)
 {
     if (cstack->cs_flags[cstack->cs_idx] & CSF_WHILE)
@@ -2264,7 +2264,7 @@ rewind_conditionals(
     void
 ex_endfunction(exarg_T *eap UNUSED)
 {
-    EMSG(_("E193: :endfunction not inside a function"));
+    emsg(_("E193: :endfunction not inside a function"));
 }
 
 /*
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -275,7 +275,7 @@ do_incsearch_highlighting(int firstc, in
     int		delim_optional = FALSE;
     int		delim;
     char_u	*end;
-    char_u	*dummy;
+    char	*dummy;
     exarg_T	ea;
     pos_T	save_cursor;
     int		use_last_pat;
@@ -2601,10 +2601,10 @@ text_locked(void)
     void
 text_locked_msg(void)
 {
-    EMSG(_(get_text_locked_msg()));
+    emsg(_(get_text_locked_msg()));
 }
 
-    char_u *
+    char *
 get_text_locked_msg(void)
 {
 #ifdef FEAT_CMDWIN
@@ -2623,7 +2623,7 @@ curbuf_locked(void)
 {
     if (curbuf_lock > 0)
     {
-	EMSG(_("E788: Not allowed to edit another buffer now"));
+	emsg(_("E788: Not allowed to edit another buffer now"));
 	return TRUE;
     }
     return allbuf_locked();
@@ -2638,7 +2638,7 @@ allbuf_locked(void)
 {
     if (allbuf_lock > 0)
     {
-	EMSG(_("E811: Not allowed to change buffer information now"));
+	emsg(_("E811: Not allowed to change buffer information now"));
 	return TRUE;
     }
     return FALSE;
@@ -4174,13 +4174,13 @@ ExpandOne(
 	     * causing the pattern to be added, which has illegal characters.
 	     */
 	    if (!(options & WILD_SILENT) && (options & WILD_LIST_NOTFOUND))
-		EMSG2(_(e_nomatch2), str);
+		semsg(_(e_nomatch2), str);
 #endif
 	}
 	else if (xp->xp_numfiles == 0)
 	{
 	    if (!(options & WILD_SILENT))
-		EMSG2(_(e_nomatch2), str);
+		semsg(_(e_nomatch2), str);
 	}
 	else
 	{
@@ -4219,7 +4219,7 @@ ExpandOne(
 		     * (and possibly have to hit return to continue!).
 		     */
 		    if (!(options & WILD_SILENT))
-			EMSG(_(e_toomany));
+			emsg(_(e_toomany));
 		    else if (!(options & WILD_NO_BEEP))
 			beep_flush();
 		}
@@ -6658,7 +6658,7 @@ ex_history(exarg_T *eap)
 	    else
 	    {
 		*end = i;
-		EMSG(_(e_trailing));
+		emsg(_(e_trailing));
 		return;
 	    }
 	}
@@ -6670,7 +6670,7 @@ ex_history(exarg_T *eap)
 	end = arg;
     if (!get_list_range(&end, &hisidx1, &hisidx2) || *end != NUL)
     {
-	EMSG(_(e_trailing));
+	emsg(_(e_trailing));
 	return;
     }
 
@@ -7201,7 +7201,7 @@ cmd_pchar(int c, int offset)
 {
     if (ccline.cmdpos + offset >= ccline.cmdlen || ccline.cmdpos + offset < 0)
     {
-	EMSG(_("E198: cmd_pchar beyond the command length"));
+	emsg(_("E198: cmd_pchar beyond the command length"));
 	return;
     }
     ccline.cmdbuff[ccline.cmdpos + offset] = (char_u)c;
@@ -7213,7 +7213,7 @@ cmd_gchar(int offset)
 {
     if (ccline.cmdpos + offset >= ccline.cmdlen || ccline.cmdpos + offset < 0)
     {
-	/*  EMSG(_("cmd_gchar beyond the command length")); */
+	// emsg(_("cmd_gchar beyond the command length"));
 	return NUL;
     }
     return (int)ccline.cmdbuff[ccline.cmdpos + offset];
@@ -7392,7 +7392,7 @@ open_cmdwin(void)
     if (!win_valid(old_curwin) || !bufref_valid(&old_curbuf))
     {
 	cmdwin_result = Ctrl_C;
-	EMSG(_("E199: Active window or buffer deleted"));
+	emsg(_("E199: Active window or buffer deleted"));
     }
     else
     {
--- a/src/farsi.h
+++ b/src/farsi.h
@@ -203,7 +203,7 @@ EXTERN char_u farsi_text_2[]
 #endif
 		     ;
 
-EXTERN char_u farsi_text_3[]
+EXTERN char farsi_text_3[]
 #ifdef DO_INIT
 		= { DAL, WAW, _SHIN, _YE, _MIM, _NOON, ' ', YE_, _NOON,
 		    ALEF_,_BE, _YE, _TE, _SHIN, _PE, ' ', 'R','E','P','L',
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -595,7 +595,7 @@ readfile(
 				|| (using_b_fname
 					 && (old_b_fname != curbuf->b_fname)))
 			{
-			    EMSG(_(e_auchangedbuf));
+			    emsg(_(e_auchangedbuf));
 			    return FAIL;
 			}
 		    }
@@ -676,7 +676,7 @@ readfile(
 		|| (using_b_ffname && (old_b_ffname != curbuf->b_ffname))
 		|| (using_b_fname && (old_b_fname != curbuf->b_fname))))
 	{
-	    EMSG(_(e_auchangedbuf));
+	    emsg(_(e_auchangedbuf));
 	    if (!read_buffer)
 		close(fd);
 	    return FAIL;
@@ -798,9 +798,9 @@ readfile(
 	    --no_wait_return;
 	    msg_scroll = msg_save;
 	    if (fd < 0)
-		EMSG(_("E200: *ReadPre autocommands made the file unreadable"));
+		emsg(_("E200: *ReadPre autocommands made the file unreadable"));
 	    else
-		EMSG(_("E201: *ReadPre autocommands must not change current buffer"));
+		emsg(_("E201: *ReadPre autocommands must not change current buffer"));
 	    curbuf->b_p_ro = TRUE;	/* must use "w!" now */
 	    return FAIL;
 	}
@@ -1128,7 +1128,7 @@ retry:
 		    if (fd < 0)
 		    {
 			/* Re-opening the original file failed! */
-			EMSG(_("E202: Conversion made file unreadable!"));
+			emsg(_("E202: Conversion made file unreadable!"));
 			error = TRUE;
 			goto failed;
 		    }
@@ -2993,7 +2993,7 @@ check_for_cryptkey(
 		 * option and don't free it.  bf needs hash of the key saved.
 		 * Don't ask for the key again when first time Enter was hit.
 		 * Happens when retrying to detect encoding. */
-		smsg((char_u *)_(need_key_msg), fname);
+		smsg(_(need_key_msg), fname);
 		msg_scroll = TRUE;
 		crypt_check_method(method);
 		cryptkey = crypt_get_key(newfile, FALSE);
@@ -3197,7 +3197,7 @@ buf_write(
     {
 	/* This can happen during startup when there is a stray "w" in the
 	 * vimrc file. */
-	EMSG(_(e_emptybuf));
+	emsg(_(e_emptybuf));
 	return FAIL;
     }
 
@@ -3211,7 +3211,7 @@ buf_write(
     /* Avoid a crash for a long name. */
     if (STRLEN(fname) >= MAXPATHL)
     {
-	EMSG(_(e_longname));
+	emsg(_(e_longname));
 	return FAIL;
     }
 
@@ -3399,7 +3399,7 @@ buf_write(
 	    --no_wait_return;
 	    msg_scroll = msg_save;
 	    if (nofile_err)
-		EMSG(_("E676: No matching autocommands for acwrite buffer"));
+		emsg(_("E676: No matching autocommands for acwrite buffer"));
 
 	    if (nofile_err
 #ifdef FEAT_EVAL
@@ -3434,7 +3434,7 @@ buf_write(
 #ifdef FEAT_EVAL
 	    if (!aborting())
 #endif
-		EMSG(_("E203: Autocommands deleted or unloaded buffer to be written"));
+		emsg(_("E203: Autocommands deleted or unloaded buffer to be written"));
 	    return FAIL;
 	}
 
@@ -3457,7 +3457,7 @@ buf_write(
 		{
 		    --no_wait_return;
 		    msg_scroll = msg_save;
-		    EMSG(_("E204: Autocommand changed number of lines in unexpected way"));
+		    emsg(_("E204: Autocommand changed number of lines in unexpected way"));
 		    return FAIL;
 		}
 	    }
@@ -5055,7 +5055,7 @@ restore_backup:
 	     * the current backup file becomes the original file
 	     */
 	    if (org == NULL)
-		EMSG(_("E205: Patchmode: can't save original file"));
+		emsg(_("E205: Patchmode: can't save original file"));
 	    else if (mch_stat(org, &st) < 0)
 	    {
 		vim_rename(backup, (char_u *)org);
@@ -5077,7 +5077,7 @@ restore_backup:
 		    || (empty_fd = mch_open(org,
 				      O_CREAT | O_EXTRA | O_EXCL | O_NOFOLLOW,
 					perm < 0 ? 0666 : (perm & 0777))) < 0)
-	      EMSG(_("E206: patchmode: can't touch empty original file"));
+	      emsg(_("E206: patchmode: can't touch empty original file"));
 	    else
 	      close(empty_fd);
 	}
@@ -5092,7 +5092,7 @@ restore_backup:
      * Remove the backup unless 'backup' option is set
      */
     if (!p_bk && backup != NULL && mch_remove(backup) != 0)
-	EMSG(_("E207: Can't delete backup file"));
+	emsg(_("E207: Can't delete backup file"));
 
 #ifdef FEAT_SUN_WORKSHOP
     if (usingSunWorkShop)
@@ -5151,7 +5151,7 @@ nofail:
 	    mch_memmove(IObuff, errnum, (size_t)numlen);
 	}
 	STRCAT(IObuff, errmsg);
-	emsg(IObuff);
+	emsg((char *)IObuff);
 	if (errmsg_allocated)
 	    vim_free(errmsg);
 
@@ -5251,7 +5251,7 @@ set_rw_fname(char_u *fname, char_u *sfna
     if (curbuf != buf)
     {
 	/* We are in another buffer now, don't do the renaming. */
-	EMSG(_(e_auchangedbuf));
+	emsg(_(e_auchangedbuf));
 	return FAIL;
     }
 
@@ -6732,7 +6732,7 @@ vim_rename(char_u *from, char_u *to)
 #endif
     if (errmsg != NULL)
     {
-	EMSG2(errmsg, to);
+	semsg(errmsg, to);
 	return -1;
     }
     mch_remove(from);
@@ -6872,7 +6872,7 @@ buf_check_timestamp(
     int		stat_res;
     int		retval = 0;
     char_u	*path;
-    char_u	*tbuf;
+    char	*tbuf;
     char	*mesg = NULL;
     char	*mesg2 = "";
     int		helpmesg = FALSE;
@@ -6983,7 +6983,7 @@ buf_check_timestamp(
 	    if (n)
 	    {
 		if (!bufref_valid(&bufref))
-		    EMSG(_("E246: FileChangedShell autocommand deleted buffer"));
+		    emsg(_("E246: FileChangedShell autocommand deleted buffer"));
 #ifdef FEAT_EVAL
 		s = get_vim_var_str(VV_FCS_CHOICE);
 		if (STRCMP(s, "reload") == 0 && *reason != 'd')
@@ -7052,13 +7052,13 @@ buf_check_timestamp(
 	{
 	    if (!helpmesg)
 		mesg2 = "";
-	    tbuf = alloc((unsigned)(STRLEN(path) + STRLEN(mesg)
+	    tbuf = (char *)alloc((unsigned)(STRLEN(path) + STRLEN(mesg)
 							+ STRLEN(mesg2) + 2));
-	    sprintf((char *)tbuf, mesg, path);
+	    sprintf(tbuf, mesg, path);
 #ifdef FEAT_EVAL
 	    /* Set warningmsg here, before the unimportant and output-specific
 	     * mesg2 has been appended. */
-	    set_vim_var_string(VV_WARNINGMSG, tbuf, -1);
+	    set_vim_var_string(VV_WARNINGMSG, (char_u *)tbuf, -1);
 #endif
 #if defined(FEAT_CON_DIALOG) || defined(FEAT_GUI_DIALOG)
 	    if (can_reload)
@@ -7068,7 +7068,8 @@ buf_check_timestamp(
 		    STRCAT(tbuf, "\n");
 		    STRCAT(tbuf, mesg2);
 		}
-		if (do_dialog(VIM_WARNING, (char_u *)_("Warning"), tbuf,
+		if (do_dialog(VIM_WARNING, (char_u *)_("Warning"),
+			    (char_u *)tbuf,
 			  (char_u *)_("&OK\n&Load File"), 1, NULL, TRUE) == 2)
 		    reload = TRUE;
 	    }
@@ -7081,7 +7082,7 @@ buf_check_timestamp(
 		    STRCAT(tbuf, "; ");
 		    STRCAT(tbuf, mesg2);
 		}
-		EMSG(tbuf);
+		emsg(tbuf);
 		retval = 2;
 	    }
 	    else
@@ -7089,7 +7090,7 @@ buf_check_timestamp(
 		if (!autocmd_busy)
 		{
 		    msg_start();
-		    msg_puts_attr(tbuf, HL_ATTR(HLF_E) + MSG_HIST);
+		    msg_puts_attr((char_u *)tbuf, HL_ATTR(HLF_E) + MSG_HIST);
 		    if (*mesg2 != NUL)
 			msg_puts_attr((char_u *)mesg2,
 						   HL_ATTR(HLF_W) + MSG_HIST);
@@ -7213,7 +7214,7 @@ buf_reload(buf_T *buf, int orig_mode)
 	    if (savebuf == NULL || saved == FAIL || buf != curbuf
 				      || move_lines(buf, savebuf) == FAIL)
 	    {
-		EMSG2(_("E462: Could not prepare for reloading \"%s\""),
+		semsg(_("E462: Could not prepare for reloading \"%s\""),
 							    buf->b_fname);
 		saved = FAIL;
 	    }
@@ -7230,7 +7231,7 @@ buf_reload(buf_T *buf, int orig_mode)
 #if defined(FEAT_EVAL)
 		if (!aborting())
 #endif
-		    EMSG2(_("E321: Could not reload \"%s\""), buf->b_fname);
+		    semsg(_("E321: Could not reload \"%s\""), buf->b_fname);
 		if (savebuf != NULL && bufref_valid(&bufref) && buf == curbuf)
 		{
 		    /* Put the text back from the save buffer.  First
@@ -8076,8 +8077,7 @@ aubuflocal_remove(buf_T *buf)
 		if (p_verbose >= 6)
 		{
 		    verbose_enter();
-		    smsg((char_u *)
-			    _("auto-removing autocommand: %s <buffer=%d>"),
+		    smsg(_("auto-removing autocommand: %s <buffer=%d>"),
 					   event_nr2name(event), buf->b_fnum);
 		    verbose_leave();
 		}
@@ -8121,9 +8121,9 @@ au_del_group(char_u *name)
 
     i = au_find_group(name);
     if (i == AUGROUP_ERROR)	/* the group doesn't exist */
-	EMSG2(_("E367: No such group: \"%s\""), name);
+	semsg(_("E367: No such group: \"%s\""), name);
     else if (i == current_augroup)
-	EMSG(_("E936: Cannot delete the current group"));
+	emsg(_("E936: Cannot delete the current group"));
     else
     {
 	event_T	event;
@@ -8188,7 +8188,7 @@ do_augroup(char_u *arg, int del_group)
     if (del_group)
     {
 	if (*arg == NUL)
-	    EMSG(_(e_argreq));
+	    emsg(_(e_argreq));
 	else
 	    au_del_group(arg);
     }
@@ -8295,7 +8295,7 @@ find_end_event(
     {
 	if (arg[1] && !VIM_ISWHITE(arg[1]))
 	{
-	    EMSG2(_("E215: Illegal character after *: %s"), arg);
+	    semsg(_("E215: Illegal character after *: %s"), arg);
 	    return NULL;
 	}
 	pat = arg + 1;
@@ -8307,9 +8307,9 @@ find_end_event(
 	    if ((int)event_name2nr(pat, &p) >= (int)NUM_EVENTS)
 	    {
 		if (have_group)
-		    EMSG2(_("E216: No such event: %s"), pat);
+		    semsg(_("E216: No such event: %s"), pat);
 		else
-		    EMSG2(_("E216: No such group or event: %s"), pat);
+		    semsg(_("E216: No such group or event: %s"), pat);
 		return NULL;
 	    }
 	}
@@ -8773,7 +8773,7 @@ do_autocmd_event(
 		if (is_buflocal && (buflocal_nr == 0
 				      || buflist_findnr(buflocal_nr) == NULL))
 		{
-		    EMSGN(_("E680: <buffer=%d>: invalid buffer number "),
+		    semsg(_("E680: <buffer=%d>: invalid buffer number "),
 								 buflocal_nr);
 		    return FAIL;
 		}
@@ -8876,7 +8876,7 @@ do_doautocmd(
 
     if (*arg == '*')
     {
-	EMSG(_("E217: Can't execute autocommands for ALL events"));
+	emsg(_("E217: Can't execute autocommands for ALL events"));
 	return FAIL;
     }
 
@@ -9461,7 +9461,7 @@ apply_autocmds_group(
      */
     if (nesting == 10)
     {
-	EMSG(_("E218: autocommand nesting too deep"));
+	emsg(_("E218: autocommand nesting too deep"));
 	goto BYPASS_AU;
     }
 
@@ -9869,7 +9869,7 @@ auto_next_pat(
 		    if (p_verbose >= 8)
 		    {
 			verbose_enter();
-			smsg((char_u *)_("Executing %s"), sourcing_name);
+			smsg(_("Executing %s"), sourcing_name);
 			verbose_leave();
 		    }
 		}
@@ -9935,7 +9935,7 @@ getnextac(int c UNUSED, void *cookie, in
     if (p_verbose >= 9)
     {
 	verbose_enter_scroll();
-	smsg((char_u *)_("autocommand %s"), ac->cmd);
+	smsg(_("autocommand %s"), ac->cmd);
 	msg_puts((char_u *)"\n");   /* don't overwrite this either */
 	verbose_leave_scroll();
     }
@@ -10483,9 +10483,9 @@ file_pat_to_reg_pat(
     if (nested != 0)
     {
 	if (nested < 0)
-	    EMSG(_("E219: Missing {."));
+	    emsg(_("E219: Missing {."));
 	else
-	    EMSG(_("E220: Missing }."));
+	    emsg(_("E220: Missing }."));
 	VIM_CLEAR(reg_pat);
     }
     return reg_pat;
--- a/src/fold.c
+++ b/src/fold.c
@@ -410,7 +410,7 @@ opFoldRange(
 	    (void)hasFolding(lnum, NULL, &lnum_next);
     }
     if (done == DONE_NOTHING)
-	EMSG(_(e_nofold));
+	emsg(_(e_nofold));
     /* Force a redraw to remove the Visual highlighting. */
     if (had_visual)
 	redraw_curbuf_later(INVERTED);
@@ -561,9 +561,9 @@ foldManualAllowed(int create)
     if (foldmethodIsManual(curwin) || foldmethodIsMarker(curwin))
 	return TRUE;
     if (create)
-	EMSG(_("E350: Cannot create fold with current 'foldmethod'"));
+	emsg(_("E350: Cannot create fold with current 'foldmethod'"));
     else
-	EMSG(_("E351: Cannot delete fold with current 'foldmethod'"));
+	emsg(_("E351: Cannot delete fold with current 'foldmethod'"));
     return FALSE;
 }
 
@@ -775,7 +775,7 @@ deleteFold(
     }
     if (!did_one)
     {
-	EMSG(_(e_nofold));
+	emsg(_(e_nofold));
 	/* Force a redraw to remove the Visual highlighting. */
 	if (had_visual)
 	    redraw_curbuf_later(INVERTED);
@@ -1211,7 +1211,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_nofold));
 	    break;
 	}
     }
@@ -1363,7 +1363,7 @@ setManualFoldWin(
 	done |= DONE_FOLD;
     }
     else if (donep == NULL && wp == curwin)
-	EMSG(_(e_nofold));
+	emsg(_(e_nofold));
 
     if (donep != NULL)
 	*donep |= done;
@@ -1735,7 +1735,7 @@ foldCreateMarkers(linenr_T start, linenr
 {
     if (!curbuf->b_p_ma)
     {
-	EMSG(_(e_modifiable));
+	emsg(_(e_modifiable));
 	return;
     }
     parseMarker(curwin);
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -237,7 +237,7 @@ add_buff(
     }
     else if (buf->bh_curr == NULL)	/* buffer has already been read */
     {
-	IEMSG(_("E222: Add to read buffer"));
+	iemsg(_("E222: Add to read buffer"));
 	return;
     }
     else if (buf->bh_index != 0)
@@ -998,7 +998,7 @@ ins_typebuf(
 	newlen = typebuf.tb_len + addlen + newoff + 4 * (MAXMAPLEN + 4);
 	if (newlen < 0)		    /* string is getting too long */
 	{
-	    EMSG(_(e_toocompl));    /* also calls flush_buffers */
+	    emsg(_(e_toocompl));    /* also calls flush_buffers */
 	    setcursor();
 	    return FAIL;
 	}
@@ -1431,7 +1431,7 @@ openscript(
 {
     if (curscript + 1 == NSCRIPT)
     {
-	EMSG(_(e_nesting));
+	emsg(_(e_nesting));
 	return;
     }
 #ifdef FEAT_EVAL
@@ -1446,7 +1446,7 @@ openscript(
     expand_env(name, NameBuff, MAXPATHL);
     if ((scriptin[curscript] = mch_fopen((char *)NameBuff, READBIN)) == NULL)
     {
-	EMSG2(_(e_notopen), name);
+	semsg(_(e_notopen), name);
 	if (curscript)
 	    --curscript;
 	return;
@@ -2508,7 +2508,7 @@ vgetorpeek(int advance)
 			 */
 			if (++mapdepth >= p_mmd)
 			{
-			    EMSG(_("E223: recursive mapping"));
+			    emsg(_("E223: recursive mapping"));
 			    if (State & CMDLINE)
 				redrawcmdline();
 			    else
@@ -3508,10 +3508,10 @@ do_map(
 			&& STRNCMP(mp->m_keys, keys, (size_t)len) == 0)
 		{
 		    if (abbrev)
-			EMSG2(_("E224: global abbreviation already exists for %s"),
+			semsg(_("E224: global abbreviation already exists for %s"),
 				mp->m_keys);
 		    else
-			EMSG2(_("E225: global mapping already exists for %s"),
+			semsg(_("E225: global mapping already exists for %s"),
 				mp->m_keys);
 		    retval = 5;
 		    goto theend;
@@ -3643,10 +3643,10 @@ do_map(
 			else if (unique)
 			{
 			    if (abbrev)
-				EMSG2(_("E226: abbreviation already exists for %s"),
+				semsg(_("E226: abbreviation already exists for %s"),
 									   p);
 			    else
-				EMSG2(_("E227: mapping already exists for %s"), p);
+				semsg(_("E227: mapping already exists for %s"), p);
 			    retval = 5;
 			    goto theend;
 			}
@@ -3892,7 +3892,7 @@ map_clear(
     local = (STRCMP(arg, "<buffer>") == 0);
     if (!local && *arg != NUL)
     {
-	EMSG(_(e_invarg));
+	emsg(_(e_invarg));
 	return;
     }
 #endif
@@ -4920,7 +4920,7 @@ makemap(
 			c1 = 't';
 			break;
 		    default:
-			IEMSG(_("E228: makemap: Illegal mode"));
+			iemsg(_("E228: makemap: Illegal mode"));
 			return FAIL;
 		}
 		do	/* do this twice if c2 is set, 3 times with c3 */
--- a/src/globals.h
+++ b/src/globals.h
@@ -1391,54 +1391,54 @@ EXTERN int netbeansSuppressNoLines INIT(
  * The error messages that can be shared are included here.
  * Excluded are errors that are only used once and debugging messages.
  */
-EXTERN char_u e_abort[]		INIT(= N_("E470: Command aborted"));
-EXTERN char_u e_argreq[]	INIT(= N_("E471: Argument required"));
-EXTERN char_u e_backslash[]	INIT(= N_("E10: \\ should be followed by /, ? or &"));
+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_u e_cmdwin[]	INIT(= N_("E11: Invalid in command-line window; <CR> executes, CTRL-C quits"));
+EXTERN char e_cmdwin[]	INIT(= N_("E11: Invalid in command-line window; <CR> executes, CTRL-C quits"));
 #endif
-EXTERN char_u e_curdir[]	INIT(= N_("E12: Command not allowed from exrc/vimrc in current dir or tag search"));
+EXTERN char e_curdir[]	INIT(= N_("E12: Command not allowed from exrc/vimrc in current dir or tag search"));
 #ifdef FEAT_EVAL
-EXTERN char_u e_endif[]		INIT(= N_("E171: Missing :endif"));
-EXTERN char_u e_endtry[]	INIT(= N_("E600: Missing :endtry"));
-EXTERN char_u e_endwhile[]	INIT(= N_("E170: Missing :endwhile"));
-EXTERN char_u e_endfor[]	INIT(= N_("E170: Missing :endfor"));
-EXTERN char_u e_while[]		INIT(= N_("E588: :endwhile without :while"));
-EXTERN char_u e_for[]		INIT(= N_("E588: :endfor without :for"));
+EXTERN char e_endif[]		INIT(= N_("E171: Missing :endif"));
+EXTERN char e_endtry[]	INIT(= N_("E600: Missing :endtry"));
+EXTERN char e_endwhile[]	INIT(= N_("E170: Missing :endwhile"));
+EXTERN char e_endfor[]	INIT(= N_("E170: Missing :endfor"));
+EXTERN char e_while[]		INIT(= N_("E588: :endwhile without :while"));
+EXTERN char e_for[]		INIT(= N_("E588: :endfor without :for"));
 #endif
-EXTERN char_u e_exists[]	INIT(= N_("E13: File exists (add ! to override)"));
-EXTERN char_u e_failed[]	INIT(= N_("E472: Command failed"));
+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_u e_fontset[]	INIT(= N_("E234: Unknown fontset: %s"));
+EXTERN char e_fontset[]	INIT(= N_("E234: Unknown fontset: %s"));
 #endif
 #if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MAC) \
 	|| defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MSWIN)
-EXTERN char_u e_font[]		INIT(= N_("E235: Unknown font: %s"));
+EXTERN char e_font[]		INIT(= N_("E235: Unknown font: %s"));
 #endif
 #if defined(FEAT_GUI_X11) && !defined(FEAT_GUI_GTK)
-EXTERN char_u e_fontwidth[]	INIT(= N_("E236: Font \"%s\" is not fixed-width"));
+EXTERN char e_fontwidth[]	INIT(= N_("E236: Font \"%s\" is not fixed-width"));
 #endif
-EXTERN char_u e_internal[]	INIT(= N_("E473: Internal error"));
-EXTERN char_u e_intern2[]	INIT(= N_("E685: Internal error: %s"));
-EXTERN char_u e_interr[]	INIT(= N_("Interrupted"));
-EXTERN char_u e_invaddr[]	INIT(= N_("E14: Invalid address"));
-EXTERN char_u e_invarg[]	INIT(= N_("E474: Invalid argument"));
-EXTERN char_u e_invarg2[]	INIT(= N_("E475: Invalid argument: %s"));
-EXTERN char_u e_invargval[]	INIT(= N_("E475: Invalid value for argument %s"));
-EXTERN char_u e_invargNval[]	INIT(= N_("E475: Invalid value for argument %s: %s"));
+EXTERN char e_internal[]	INIT(= N_("E473: Internal error"));
+EXTERN char e_intern2[]	INIT(= N_("E685: Internal error: %s"));
+EXTERN char e_interr[]	INIT(= N_("Interrupted"));
+EXTERN char e_invaddr[]	INIT(= N_("E14: Invalid address"));
+EXTERN char e_invarg[]	INIT(= N_("E474: Invalid argument"));
+EXTERN char e_invarg2[]	INIT(= N_("E475: Invalid 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_u e_invexpr2[]	INIT(= N_("E15: Invalid expression: %s"));
+EXTERN char e_invexpr2[]	INIT(= N_("E15: Invalid expression: %s"));
 #endif
-EXTERN char_u e_invrange[]	INIT(= N_("E16: Invalid range"));
-EXTERN char_u e_invcmd[]	INIT(= N_("E476: Invalid command"));
+EXTERN char e_invrange[]	INIT(= N_("E16: Invalid range"));
+EXTERN char e_invcmd[]	INIT(= N_("E476: Invalid command"));
 #if defined(UNIX) || defined(FEAT_SYN_HL) || defined(FEAT_SPELL)
-EXTERN char_u e_isadir2[]	INIT(= N_("E17: \"%s\" is a directory"));
+EXTERN char e_isadir2[]	INIT(= N_("E17: \"%s\" is a directory"));
 #endif
 #ifdef FEAT_LIBCALL
-EXTERN char_u e_libcall[]	INIT(= N_("E364: Library call failed for \"%s()\""));
+EXTERN char e_libcall[]	INIT(= N_("E364: Library call failed for \"%s()\""));
 #endif
 #ifdef HAVE_FSYNC
-EXTERN char_u e_fsync[]		INIT(= N_("E667: Fsync failed"));
+EXTERN char e_fsync[]		INIT(= N_("E667: Fsync failed"));
 #endif
 #if defined(DYNAMIC_PERL) \
 	|| defined(DYNAMIC_PYTHON) || defined(DYNAMIC_PYTHON3) \
@@ -1448,145 +1448,145 @@ EXTERN char_u e_fsync[]		INIT(= N_("E667
 	|| defined(DYNAMIC_GETTEXT) \
 	|| defined(DYNAMIC_MZSCHEME) \
 	|| defined(DYNAMIC_LUA)
-EXTERN char_u e_loadlib[]	INIT(= N_("E370: Could not load library %s"));
-EXTERN char_u e_loadfunc[]	INIT(= N_("E448: Could not load library function %s"));
+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_u e_markinval[]	INIT(= N_("E19: Mark has invalid line number"));
-EXTERN char_u e_marknotset[]	INIT(= N_("E20: Mark not set"));
-EXTERN char_u e_modifiable[]	INIT(= N_("E21: Cannot make changes, 'modifiable' is off"));
-EXTERN char_u e_nesting[]	INIT(= N_("E22: Scripts nested too deep"));
-EXTERN char_u e_noalt[]		INIT(= N_("E23: No alternate file"));
-EXTERN char_u e_noabbr[]	INIT(= N_("E24: No such abbreviation"));
-EXTERN char_u e_nobang[]	INIT(= N_("E477: No ! allowed"));
+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"));
 #ifndef FEAT_GUI
-EXTERN char_u e_nogvim[]	INIT(= N_("E25: GUI cannot be used: Not enabled at compile time"));
+EXTERN char e_nogvim[]	INIT(= N_("E25: GUI cannot be used: Not enabled at compile time"));
 #endif
 #ifndef FEAT_RIGHTLEFT
-EXTERN char_u e_nohebrew[]	INIT(= N_("E26: Hebrew cannot be used: Not enabled at compile time\n"));
+EXTERN char e_nohebrew[]	INIT(= N_("E26: Hebrew cannot be used: Not enabled at compile time\n"));
 #endif
 #ifndef FEAT_FKMAP
-EXTERN char_u e_nofarsi[]	INIT(= N_("E27: Farsi cannot be used: Not enabled at compile time\n"));
+EXTERN char e_nofarsi[]	INIT(= N_("E27: Farsi cannot be used: Not enabled at compile time\n"));
 #endif
 #ifndef FEAT_ARABIC
-EXTERN char_u e_noarabic[]	INIT(= N_("E800: Arabic cannot be used: Not enabled at compile time\n"));
+EXTERN char e_noarabic[]	INIT(= N_("E800: Arabic cannot be used: Not enabled at compile time\n"));
 #endif
 #if defined(FEAT_SEARCH_EXTRA) || defined(FEAT_SYN_HL)
-EXTERN char_u e_nogroup[]	INIT(= N_("E28: No such highlight group name: %s"));
+EXTERN char e_nogroup[]	INIT(= N_("E28: No such highlight group name: %s"));
 #endif
-EXTERN char_u e_noinstext[]	INIT(= N_("E29: No inserted text yet"));
-EXTERN char_u e_nolastcmd[]	INIT(= N_("E30: No previous command line"));
-EXTERN char_u e_nomap[]		INIT(= N_("E31: No such mapping"));
-EXTERN char_u e_nomatch[]	INIT(= N_("E479: No match"));
-EXTERN char_u e_nomatch2[]	INIT(= N_("E480: No match: %s"));
-EXTERN char_u e_noname[]	INIT(= N_("E32: No file name"));
-EXTERN char_u e_nopresub[]	INIT(= N_("E33: No previous substitute regular expression"));
-EXTERN char_u e_noprev[]	INIT(= N_("E34: No previous command"));
-EXTERN char_u e_noprevre[]	INIT(= N_("E35: No previous regular expression"));
-EXTERN char_u e_norange[]	INIT(= N_("E481: No range allowed"));
-EXTERN char_u e_noroom[]	INIT(= N_("E36: Not enough room"));
+EXTERN char e_noinstext[]	INIT(= N_("E29: No inserted text yet"));
+EXTERN char e_nolastcmd[]	INIT(= N_("E30: No previous command line"));
+EXTERN char e_nomap[]		INIT(= N_("E31: No such mapping"));
+EXTERN char e_nomatch[]	INIT(= N_("E479: No match"));
+EXTERN char e_nomatch2[]	INIT(= N_("E480: No match: %s"));
+EXTERN char e_noname[]	INIT(= N_("E32: No file name"));
+EXTERN char e_nopresub[]	INIT(= N_("E33: No previous substitute regular expression"));
+EXTERN char e_noprev[]	INIT(= N_("E34: No previous command"));
+EXTERN char e_noprevre[]	INIT(= N_("E35: No previous regular expression"));
+EXTERN char e_norange[]	INIT(= N_("E481: No range allowed"));
+EXTERN char e_noroom[]	INIT(= N_("E36: Not enough room"));
 #ifdef FEAT_CLIENTSERVER
-EXTERN char_u e_noserver[]	INIT(= N_("E247: no registered server named \"%s\""));
+EXTERN char e_noserver[]	INIT(= N_("E247: no registered server named \"%s\""));
 #endif
-EXTERN char_u e_notcreate[]	INIT(= N_("E482: Can't create file %s"));
-EXTERN char_u e_notmp[]		INIT(= N_("E483: Can't get temp file name"));
-EXTERN char_u e_notopen[]	INIT(= N_("E484: Can't open file %s"));
-EXTERN char_u e_notread[]	INIT(= N_("E485: Can't read file %s"));
-EXTERN char_u e_null[]		INIT(= N_("E38: Null argument"));
+EXTERN char e_notcreate[]	INIT(= N_("E482: Can't create file %s"));
+EXTERN char e_notmp[]		INIT(= N_("E483: Can't get temp file name"));
+EXTERN char e_notopen[]	INIT(= N_("E484: Can't open file %s"));
+EXTERN char e_notread[]	INIT(= N_("E485: Can't read file %s"));
+EXTERN char e_null[]		INIT(= N_("E38: Null argument"));
 #if defined(FEAT_DIGRAPHS) || defined(FEAT_TIMERS)
-EXTERN char_u e_number_exp[]	INIT(= N_("E39: Number expected"));
+EXTERN char e_number_exp[]	INIT(= N_("E39: Number expected"));
 #endif
 #ifdef FEAT_QUICKFIX
-EXTERN char_u e_openerrf[]	INIT(= N_("E40: Can't open errorfile %s"));
+EXTERN char e_openerrf[]	INIT(= N_("E40: Can't open errorfile %s"));
 #endif
 #if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11)
-EXTERN char_u e_opendisp[]	INIT(= N_("E233: cannot open display"));
+EXTERN char e_opendisp[]	INIT(= N_("E233: cannot open display"));
 #endif
-EXTERN char_u e_outofmem[]	INIT(= N_("E41: Out of memory!"));
+EXTERN char e_outofmem[]	INIT(= N_("E41: Out of memory!"));
 #ifdef FEAT_INS_EXPAND
-EXTERN char_u e_patnotf[]	INIT(= N_("Pattern not found"));
+EXTERN char e_patnotf[]	INIT(= N_("Pattern not found"));
 #endif
-EXTERN char_u e_patnotf2[]	INIT(= N_("E486: Pattern not found: %s"));
-EXTERN char_u e_positive[]	INIT(= N_("E487: Argument must be positive"));
+EXTERN char e_patnotf2[]	INIT(= N_("E486: Pattern not found: %s"));
+EXTERN char e_positive[]	INIT(= N_("E487: Argument must be positive"));
 #if defined(UNIX) || defined(FEAT_SESSION)
-EXTERN char_u e_prev_dir[]	INIT(= N_("E459: Cannot go back to previous directory"));
+EXTERN char e_prev_dir[]	INIT(= N_("E459: Cannot go back to previous directory"));
 #endif
 
 #ifdef FEAT_QUICKFIX
-EXTERN char_u e_quickfix[]	INIT(= N_("E42: No Errors"));
-EXTERN char_u e_loclist[]	INIT(= N_("E776: No location list"));
+EXTERN char e_quickfix[]	INIT(= N_("E42: No Errors"));
+EXTERN char e_loclist[]	INIT(= N_("E776: No location list"));
 #endif
-EXTERN char_u e_re_damg[]	INIT(= N_("E43: Damaged match string"));
-EXTERN char_u e_re_corr[]	INIT(= N_("E44: Corrupted regexp program"));
-EXTERN char_u e_readonly[]	INIT(= N_("E45: 'readonly' option is set (add ! to override)"));
+EXTERN char e_re_damg[]	INIT(= N_("E43: Damaged match string"));
+EXTERN char e_re_corr[]	INIT(= N_("E44: Corrupted regexp program"));
+EXTERN char e_readonly[]	INIT(= N_("E45: 'readonly' option is set (add ! to override)"));
 #ifdef FEAT_EVAL
-EXTERN char_u e_readonlyvar[]	INIT(= N_("E46: Cannot change read-only variable \"%s\""));
-EXTERN char_u e_readonlysbx[]	INIT(= N_("E794: Cannot set variable in the sandbox: \"%s\""));
-EXTERN char_u e_emptykey[]	INIT(= N_("E713: Cannot use empty key for Dictionary"));
-EXTERN char_u e_dictreq[]	INIT(= N_("E715: Dictionary required"));
-EXTERN char_u e_listidx[]	INIT(= N_("E684: list index out of range: %ld"));
-EXTERN char_u e_blobidx[]	INIT(= N_("E979: Blob index out of range: %ld"));
-EXTERN char_u e_invalblob[]	INIT(= N_("E978: Invalid operation for Blob"));
-EXTERN char_u e_toomanyarg[]	INIT(= N_("E118: Too many arguments for function: %s"));
-EXTERN char_u e_dictkey[]	INIT(= N_("E716: Key not present in Dictionary: %s"));
-EXTERN char_u e_listreq[]	INIT(= N_("E714: List required"));
-EXTERN char_u e_listdictarg[]	INIT(= N_("E712: Argument of %s must be a List or Dictionary"));
+EXTERN char e_readonlyvar[]	INIT(= N_("E46: Cannot change read-only variable \"%s\""));
+EXTERN char e_readonlysbx[]	INIT(= N_("E794: Cannot set variable in the sandbox: \"%s\""));
+EXTERN char e_emptykey[]	INIT(= N_("E713: Cannot use empty key for Dictionary"));
+EXTERN char e_dictreq[]	INIT(= N_("E715: Dictionary required"));
+EXTERN char e_listidx[]	INIT(= N_("E684: list index out of range: %ld"));
+EXTERN char e_blobidx[]	INIT(= N_("E979: Blob index out of range: %ld"));
+EXTERN char e_invalblob[]	INIT(= N_("E978: Invalid operation for Blob"));
+EXTERN char e_toomanyarg[]	INIT(= N_("E118: Too many arguments for function: %s"));
+EXTERN char e_dictkey[]	INIT(= N_("E716: Key not present in Dictionary: %s"));
+EXTERN char e_listreq[]	INIT(= N_("E714: List required"));
+EXTERN char e_listdictarg[]	INIT(= N_("E712: Argument of %s must be a List or Dictionary"));
 #endif
 #ifdef FEAT_QUICKFIX
-EXTERN char_u e_readerrf[]	INIT(= N_("E47: Error while reading errorfile"));
+EXTERN char e_readerrf[]	INIT(= N_("E47: Error while reading errorfile"));
 #endif
 #ifdef HAVE_SANDBOX
-EXTERN char_u e_sandbox[]	INIT(= N_("E48: Not allowed in sandbox"));
+EXTERN char e_sandbox[]	INIT(= N_("E48: Not allowed in sandbox"));
 #endif
-EXTERN char_u e_secure[]	INIT(= N_("E523: Not allowed here"));
+EXTERN char e_secure[]	INIT(= N_("E523: Not allowed here"));
 #if defined(AMIGA) || defined(MACOS_X) || defined(MSWIN)  \
 	|| defined(UNIX) || defined(VMS)
-EXTERN char_u e_screenmode[]	INIT(= N_("E359: Screen mode setting not supported"));
+EXTERN char e_screenmode[]	INIT(= N_("E359: Screen mode setting not supported"));
 #endif
-EXTERN char_u e_scroll[]	INIT(= N_("E49: Invalid scroll size"));
-EXTERN char_u e_shellempty[]	INIT(= N_("E91: 'shell' option is empty"));
+EXTERN char e_scroll[]	INIT(= N_("E49: Invalid scroll size"));
+EXTERN char e_shellempty[]	INIT(= N_("E91: 'shell' option is empty"));
 #if defined(FEAT_SIGN_ICONS) && !defined(FEAT_GUI_GTK)
-EXTERN char_u e_signdata[]	INIT(= N_("E255: Couldn't read in sign data!"));
+EXTERN char e_signdata[]	INIT(= N_("E255: Couldn't read in sign data!"));
 #endif
-EXTERN char_u e_swapclose[]	INIT(= N_("E72: Close error on swap file"));
-EXTERN char_u e_tagstack[]	INIT(= N_("E73: tag stack empty"));
-EXTERN char_u e_toocompl[]	INIT(= N_("E74: Command too complex"));
-EXTERN char_u e_longname[]	INIT(= N_("E75: Name too long"));
-EXTERN char_u e_toomsbra[]	INIT(= N_("E76: Too many ["));
-EXTERN char_u e_toomany[]	INIT(= N_("E77: Too many file names"));
-EXTERN char_u e_trailing[]	INIT(= N_("E488: Trailing characters"));
-EXTERN char_u e_umark[]		INIT(= N_("E78: Unknown mark"));
-EXTERN char_u e_wildexpand[]	INIT(= N_("E79: Cannot expand wildcards"));
-EXTERN char_u e_winheight[]	INIT(= N_("E591: 'winheight' cannot be smaller than 'winminheight'"));
-EXTERN char_u e_winwidth[]	INIT(= N_("E592: 'winwidth' cannot be smaller than 'winminwidth'"));
-EXTERN char_u e_write[]		INIT(= N_("E80: Error while writing"));
-EXTERN char_u e_zerocount[]	INIT(= N_("E939: Positive count required"));
+EXTERN char e_swapclose[]	INIT(= N_("E72: Close error on swap file"));
+EXTERN char e_tagstack[]	INIT(= N_("E73: tag stack empty"));
+EXTERN char e_toocompl[]	INIT(= N_("E74: Command too complex"));
+EXTERN char e_longname[]	INIT(= N_("E75: Name too long"));
+EXTERN char e_toomsbra[]	INIT(= N_("E76: Too many ["));
+EXTERN char e_toomany[]	INIT(= N_("E77: Too many file names"));
+EXTERN char e_trailing[]	INIT(= N_("E488: Trailing characters"));
+EXTERN char e_umark[]		INIT(= N_("E78: Unknown mark"));
+EXTERN char e_wildexpand[]	INIT(= N_("E79: Cannot expand wildcards"));
+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_write[]		INIT(= N_("E80: Error while writing"));
+EXTERN char e_zerocount[]	INIT(= N_("E939: Positive count required"));
 #ifdef FEAT_EVAL
-EXTERN char_u e_usingsid[]	INIT(= N_("E81: Using <SID> not in a script context"));
+EXTERN char e_usingsid[]	INIT(= N_("E81: Using <SID> not in a script context"));
 #endif
 #ifdef FEAT_CLIENTSERVER
-EXTERN char_u e_invexprmsg[]	INIT(= N_("E449: Invalid expression received"));
+EXTERN char e_invexprmsg[]	INIT(= N_("E449: Invalid expression received"));
 #endif
 #ifdef FEAT_NETBEANS_INTG
-EXTERN char_u e_guarded[]	INIT(= N_("E463: Region is guarded, cannot modify"));
-EXTERN char_u e_nbreadonly[]	INIT(= N_("E744: NetBeans does not allow changes in read-only files"));
+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_u e_maxmempat[]	INIT(= N_("E363: pattern uses more memory than 'maxmempattern'"));
-EXTERN char_u e_emptybuf[]	INIT(= N_("E749: empty buffer"));
-EXTERN char_u e_nobufnr[]	INIT(= N_("E86: Buffer %ld does not exist"));
+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_nobufnr[]	INIT(= N_("E86: Buffer %ld does not exist"));
 
-EXTERN char_u e_invalpat[]	INIT(= N_("E682: Invalid search pattern or delimiter"));
-EXTERN char_u e_bufloaded[]	INIT(= N_("E139: File is loaded in another buffer"));
+EXTERN char e_invalpat[]	INIT(= N_("E682: Invalid search pattern or delimiter"));
+EXTERN char e_bufloaded[]	INIT(= N_("E139: File is loaded in another buffer"));
 #if defined(FEAT_SYN_HL) || \
 	(defined(FEAT_INS_EXPAND) && defined(FEAT_COMPL_FUNC))
-EXTERN char_u e_notset[]	INIT(= N_("E764: Option '%s' is not set"));
+EXTERN char e_notset[]	INIT(= N_("E764: Option '%s' is not set"));
 #endif
 #ifndef FEAT_CLIPBOARD
-EXTERN char_u e_invalidreg[]    INIT(= N_("E850: Invalid register name"));
+EXTERN char e_invalidreg[]    INIT(= N_("E850: Invalid register name"));
 #endif
-EXTERN char_u e_dirnotf[]	INIT(= N_("E919: Directory not found in '%s': \"%s\""));
-EXTERN char_u e_au_recursive[]	INIT(= N_("E952: Autocommand caused recursive behavior"));
+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"));
 #ifdef FEAT_MENU
-EXTERN char_u e_menuothermode[] INIT(= N_("E328: Menu only exists in another mode"));
+EXTERN char e_menuothermode[] INIT(= N_("E328: Menu only exists in another mode"));
 #endif
 
 #ifdef FEAT_GUI_MAC
--- a/src/gui.c
+++ b/src/gui.c
@@ -215,7 +215,7 @@ gui_do_fork(void)
     pid = fork();
     if (pid < 0)	    /* Fork error */
     {
-	EMSG(_("E851: Failed to create a new process for the GUI"));
+	emsg(_("E851: Failed to create a new process for the GUI"));
 	return;
     }
     else if (pid > 0)	    /* Parent */
@@ -239,7 +239,7 @@ gui_do_fork(void)
 # else
 		waitpid(pid, &exit_status, 0);
 # endif
-		EMSG(_("E852: The child process failed to start the GUI"));
+		emsg(_("E852: The child process failed to start the GUI"));
 		return;
 	    }
 	    else if (status == GUI_CHILD_IO_ERROR)
@@ -362,7 +362,7 @@ gui_init_check(void)
     if (result != MAYBE)
     {
 	if (result == FAIL)
-	    EMSG(_("E229: Cannot start the GUI"));
+	    emsg(_("E229: Cannot start the GUI"));
 	return result;
     }
 
@@ -515,7 +515,7 @@ gui_init(void)
 	    if (STRCMP(use_gvimrc, "NONE") != 0
 		    && STRCMP(use_gvimrc, "NORC") != 0
 		    && do_source(use_gvimrc, FALSE, DOSO_NONE) != OK)
-		EMSG2(_("E230: Cannot read from \"%s\""), use_gvimrc);
+		semsg(_("E230: Cannot read from \"%s\""), use_gvimrc);
 	}
 	else
 	{
@@ -649,12 +649,12 @@ gui_init(void)
 	    gui_init_font(*p_guifont == NUL ? hl_get_font_name()
 						  : p_guifont, FALSE) == FAIL)
     {
-	EMSG(_("E665: Cannot start GUI, no valid font found"));
+	emsg(_("E665: Cannot start GUI, no valid font found"));
 	goto error2;
     }
 #ifdef FEAT_MBYTE
     if (gui_get_wide_font() == FAIL)
-	EMSG(_("E231: 'guifontwide' invalid"));
+	emsg(_("E231: 'guifontwide' invalid"));
 #endif
 
     gui.num_cols = Columns;
@@ -769,7 +769,7 @@ gui_init(void)
 
 #if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
 	if (!im_xim_isvalid_imactivate())
-	    EMSG(_("E599: Value of 'imactivatekey' is invalid"));
+	    emsg(_("E599: Value of 'imactivatekey' is invalid"));
 #endif
 	/* When 'cmdheight' was set during startup it may not have taken
 	 * effect yet. */
@@ -4785,7 +4785,7 @@ gui_get_color(char_u *name)
 	    && gui.in_use
 #endif
 	    )
-	EMSG2(_("E254: Cannot allocate color %s"), name);
+	semsg(_("E254: Cannot allocate color %s"), name);
     return t;
 }
 
--- a/src/gui_at_fs.c
+++ b/src/gui_at_fs.c
@@ -1063,7 +1063,7 @@ SFinitFont(void)
 #endif
 	if (!SFfont)
 	{
-	    EMSG2(_("E616: vim_SelFile: can't get font %s"), SF_DEFAULT_FONT);
+	    semsg(_("E616: vim_SelFile: can't get font %s"), SF_DEFAULT_FONT);
 	    SFstatus = SEL_FILE_CANCEL;
 	    return;
 	}
@@ -2629,7 +2629,7 @@ SFprepareToReturn(void)
     XtRemoveTimeOut(SFdirModTimerId);
     if (SFchdir(SFstartDir))
     {
-	EMSG(_("E614: vim_SelFile: can't return to current directory"));
+	emsg(_("E614: vim_SelFile: can't return to current directory"));
 	SFstatus = SEL_FILE_CANCEL;
     }
 }
@@ -2658,7 +2658,7 @@ vim_SelFile(
 
     if (mch_dirname((char_u *)SFstartDir, MAXPATHL) == FAIL)
     {
-	EMSG(_("E615: vim_SelFile: can't get current directory"));
+	emsg(_("E615: vim_SelFile: can't get current directory"));
 	return NULL;
     }
 
--- a/src/gui_at_sb.c
+++ b/src/gui_at_sb.c
@@ -485,7 +485,7 @@ CreateGC(Widget w)
 
 	if (XGetGeometry (XtDisplay(w), sbw->scrollbar.thumb, &root, &x, &y,
 		&width, &height, &bw, &depth) == 0)
-	    EMSG(_("Scrollbar Widget: Could not get geometry of thumb pixmap."));
+	    emsg(_("Scrollbar Widget: Could not get geometry of thumb pixmap."));
     }
 
     gcValues.foreground = sbw->scrollbar.foreground;
--- a/src/gui_beval.c
+++ b/src/gui_beval.c
@@ -103,7 +103,7 @@ gui_mch_create_beval_area(
 
     if (mesg != NULL && mesgCB != NULL)
     {
-	IEMSG(_("E232: Cannot create BalloonEval with both message and callback"));
+	iemsg(_("E232: Cannot create BalloonEval with both message and callback"));
 	return NULL;
     }
 
--- a/src/gui_gtk_x11.c
+++ b/src/gui_gtk_x11.c
@@ -1664,7 +1664,7 @@ gui_mch_early_init_check(int give_messag
     {
 	gui.dying = TRUE;
 	if (give_message)
-	    EMSG(_((char *)e_opendisp));
+	    emsg(_((char *)e_opendisp));
 	return FAIL;
     }
     return OK;
@@ -1710,7 +1710,7 @@ gui_mch_init_check(void)
     if (!gtk_init_check(&gui_argc, &gui_argv))
     {
 	gui.dying = TRUE;
-	EMSG(_((char *)e_opendisp));
+	emsg(_((char *)e_opendisp));
 	return FAIL;
     }
 
@@ -5247,7 +5247,7 @@ gui_mch_get_font(char_u *name, int repor
     if (font == NULL)
     {
 	if (report_error)
-	    EMSG2(_((char *)e_font), name);
+	    semsg(_((char *)e_font), name);
 	return NULL;
     }
 
@@ -7138,7 +7138,7 @@ gui_mch_register_sign(char_u *signfile)
 	{
 	    /* The error message is already translated and will be more
 	     * descriptive than anything we could possibly do ourselves. */
-	    EMSG2("E255: %s", message);
+	    semsg("E255: %s", message);
 
 	    if (input_conv.vc_type != CONV_NONE)
 		vim_free(message);
--- a/src/gui_mac.c
+++ b/src/gui_mac.c
@@ -3556,7 +3556,7 @@ gui_mch_get_font(char_u *name, int giveE
     if (font == NOFONT)
     {
 	if (giveErrorIfMissing)
-	    EMSG2(_(e_font), name);
+	    semsg(_(e_font), name);
 	return NOFONT;
     }
     /*
--- a/src/gui_photon.c
+++ b/src/gui_photon.c
@@ -2937,7 +2937,7 @@ gui_mch_get_font(char_u *vim_font_name, 
     }
 
     if (report_error)
-	EMSG2(e_font, vim_font_name);
+	semsg(e_font, vim_font_name);
 
     return FAIL;
 }
--- a/src/gui_w32.c
+++ b/src/gui_w32.c
@@ -1582,7 +1582,7 @@ gui_mch_get_font(
     if (get_logfont(&lf, name, NULL, giveErrorIfMissing) == OK)
 	font = get_font_handle(&lf);
     if (font == NOFONT && giveErrorIfMissing)
-	EMSG2(_(e_font), name);
+	semsg(_(e_font), name);
     return font;
 }
 
@@ -5235,7 +5235,7 @@ gui_mch_set_parent(char *title)
     EnumWindows(FindWindowTitle, (LPARAM)title);
     if (vim_parent_hwnd == NULL)
     {
-	EMSG2(_("E671: Cannot find window title \"%s\""), title);
+	semsg(_("E671: Cannot find window title \"%s\""), title);
 	mch_exit(2);
     }
 }
@@ -5246,7 +5246,7 @@ ole_error(char *arg)
 {
     char buf[IOSIZE];
 
-    /* Can't use EMSG() here, we have not finished initialisation yet. */
+    /* Can't use emsg() here, we have not finished initialisation yet. */
     vim_snprintf(buf, IOSIZE,
 	    _("E243: Argument not supported: \"-%s\"; Use the OLE version."),
 	    arg);
@@ -5468,7 +5468,7 @@ gui_mch_init(void)
 #endif
 	if (s_hwnd == NULL)
 	{
-	    EMSG(_("E672: Unable to open window inside MDI application"));
+	    emsg(_("E672: Unable to open window inside MDI application"));
 	    mch_exit(2);
 	}
     }
@@ -8671,7 +8671,7 @@ gui_mch_register_sign(char_u *signfile)
     {
 	if (sign.hImage)
 	    close_signicon_image(&sign);
-	EMSG(_(e_signdata));
+	emsg(_(e_signdata));
     }
     return (void *)psign;
 
@@ -9025,7 +9025,7 @@ gui_mch_create_beval_area(
 
     if (mesg != NULL && mesgCB != NULL)
     {
-	IEMSG(_("E232: Cannot create BalloonEval with both message and callback"));
+	iemsg(_("E232: Cannot create BalloonEval with both message and callback"));
 	return NULL;
     }
 
--- a/src/gui_x11.c
+++ b/src/gui_x11.c
@@ -1295,7 +1295,7 @@ gui_mch_init_check(void)
     if (app_context == NULL || gui.dpy == NULL)
     {
 	gui.dying = TRUE;
-	EMSG(_(e_opendisp));
+	emsg(_(e_opendisp));
 	return FAIL;
     }
     return OK;
@@ -1541,7 +1541,7 @@ gui_mch_init(void)
     }
 
     if (gui.color_approx)
-	EMSG(_("Vim E458: Cannot allocate colormap entry, some colors may be incorrect"));
+	emsg(_("Vim E458: Cannot allocate colormap entry, some colors may be incorrect"));
 
 #ifdef FEAT_SUN_WORKSHOP
     if (usingSunWorkShop)
@@ -1970,7 +1970,7 @@ gui_mch_get_font(char_u *name, int giveE
     if (font == NULL)
     {
 	if (giveErrorIfMissing)
-	    EMSG2(_(e_font), name);
+	    semsg(_(e_font), name);
 	return NOFONT;
     }
 
@@ -1994,7 +1994,7 @@ gui_mch_get_font(char_u *name, int giveE
 
     if (font->max_bounds.width != font->min_bounds.width)
     {
-	EMSG2(_(e_fontwidth), name);
+	semsg(_(e_fontwidth), name);
 	XFreeFont(gui.dpy, font);
 	return NOFONT;
     }
@@ -2145,9 +2145,9 @@ gui_mch_get_fontset(
 
 	if (giveErrorIfMissing)
 	{
-	    EMSG2(_("E250: Fonts for the following charsets are missing in fontset %s:"), name);
+	    semsg(_("E250: Fonts for the following charsets are missing in fontset %s:"), name);
 	    for (i = 0; i < num_missing; i++)
-		EMSG2("%s", missing[i]);
+		semsg("%s", missing[i]);
 	}
 	XFreeStringList(missing);
     }
@@ -2155,7 +2155,7 @@ gui_mch_get_fontset(
     if (fontset == NULL)
     {
 	if (giveErrorIfMissing)
-	    EMSG2(_(e_fontset), name);
+	    semsg(_(e_fontset), name);
 	return NOFONTSET;
     }
 
@@ -2187,8 +2187,8 @@ check_fontset_sanity(XFontSet fs)
     {
 	if (xfs[i]->max_bounds.width != xfs[i]->min_bounds.width)
 	{
-	    EMSG2(_("E252: Fontset name: %s"), base_name);
-	    EMSG2(_("Font '%s' is not fixed-width"), font_name[i]);
+	    semsg(_("E252: Fontset name: %s"), base_name);
+	    semsg(_("Font '%s' is not fixed-width"), font_name[i]);
 	    return FAIL;
 	}
     }
@@ -2207,12 +2207,12 @@ check_fontset_sanity(XFontSet fs)
 	if (	   xfs[i]->max_bounds.width != 2 * min_width
 		&& xfs[i]->max_bounds.width != min_width)
 	{
-	    EMSG2(_("E253: Fontset name: %s"), base_name);
-	    EMSG2(_("Font0: %s"), font_name[min_font_idx]);
-	    EMSG2(_("Font1: %s"), font_name[i]);
-	    EMSGN(_("Font%ld width is not twice that of font0"), i);
-	    EMSGN(_("Font0 width: %ld"), xfs[min_font_idx]->max_bounds.width);
-	    EMSGN(_("Font1 width: %ld"), xfs[i]->max_bounds.width);
+	    semsg(_("E253: Fontset name: %s"), base_name);
+	    semsg(_("Font0: %s"), font_name[min_font_idx]);
+	    semsg(_("Font1: %s"), font_name[i]);
+	    semsg(_("Font%ld width is not twice that of font0"), i);
+	    semsg(_("Font0 width: %ld"), xfs[min_font_idx]->max_bounds.width);
+	    semsg(_("Font1 width: %ld"), xfs[i]->max_bounds.width);
 	    return FAIL;
 	}
     }
@@ -3326,7 +3326,7 @@ gui_mch_register_sign(char_u *signfile)
 		gui.sign_width = sign->width + 8; */
 	}
 	else
-	    EMSG(_(e_signdata));
+	    emsg(_(e_signdata));
     }
 
     return (void *)sign;
--- a/src/hangulin.c
+++ b/src/hangulin.c
@@ -588,7 +588,7 @@ hangul_automata2(char_u *buf, int_u *c)
 	    return AUTOMATA_CORRECT_NEW;
 
 	default:
-	    IEMSG(_("E256: Hangul automata ERROR"));
+	    iemsg(_("E256: Hangul automata ERROR"));
 	    break;
     }
     return AUTOMATA_ERROR; /* RrEeAaLlLlYy EeRrRrOoRr */
--- a/src/hardcopy.c
+++ b/src/hardcopy.c
@@ -135,7 +135,7 @@ typedef struct
     int		ff;		    /* seen form feed character */
 } prt_pos_T;
 
-static char_u *parse_list_options(char_u *option_str, option_table_T *table, int table_size);
+static char *parse_list_options(char_u *option_str, option_table_T *table, int table_size);
 
 static colnr_T hardcopy_line(prt_settings_T *psettings, int page_line, prt_pos_T *ppos);
 
@@ -143,7 +143,7 @@ static colnr_T hardcopy_line(prt_setting
  * Parse 'printoptions' and set the flags in "printer_opts".
  * Returns an error message or NULL;
  */
-    char_u *
+    char *
 parse_printoptions(void)
 {
     return parse_list_options(p_popt, printer_opts, OPT_PRINT_NUM_OPTIONS);
@@ -154,7 +154,7 @@ parse_printoptions(void)
  * Parse 'printmbfont' and set the flags in "mbfont_opts".
  * Returns an error message or NULL;
  */
-    char_u *
+    char *
 parse_printmbfont(void)
 {
     return parse_list_options(p_pmfn, mbfont_opts, OPT_MBFONT_NUM_OPTIONS);
@@ -170,14 +170,14 @@ parse_printmbfont(void)
  * Returns an error message for an illegal option, NULL otherwise.
  * Only used for the printer at the moment...
  */
-    static char_u *
+    static char *
 parse_list_options(
     char_u		*option_str,
     option_table_T	*table,
     int			table_size)
 {
     option_table_T *old_opts;
-    char_u	*ret = NULL;
+    char	*ret = NULL;
     char_u	*stringp;
     char_u	*colonp;
     char_u	*commap;
@@ -205,7 +205,7 @@ parse_list_options(
 	colonp = vim_strchr(stringp, ':');
 	if (colonp == NULL)
 	{
-	    ret = (char_u *)N_("E550: Missing colon");
+	    ret = N_("E550: Missing colon");
 	    break;
 	}
 	commap = vim_strchr(stringp, ',');
@@ -220,7 +220,7 @@ parse_list_options(
 
 	if (idx == table_size)
 	{
-	    ret = (char_u *)N_("E551: Illegal component");
+	    ret = N_("E551: Illegal component");
 	    break;
 	}
 	p = colonp + 1;
@@ -230,7 +230,7 @@ parse_list_options(
 	{
 	    if (!VIM_ISDIGIT(*p))
 	    {
-		ret = (char_u *)N_("E552: digit expected");
+		ret = N_("E552: digit expected");
 		break;
 	    }
 
@@ -576,13 +576,13 @@ ex_hardcopy(exarg_T *eap)
 # ifdef FEAT_POSTSCRIPT
     if (*eap->arg == '>')
     {
-	char_u	*errormsg = NULL;
+	char	*errormsg = NULL;
 
 	/* Expand things like "%.ps". */
 	if (expand_filename(eap, eap->cmdlinep, &errormsg) == FAIL)
 	{
 	    if (errormsg != NULL)
-		EMSG(errormsg);
+		emsg(errormsg);
 	    return;
 	}
 	settings.outfile = skipwhite(eap->arg + 1);
@@ -1431,7 +1431,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(_("E455: Error writing to PostScript output file"));
 	prt_file_error = TRUE;
     }
 }
@@ -1873,7 +1873,7 @@ prt_open_resource(struct prt_ps_resource
     fd_resource = mch_fopen((char *)resource->filename, READBIN);
     if (fd_resource == NULL)
     {
-	EMSG2(_("E624: Can't open file \"%s\""), resource->filename);
+	semsg(_("E624: Can't open file \"%s\""), resource->filename);
 	return FALSE;
     }
     vim_memset(prt_resfile.buffer, NUL, PRT_FILE_BUFFER_LEN);
@@ -1883,7 +1883,7 @@ prt_open_resource(struct prt_ps_resource
 					    PRT_FILE_BUFFER_LEN, fd_resource);
     if (ferror(fd_resource))
     {
-	EMSG2(_("E457: Can't read PostScript resource file \"%s\""),
+	semsg(_("E457: Can't read PostScript resource file \"%s\""),
 		resource->filename);
 	fclose(fd_resource);
 	return FALSE;
@@ -1900,7 +1900,7 @@ prt_open_resource(struct prt_ps_resource
     if (prt_resfile_strncmp(offset, PRT_RESOURCE_HEADER,
 				       (int)STRLEN(PRT_RESOURCE_HEADER)) != 0)
     {
-	EMSG2(_("E618: file \"%s\" is not a PostScript resource file"),
+	semsg(_("E618: file \"%s\" is not a PostScript resource file"),
 		resource->filename);
 	return FALSE;
     }
@@ -1917,7 +1917,7 @@ prt_open_resource(struct prt_ps_resource
     if (prt_resfile_strncmp(offset, PRT_RESOURCE_RESOURCE,
 				     (int)STRLEN(PRT_RESOURCE_RESOURCE)) != 0)
     {
-	EMSG2(_("E619: file \"%s\" is not a supported PostScript resource file"),
+	semsg(_("E619: file \"%s\" is not a supported PostScript resource file"),
 		resource->filename);
 	return FALSE;
     }
@@ -1935,7 +1935,7 @@ prt_open_resource(struct prt_ps_resource
 	resource->type = PRT_RESOURCE_TYPE_CMAP;
     else
     {
-	EMSG2(_("E619: file \"%s\" is not a supported PostScript resource file"),
+	semsg(_("E619: file \"%s\" is not a supported PostScript resource file"),
 		resource->filename);
 	return FALSE;
     }
@@ -1977,7 +1977,7 @@ prt_open_resource(struct prt_ps_resource
 
     if (!seen_title || !seen_version)
     {
-	EMSG2(_("E619: file \"%s\" is not a supported PostScript resource file"),
+	semsg(_("E619: file \"%s\" is not a supported PostScript resource file"),
 		resource->filename);
 	return FALSE;
     }
@@ -1991,7 +1991,7 @@ prt_check_resource(struct prt_ps_resourc
     /* Version number m.n should match, the revision number does not matter */
     if (STRNCMP(resource->version, version, STRLEN(version)))
     {
-	EMSG2(_("E621: \"%s\" resource file has wrong version"),
+	semsg(_("E621: \"%s\" resource file has wrong version"),
 		resource->name);
 	return FALSE;
     }
@@ -2465,7 +2465,7 @@ mch_print_init(
 	    /* Check encoding and character set are compatible */
 	    if ((p_mbenc->needs_charset & p_mbchar->has_charset) == 0)
 	    {
-		EMSG(_("E673: Incompatible multi-byte encoding and character set."));
+		emsg(_("E673: Incompatible multi-byte encoding and character set."));
 		return FALSE;
 	    }
 
@@ -2482,7 +2482,7 @@ mch_print_init(
 	    /* Add custom CMap character set name */
 	    if (*p_pmcs == NUL)
 	    {
-		EMSG(_("E674: printmbcharset cannot be empty with multi-byte encoding."));
+		emsg(_("E674: printmbcharset cannot be empty with multi-byte encoding."));
 		return FALSE;
 	    }
 	    vim_strncpy((char_u *)prt_cmap, p_pmcs, sizeof(prt_cmap) - 3);
@@ -2500,7 +2500,7 @@ mch_print_init(
 
 	if (!mbfont_opts[OPT_MBFONT_REGULAR].present)
 	{
-	    EMSG(_("E675: No default font specified for multi-byte printing."));
+	    emsg(_("E675: No default font specified for multi-byte printing."));
 	    return FALSE;
 	}
 
@@ -2677,7 +2677,7 @@ mch_print_init(
 	prt_ps_file_name = vim_tempname('p', TRUE);
 	if (prt_ps_file_name == NULL)
 	{
-	    EMSG(_(e_notmp));
+	    emsg(_(e_notmp));
 	    return FAIL;
 	}
 	prt_ps_fd = mch_fopen((char *)prt_ps_file_name, WRITEBIN);
@@ -2693,7 +2693,7 @@ mch_print_init(
     }
     if (prt_ps_fd == NULL)
     {
-	EMSG(_("E324: Can't open PostScript output file"));
+	emsg(_("E324: Can't open PostScript output file"));
 	mch_print_cleanup();
 	return FAIL;
     }
@@ -2729,7 +2729,7 @@ prt_add_resource(struct prt_ps_resource_
     fd_resource = mch_fopen((char *)resource->filename, READBIN);
     if (fd_resource == NULL)
     {
-	EMSG2(_("E456: Can't open file \"%s\""), resource->filename);
+	semsg(_("E456: Can't open file \"%s\""), resource->filename);
 	return FALSE;
     }
     prt_dsc_resources("BeginResource", prt_resource_types[resource->type],
@@ -2743,7 +2743,7 @@ prt_add_resource(struct prt_ps_resource_
 			   sizeof(resource_buffer), fd_resource);
 	if (ferror(fd_resource))
 	{
-	    EMSG2(_("E457: Can't read PostScript resource file \"%s\""),
+	    semsg(_("E457: Can't read PostScript resource file \"%s\""),
 							    resource->filename);
 	    fclose(fd_resource);
 	    return FALSE;
@@ -2880,7 +2880,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\""));
+	emsg(_("E456: Can't find PostScript resource file \"prolog.ps\""));
 	goto theend;
     }
     if (!prt_open_resource(res_prolog))
@@ -2893,7 +2893,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\""));
+	    emsg(_("E456: Can't find PostScript resource file \"cidfont.ps\""));
 	    goto theend;
 	}
 	if (!prt_open_resource(res_cidfont))
@@ -2931,7 +2931,7 @@ mch_print_begin(prt_settings_T *psetting
 		p_encoding = (char_u *)"latin1";
 		if (!prt_find_resource((char *)p_encoding, res_encoding))
 		{
-		    EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""),
+		    semsg(_("E456: Can't find PostScript resource file \"%s.ps\""),
 			    p_encoding);
 		    goto theend;
 		}
@@ -2953,7 +2953,7 @@ mch_print_begin(prt_settings_T *psetting
 	    /* Include ASCII range encoding vector */
 	    if (!prt_find_resource(prt_ascii_encoding, res_encoding))
 	    {
-		EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""),
+		semsg(_("E456: Can't find PostScript resource file \"%s.ps\""),
 							  prt_ascii_encoding);
 		goto theend;
 	    }
@@ -2969,7 +2969,7 @@ mch_print_begin(prt_settings_T *psetting
 	/* Set up encoding conversion if required */
 	if (FAIL == convert_setup(&prt_conv, p_enc, p_encoding))
 	{
-	    EMSG2(_("E620: Unable to convert to print encoding \"%s\""),
+	    semsg(_("E620: Unable to convert to print encoding \"%s\""),
 		    p_encoding);
 	    goto theend;
 	}
@@ -2982,7 +2982,7 @@ mch_print_begin(prt_settings_T *psetting
 	/* Find user supplied CMap */
 	if (!prt_find_resource(prt_cmap, res_cmap))
 	{
-	    EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""),
+	    semsg(_("E456: Can't find PostScript resource file \"%s.ps\""),
 								    prt_cmap);
 	    goto theend;
 	}
@@ -3236,7 +3236,7 @@ mch_print_end(prt_settings_T *psettings)
 
 	/* Not printing to a file: use 'printexpr' to print the file. */
 	if (eval_printexpr(prt_ps_file_name, psettings->arguments) == FAIL)
-	    EMSG(_("E365: Failed to print PostScript file"));
+	    emsg(_("E365: Failed to print PostScript file"));
 	else
 	    prt_message((char_u *)_("Print job sent."));
     }
--- a/src/hashtab.c
+++ b/src/hashtab.c
@@ -334,9 +334,9 @@ hash_may_resize(
 
 #ifdef HT_DEBUG
     if (ht->ht_used > ht->ht_filled)
-	EMSG("hash_may_resize(): more used than filled");
+	emsg("hash_may_resize(): more used than filled");
     if (ht->ht_filled >= ht->ht_mask + 1)
-	EMSG("hash_may_resize(): table completely filled");
+	emsg("hash_may_resize(): table completely filled");
 #endif
 
     if (minitems == 0)
--- a/src/if_cscope.c
+++ b/src/if_cscope.c
@@ -76,7 +76,7 @@ static cscmd_T	    cs_cmds[] =
     static void
 cs_usage_msg(csid_e x)
 {
-    (void)EMSG2(_("E560: Usage: cs[cope] %s"), cs_cmds[(int)x].usage);
+    (void)semsg(_("E560: Usage: cs[cope] %s"), cs_cmds[(int)x].usage);
 }
 
 #if defined(FEAT_CMDL_COMPL) || defined(PROTO)
@@ -254,7 +254,7 @@ ex_cstag(exarg_T *eap)
 
     if (*eap->arg == NUL)
     {
-	(void)EMSG(_("E562: Usage: cstag <ident>"));
+	(void)emsg(_("E562: Usage: cstag <ident>"));
 	return;
     }
 
@@ -312,7 +312,7 @@ ex_cstag(exarg_T *eap)
 
     if (!ret)
     {
-	(void)EMSG(_("E257: cstag: tag not found"));
+	(void)emsg(_("E257: cstag: tag not found"));
 #if defined(FEAT_QUICKFIX)
 	g_do_tagpreview = 0;
 #endif
@@ -471,11 +471,11 @@ cs_stat_emsg(char *fname)
     if (buf != NULL)
     {
 	(void)sprintf(buf, stat_emsg, fname, errno);
-	(void)EMSG(buf);
+	(void)emsg(buf);
 	vim_free(buf);
     }
     else
-	(void)EMSG(_("E563: stat error"));
+	(void)emsg(_("E563: stat error"));
 }
 
 
@@ -579,7 +579,7 @@ staterr:
     else
     {
 	if (p_csverbose)
-	    (void)EMSG2(
+	    (void)semsg(
 		_("E564: %s is not a directory or a valid cscope database"),
 		fname);
 	goto add_err;
@@ -598,7 +598,7 @@ staterr:
 	{
 	    msg_clr_eos();
 	    (void)smsg_attr(HL_ATTR(HLF_R),
-			    (char_u *)_("Added cscope database %s"),
+			    _("Added cscope database %s"),
 			    csinfo[i].fname);
 	}
     }
@@ -651,7 +651,7 @@ cs_cnt_connections(void)
 cs_reading_emsg(
     int idx)	/* connection index */
 {
-    EMSGN(_("E262: error reading cscope connection %ld"), idx);
+    semsg(_("E262: error reading cscope connection %ld"), idx);
 }
 
 #define	CSREAD_BUFSIZE	2048
@@ -757,7 +757,7 @@ cs_create_cmd(char *csoption, char *patt
 	search = 9;
 	break;
     default :
-	(void)EMSG(_("E561: unknown cscope search type"));
+	(void)emsg(_("E561: unknown cscope search type"));
 	cs_usage_msg(Find);
 	return NULL;
     }
@@ -814,7 +814,7 @@ cs_create_connection(int i)
     to_cs[0] = to_cs[1] = from_cs[0] = from_cs[1] = -1;
     if (pipe(to_cs) < 0 || pipe(from_cs) < 0)
     {
-	(void)EMSG(_("E566: Could not create cscope pipes"));
+	(void)emsg(_("E566: Could not create cscope pipes"));
 err_closing:
 	if (to_cs[0] != -1)
 	    (void)close(to_cs[0]);
@@ -830,7 +830,7 @@ err_closing:
     switch (csinfo[i].pid = fork())
     {
     case -1:
-	(void)EMSG(_("E622: Could not fork for cscope"));
+	(void)emsg(_("E622: Could not fork for cscope"));
 	goto err_closing;
     case 0:				/* child: run cscope. */
 	if (dup2(to_cs[0], STDIN_FILENO) == -1)
@@ -853,7 +853,7 @@ err_closing:
 	if (!(pipe_stdin = CreatePipe(&stdin_rd, &stdin_wr, &sa, 0))
 		|| !(pipe_stdout = CreatePipe(&stdout_rd, &stdout_wr, &sa, 0)))
 	{
-	    (void)EMSG(_("E566: Could not create cscope pipes"));
+	    (void)emsg(_("E566: Could not create cscope pipes"));
 err_closing:
 	    if (pipe_stdin)
 	    {
@@ -987,7 +987,7 @@ err_closing:
     if (!created)
     {
 	PERROR(_("cs_create_connection exec failed"));
-	(void)EMSG(_("E623: Could not spawn cscope process"));
+	(void)emsg(_("E623: Could not spawn cscope process"));
 	goto err_closing;
     }
     /* else */
@@ -1029,7 +1029,7 @@ cs_find(exarg_T *eap)
 
     if (cs_check_for_connections() == FALSE)
     {
-	(void)EMSG(_("E567: no cscope connections"));
+	(void)emsg(_("E567: no cscope connections"));
 	return FALSE;
     }
 
@@ -1127,7 +1127,7 @@ cs_find_common(
 	    if (buf != NULL)
 	    {
 		sprintf(buf, nf, *qfpos, *(qfpos-1));
-		(void)EMSG(buf);
+		(void)emsg(buf);
 		vim_free(buf);
 	    }
 	    return FALSE;
@@ -1194,11 +1194,11 @@ cs_find_common(
 
 	buf = (char *)alloc((unsigned)(strlen(opt) + strlen(pat) + strlen(nf)));
 	if (buf == NULL)
-	    (void)EMSG(nf);
+	    (void)emsg(nf);
 	else
 	{
 	    sprintf(buf, nf, opt, pat);
-	    (void)EMSG(buf);
+	    (void)emsg(buf);
 	    vim_free(buf);
 	}
 	vim_free(nummatches);
@@ -1216,7 +1216,7 @@ cs_find_common(
 
 	f = mch_fopen((char *)tmp, "w");
 	if (f == NULL)
-	    EMSG2(_(e_notopen), tmp);
+	    semsg(_(e_notopen), tmp);
 	else
 	{
 	    cs_file_results(f, nummatches);
@@ -1289,7 +1289,7 @@ cs_help(exarg_T *eap UNUSED)
 	/* Use %*s rather than %30s to ensure proper alignment in utf-8 */
 	if (space_cnt < 0)
 	    space_cnt = 0;
-	(void)smsg((char_u *)_("%-5s: %s%*s (Usage: %s)"),
+	(void)smsg(_("%-5s: %s%*s (Usage: %s)"),
 				      cmdp->name,
 				      help, space_cnt, " ",
 				      cmdp->usage);
@@ -1378,18 +1378,18 @@ cs_insert_filelist(
 
 		if (winmsg != NULL)
 		{
-		    (void)EMSG2(cant_msg, winmsg);
+		    (void)semsg(cant_msg, winmsg);
 		    LocalFree(winmsg);
 		}
 		else
 		    /* subst filename if can't get error text */
-		    (void)EMSG2(cant_msg, fname);
+		    (void)semsg(cant_msg, fname);
 	    }
 	    return -1;
 
 	case FILEINFO_INFO_FAIL:    /* GetFileInformationByHandle() failed */
 	    if (p_csverbose)
-		(void)EMSG(_("E626: cannot get cscope database information"));
+		(void)emsg(_("E626: cannot get cscope database information"));
 	    return -1;
     }
 #endif
@@ -1412,7 +1412,7 @@ cs_insert_filelist(
 	    )
 	{
 	    if (p_csverbose)
-		(void)EMSG(_("E568: duplicate cscope database not added"));
+		(void)emsg(_("E568: duplicate cscope database not added"));
 	    return -1;
 	}
 
@@ -1555,7 +1555,7 @@ cs_kill(exarg_T *eap UNUSED)
     if ((i != -1) && (i >= csinfo_size || i < -1 || csinfo[i].fname == NULL))
     {
 	if (p_csverbose)
-	    (void)EMSG2(_("E261: cscope connection %s not found"), stok);
+	    (void)semsg(_("E261: cscope connection %s not found"), stok);
     }
     else
     {
@@ -1587,7 +1587,7 @@ cs_kill_execute(
     {
 	msg_clr_eos();
 	(void)smsg_attr(HL_ATTR(HLF_R) | MSG_HIST,
-		(char_u *)_("cscope connection %s closed"), cname);
+			_("cscope connection %s closed"), cname);
     }
     cs_release_csp(i, TRUE);
 }
@@ -1723,7 +1723,7 @@ cs_manage_matches(
 	cs_print_tags_priv(mp, cp, cnt);
 	break;
     default:	/* should not reach here */
-	IEMSG(_("E570: fatal error in cs_manage_matches"));
+	iemsg(_("E570: fatal error in cs_manage_matches"));
 	return NULL;
     }
 
@@ -2141,7 +2141,7 @@ cs_read_prompt(int i)
 			buf[bufpos - epromptlen] = NUL;
 
 			/* print message to user */
-			(void)EMSG2(cs_emsg, buf);
+			(void)semsg(cs_emsg, buf);
 
 			/* send RETURN to cscope */
 			(void)putc('\n', csinfo[i].to_fp);
@@ -2162,7 +2162,7 @@ cs_read_prompt(int i)
 	    {
 		PERROR("cs_read_prompt EOF");
 		if (buf != NULL && buf[0] != NUL)
-		    (void)EMSG2(cs_emsg, buf);
+		    (void)semsg(cs_emsg, buf);
 		else if (p_csverbose)
 		    cs_reading_emsg(i); /* don't have additional information */
 		cs_release_csp(i, TRUE);
@@ -2476,10 +2476,10 @@ cs_show(exarg_T *eap UNUSED)
 		continue;
 
 	    if (csinfo[i].ppath != NULL)
-		(void)smsg((char_u *)"%2d %-5ld  %-34s  %-32s",
+		(void)smsg("%2d %-5ld  %-34s  %-32s",
 		    i, (long)csinfo[i].pid, csinfo[i].fname, csinfo[i].ppath);
 	    else
-		(void)smsg((char_u *)"%2d %-5ld  %-34s  <none>",
+		(void)smsg("%2d %-5ld  %-34s  <none>",
 			   i, (long)csinfo[i].pid, csinfo[i].fname);
 	}
     }
--- a/src/if_lua.c
+++ b/src/if_lua.c
@@ -415,7 +415,7 @@ lua_link_init(char *libname, int verbose
     if (!hinstLua)
     {
 	if (verbose)
-	    EMSG2(_(e_loadlib), libname);
+	    semsg(_(e_loadlib), libname);
 	return FAIL;
     }
     for (reg = luaV_dll; reg->func; reg++)
@@ -425,7 +425,7 @@ lua_link_init(char *libname, int verbose
 	    close_dll(hinstLua);
 	    hinstLua = 0;
 	    if (verbose)
-		EMSG2(_(e_loadfunc), reg->name);
+		semsg(_(e_loadfunc), reg->name);
 	    return FAIL;
 	}
     }
@@ -1795,7 +1795,7 @@ luaV_luaeval (lua_State *L)
 	return 0;
     }
     if (luaV_totypval(L, -1, rettv) == FAIL)
-	EMSG("luaeval: cannot convert value");
+	emsg("luaeval: cannot convert value");
     return 0;
 }
 
@@ -1926,7 +1926,7 @@ lua_init(void)
 #ifdef DYNAMIC_LUA
 	if (!lua_enabled(TRUE))
 	{
-	    EMSG(_("Lua library cannot be loaded."));
+	    emsg(_("Lua library cannot be loaded."));
 	    return FAIL;
 	}
 #endif
@@ -1978,7 +1978,7 @@ ex_luado(exarg_T *eap)
     if (lua_init() == FAIL) return;
     if (u_save(eap->line1 - 1, eap->line2 + 1) == FAIL)
     {
-	EMSG(_("cannot save undo information"));
+	emsg(_("cannot save undo information"));
 	return;
     }
     luaV_setrange(L, eap->line1, eap->line2);
--- a/src/if_mzsch.c
+++ b/src/if_mzsch.c
@@ -672,14 +672,14 @@ mzscheme_runtime_link_init(char *sch_dll
     if (!hMzGC)
     {
 	if (verbose)
-	    EMSG2(_(e_loadlib), gc_dll);
+	    semsg(_(e_loadlib), gc_dll);
 	return FAIL;
     }
 
     if (!hMzSch)
     {
 	if (verbose)
-	    EMSG2(_(e_loadlib), sch_dll);
+	    semsg(_(e_loadlib), sch_dll);
 	return FAIL;
     }
 
@@ -693,7 +693,7 @@ mzscheme_runtime_link_init(char *sch_dll
 	    FreeLibrary(hMzGC);
 	    hMzGC = 0;
 	    if (verbose)
-		EMSG2(_(e_loadfunc), thunk->name);
+		semsg(_(e_loadfunc), thunk->name);
 	    return FAIL;
 	}
     }
@@ -707,7 +707,7 @@ mzscheme_runtime_link_init(char *sch_dll
 	    FreeLibrary(hMzGC);
 	    hMzGC = 0;
 	    if (verbose)
-		EMSG2(_(e_loadfunc), thunk->name);
+		semsg(_(e_loadfunc), thunk->name);
 	    return FAIL;
 	}
     }
@@ -1260,13 +1260,13 @@ mzscheme_init(void)
 #ifdef DYNAMIC_MZSCHEME
 	if (disabled || !mzscheme_enabled(TRUE))
 	{
-	    EMSG(_("E815: Sorry, this command is disabled, the MzScheme libraries could not be loaded."));
+	    emsg(_("E815: Sorry, this command is disabled, the MzScheme libraries could not be loaded."));
 	    return -1;
 	}
 #endif
 	if (load_base_module_failed || startup_mzscheme())
 	{
-	    EMSG(_("E895: Sorry, this command is disabled, the MzScheme's racket/base module could not be loaded."));
+	    emsg(_("E895: Sorry, this command is disabled, the MzScheme's racket/base module could not be loaded."));
 	    return -1;
 	}
 	initialized = TRUE;
@@ -1572,7 +1572,7 @@ do_intrnl_output(char *mesg, int error)
     {
 	*p = '\0';
 	if (error)
-	    EMSG(prev);
+	    emsg(prev);
 	else
 	    MSG(prev);
 	prev = p + 1;
@@ -1580,7 +1580,7 @@ do_intrnl_output(char *mesg, int error)
     }
 
     if (error)
-	EMSG(prev);
+	emsg(prev);
     else
 	MSG(prev);
 }
--- a/src/if_perl.xs
+++ b/src/if_perl.xs
@@ -695,7 +695,7 @@ perl_runtime_link_init(char *libname, in
     if ((hPerlLib = load_dll(libname)) == NULL)
     {
 	if (verbose)
-	    EMSG2(_("E370: Could not load library %s"), libname);
+	    semsg(_("E370: Could not load library %s"), libname);
 	return FAIL;
     }
     for (i = 0; perl_funcname_table[i].ptr; ++i)
@@ -706,7 +706,7 @@ perl_runtime_link_init(char *libname, in
 	    close_dll(hPerlLib);
 	    hPerlLib = NULL;
 	    if (verbose)
-		EMSG2(_(e_loadfunc), perl_funcname_table[i].name);
+		semsg((const char *)_(e_loadfunc), perl_funcname_table[i].name);
 	    return FAIL;
 	}
     }
@@ -998,7 +998,7 @@ ex_perl(exarg_T *eap)
 #ifdef DYNAMIC_PERL
 	if (!perl_enabled(TRUE))
 	{
-	    EMSG(_(e_noperl));
+	    emsg(_(e_noperl));
 	    vim_free(script);
 	    return;
 	}
@@ -1025,7 +1025,7 @@ ex_perl(exarg_T *eap)
 	safe = perl_get_sv("VIM::safe", FALSE);
 # ifndef MAKE_TEST  /* avoid a warning for unreachable code */
 	if (safe == NULL || !SvTRUE(safe))
-	    EMSG(_("E299: Perl evaluation forbidden in sandbox without the Safe module"));
+	    emsg(_("E299: Perl evaluation forbidden in sandbox without the Safe module"));
 	else
 # endif
 	{
@@ -1235,7 +1235,7 @@ perl_to_vim(SV *sv, typval_T *rettv)
 		    key = hv_iterkey(entry, &key_len);
 
 		    if (!key || !key_len || strlen(key) < (size_t)key_len) {
-			EMSG2("Malformed key Dictionary '%s'", key && *key ? key : "(empty)");
+			semsg("Malformed key Dictionary '%s'", key && *key ? key : "(empty)");
 			break;
 		    }
 
@@ -1286,7 +1286,7 @@ do_perleval(char_u *str, typval_T *rettv
 #ifdef DYNAMIC_PERL
 	if (!perl_enabled(TRUE))
 	{
-	    EMSG(_(e_noperl));
+	    emsg(_(e_noperl));
 	    return;
 	}
 #endif
@@ -1304,7 +1304,7 @@ do_perleval(char_u *str, typval_T *rettv
 	    safe = get_sv("VIM::safe", FALSE);
 # ifndef MAKE_TEST  /* avoid a warning for unreachable code */
 	    if (safe == NULL || !SvTRUE(safe))
-		EMSG(_("E299: Perl evaluation forbidden in sandbox without the Safe module"));
+		emsg(_("E299: Perl evaluation forbidden in sandbox without the Safe module"));
 	    else
 # endif
 	    {
@@ -1356,7 +1356,7 @@ ex_perldo(exarg_T *eap)
 #ifdef DYNAMIC_PERL
 	if (!perl_enabled(TRUE))
 	{
-	    EMSG(_(e_noperl));
+	    emsg(_(e_noperl));
 	    return;
 	}
 #endif
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -536,7 +536,7 @@ PythonIO_Init_io(void)
 
     if (PyErr_Occurred())
     {
-	EMSG(_("E264: Python: Error initialising I/O objects"));
+	emsg(_("E264: Python: Error initialising I/O objects"));
 	return -1;
     }
 
@@ -5664,7 +5664,7 @@ run_cmd(const char *cmd, void *arg UNUSE
     }
     else if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_SystemExit))
     {
-	EMSG2(_(e_py_systemexit), "python");
+	semsg(_(e_py_systemexit), "python");
 	PyErr_Clear();
     }
     else
@@ -5691,7 +5691,7 @@ run_do(const char *cmd, void *arg UNUSED
 
     if (u_save((linenr_T)RangeStart - 1, (linenr_T)RangeEnd + 1) != OK)
     {
-	EMSG(_("cannot save undo information"));
+	emsg(_("cannot save undo information"));
 	return;
     }
 
@@ -5709,7 +5709,7 @@ run_do(const char *cmd, void *arg UNUSED
     else if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_SystemExit))
     {
 	PyMem_Free(code);
-	EMSG2(_(e_py_systemexit), "python");
+	semsg(_(e_py_systemexit), "python");
 	PyErr_Clear();
 	return;
     }
@@ -5720,7 +5720,7 @@ run_do(const char *cmd, void *arg UNUSED
 
     if (status)
     {
-	EMSG(_("failed to run the code"));
+	emsg(_("failed to run the code"));
 	return;
     }
 
@@ -5810,20 +5810,20 @@ run_eval(const char *cmd, typval_T *rett
     {
 	if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_SystemExit))
 	{
-	    EMSG2(_(e_py_systemexit), "python");
+	    semsg(_(e_py_systemexit), "python");
 	    PyErr_Clear();
 	}
 	else
 	{
 	    if (PyErr_Occurred() && !msg_silent)
 		PyErr_PrintEx(0);
-	    EMSG(_("E858: Eval did not return a valid python object"));
+	    emsg(_("E858: Eval did not return a valid python object"));
 	}
     }
     else
     {
 	if (ConvertFromPyObject(run_ret, rettv) == -1)
-	    EMSG(_("E859: Failed to convert returned python object to vim value"));
+	    emsg(_("E859: Failed to convert returned python object to vim value"));
 	Py_DECREF(run_ret);
     }
     PyErr_Clear();
@@ -6727,7 +6727,7 @@ init_sys_path(void)
     else
     {
 	VimTryStart();
-	EMSG(_("Failed to set path hook: sys.path_hooks is not a list\n"
+	emsg(_("Failed to set path hook: sys.path_hooks is not a list\n"
 	       "You should now do the following:\n"
 	       "- append vim.path_hook to sys.path_hooks\n"
 	       "- append vim.VIM_SPECIAL_PATH to sys.path\n"));
@@ -6757,7 +6757,7 @@ init_sys_path(void)
     else
     {
 	VimTryStart();
-	EMSG(_("Failed to set path: sys.path is not a list\n"
+	emsg(_("Failed to set path: sys.path is not a list\n"
 	       "You should now append vim.VIM_SPECIAL_PATH to sys.path"));
 	VimTryEnd(); /* Discard the error */
     }
--- a/src/if_python.c
+++ b/src/if_python.c
@@ -685,7 +685,7 @@ python_runtime_link_init(char *libname, 
     if (python3_loaded())
     {
 	if (verbose)
-	    EMSG(_("E836: This Vim cannot execute :python after using :py3"));
+	    emsg(_("E836: This Vim cannot execute :python after using :py3"));
 	return FAIL;
     }
 #endif
@@ -696,7 +696,7 @@ python_runtime_link_init(char *libname, 
     if (!hinstPython)
     {
 	if (verbose)
-	    EMSG2(_(e_loadlib), libname);
+	    semsg(_(e_loadlib), libname);
 	return FAIL;
     }
 
@@ -708,7 +708,7 @@ python_runtime_link_init(char *libname, 
 	    close_dll(hinstPython);
 	    hinstPython = 0;
 	    if (verbose)
-		EMSG2(_(e_loadfunc), python_funcname_table[i].name);
+		semsg(_(e_loadfunc), python_funcname_table[i].name);
 	    return FAIL;
 	}
     }
@@ -725,7 +725,7 @@ python_runtime_link_init(char *libname, 
 	close_dll(hinstPython);
 	hinstPython = 0;
 	if (verbose)
-	    EMSG2(_(e_loadfunc), "PyUnicode_UCSX_*");
+	    semsg(_(e_loadfunc), "PyUnicode_UCSX_*");
 	return FAIL;
     }
 
@@ -928,7 +928,7 @@ Python_Init(void)
 #ifdef DYNAMIC_PYTHON
 	if (!python_enabled(TRUE))
 	{
-	    EMSG(_("E263: Sorry, this command is disabled, the Python library could not be loaded."));
+	    emsg(_("E263: Sorry, this command is disabled, the Python library could not be loaded."));
 	    goto fail;
 	}
 #endif
@@ -960,7 +960,7 @@ Python_Init(void)
 	site = PyImport_ImportModule("site");
 	if (site == NULL)
 	{
-	    EMSG(_("E887: Sorry, this command is disabled, the Python's site module could not be loaded."));
+	    emsg(_("E887: Sorry, this command is disabled, the Python's site module could not be loaded."));
 	    goto fail;
 	}
 	Py_DECREF(site);
@@ -1035,7 +1035,7 @@ DoPyCommand(const char *cmd, rangeinitia
 #ifndef PY_CAN_RECURSE
     if (recursive)
     {
-	EMSG(_("E659: Cannot invoke Python recursively"));
+	emsg(_("E659: Cannot invoke Python recursively"));
 	return;
     }
     ++recursive;
--- a/src/if_python3.c
+++ b/src/if_python3.c
@@ -634,7 +634,7 @@ py3_runtime_link_init(char *libname, int
     if (python_loaded())
     {
 	if (verbose)
-	    EMSG(_("E837: This Vim cannot execute :py3 after using :python"));
+	    emsg(_("E837: This Vim cannot execute :py3 after using :python"));
 	return FAIL;
     }
 # endif
@@ -646,7 +646,7 @@ py3_runtime_link_init(char *libname, int
     if (!hinstPy3)
     {
 	if (verbose)
-	    EMSG2(_(e_loadlib), libname);
+	    semsg(_(e_loadlib), libname);
 	return FAIL;
     }
 
@@ -658,7 +658,7 @@ py3_runtime_link_init(char *libname, int
 	    close_dll(hinstPy3);
 	    hinstPy3 = 0;
 	    if (verbose)
-		EMSG2(_(e_loadfunc), py3_funcname_table[i].name);
+		semsg(_(e_loadfunc), py3_funcname_table[i].name);
 	    return FAIL;
 	}
     }
@@ -693,7 +693,7 @@ py3_runtime_link_init(char *libname, int
 	close_dll(hinstPy3);
 	hinstPy3 = 0;
 	if (verbose)
-	    EMSG2(_(e_loadfunc), "PyUnicode_UCSX_*");
+	    semsg(_(e_loadfunc), "PyUnicode_UCSX_*");
 	return FAIL;
     }
 
@@ -864,7 +864,7 @@ Python3_Init(void)
 #ifdef DYNAMIC_PYTHON3
 	if (!python3_enabled(TRUE))
 	{
-	    EMSG(_("E263: Sorry, this command is disabled, the Python library could not be loaded."));
+	    emsg(_("E263: Sorry, this command is disabled, the Python library could not be loaded."));
 	    goto fail;
 	}
 #endif
--- a/src/if_ruby.c
+++ b/src/if_ruby.c
@@ -745,7 +745,7 @@ ruby_runtime_link_init(char *libname, in
     if (!hinstRuby)
     {
 	if (verbose)
-	    EMSG2(_(e_loadlib), libname);
+	    semsg(_(e_loadlib), libname);
 	return FAIL;
     }
 
@@ -757,7 +757,7 @@ ruby_runtime_link_init(char *libname, in
 	    close_dll(hinstRuby);
 	    hinstRuby = NULL;
 	    if (verbose)
-		EMSG2(_(e_loadfunc), ruby_funcname_table[i].name);
+		semsg(_(e_loadfunc), ruby_funcname_table[i].name);
 	    return FAIL;
 	}
     }
@@ -885,7 +885,7 @@ void ex_rubydo(exarg_T *eap)
 	    {
 		if (TYPE(line) != T_STRING)
 		{
-		    EMSG(_("E265: $_ must be an instance of String"));
+		    emsg(_("E265: $_ must be an instance of String"));
 		    return;
 		}
 		ml_replace(i, (char_u *) StringValuePtr(line), 1);
@@ -979,7 +979,7 @@ static int ensure_ruby_initialized(void)
 	}
 	else
 	{
-	    EMSG(_("E266: Sorry, this command is disabled, the Ruby library could not be loaded."));
+	    emsg(_("E266: Sorry, this command is disabled, the Ruby library could not be loaded."));
 	    return 0;
 	}
 #endif
@@ -1013,19 +1013,19 @@ static void error_print(int state)
     switch (state)
     {
     case TAG_RETURN:
-	EMSG(_("E267: unexpected return"));
+	emsg(_("E267: unexpected return"));
 	break;
     case TAG_NEXT:
-	EMSG(_("E268: unexpected next"));
+	emsg(_("E268: unexpected next"));
 	break;
     case TAG_BREAK:
-	EMSG(_("E269: unexpected break"));
+	emsg(_("E269: unexpected break"));
 	break;
     case TAG_REDO:
-	EMSG(_("E270: unexpected redo"));
+	emsg(_("E270: unexpected redo"));
 	break;
     case TAG_RETRY:
-	EMSG(_("E271: retry outside of rescue clause"));
+	emsg(_("E271: retry outside of rescue clause"));
 	break;
     case TAG_RAISE:
     case TAG_FATAL:
@@ -1038,7 +1038,7 @@ static void error_print(int state)
 	einfo = rb_obj_as_string(error);
 	if (eclass == rb_eRuntimeError && RSTRING_LEN(einfo) == 0)
 	{
-	    EMSG(_("E272: unhandled exception"));
+	    emsg(_("E272: unhandled exception"));
 	}
 	else
 	{
@@ -1050,7 +1050,7 @@ static void error_print(int state)
 		     RSTRING_PTR(epath), RSTRING_PTR(einfo));
 	    p = strchr(buff, '\n');
 	    if (p) *p = '\0';
-	    EMSG(buff);
+	    emsg(buff);
 	}
 
 	attr = syn_name2attr((char_u *)"Error");
@@ -1066,7 +1066,7 @@ static void error_print(int state)
 	break;
     default:
 	vim_snprintf(buff, BUFSIZ, _("E273: unknown longjmp status %d"), state);
-	EMSG(buff);
+	emsg(buff);
 	break;
     }
 }
--- a/src/if_tcl.c
+++ b/src/if_tcl.c
@@ -213,7 +213,7 @@ tcl_runtime_link_init(char *libname, int
     if (!(hTclLib = load_dll(libname)))
     {
 	if (verbose)
-	    EMSG2(_(e_loadlib), libname);
+	    semsg(_(e_loadlib), libname);
 	return FAIL;
     }
     for (i = 0; tcl_funcname_table[i].ptr; ++i)
@@ -224,7 +224,7 @@ tcl_runtime_link_init(char *libname, int
 	    close_dll(hTclLib);
 	    hTclLib = NULL;
 	    if (verbose)
-		EMSG2(_(e_loadfunc), tcl_funcname_table[i].name);
+		semsg(_(e_loadfunc), tcl_funcname_table[i].name);
 	    return FAIL;
 	}
     }
@@ -1539,7 +1539,7 @@ tclsetdelcmd(
 	reflist = reflist->next;
     }
     /* This should never happen.  Famous last word? */
-    EMSG(_("E280: TCL FATAL ERROR: reflist corrupt!? Please report this to vim-dev@vim.org"));
+    emsg(_("E280: TCL FATAL ERROR: reflist corrupt!? Please report this to vim-dev@vim.org"));
     Tcl_SetResult(interp, _("cannot register callback command: buffer/window reference not found"), TCL_STATIC);
     return TCL_ERROR;
 }
@@ -1709,7 +1709,7 @@ tclinit(exarg_T *eap)
 #ifdef DYNAMIC_TCL
     if (!tcl_enabled(TRUE))
     {
-	EMSG(_("E571: Sorry, this command is disabled: the Tcl library could not be loaded."));
+	emsg(_("E571: Sorry, this command is disabled: the Tcl library could not be loaded."));
 	return FAIL;
     }
 #endif
@@ -1817,11 +1817,11 @@ tclerrmsg(char *text)
     while ((next=strchr(text, '\n')))
     {
 	*next++ = '\0';
-	EMSG(text);
+	emsg(text);
 	text = next;
     }
     if (*text)
-	EMSG(text);
+	emsg(text);
 }
 
     static void
--- a/src/if_xcmdsrv.c
+++ b/src/if_xcmdsrv.c
@@ -427,7 +427,7 @@ serverSendToVim(
     if (w == None)
     {
 	if (!silent)
-	    EMSG2(_(e_noserver), name);
+	    semsg(_(e_noserver), name);
 	return -1;
     }
     else if (loosename != NULL)
@@ -467,7 +467,7 @@ serverSendToVim(
     vim_free(property);
     if (res < 0)
     {
-	EMSG(_("E248: Failed to send command to the destination program"));
+	emsg(_("E248: Failed to send command to the destination program"));
 	return -1;
     }
 
@@ -732,7 +732,7 @@ serverStrToWin(char_u *str)
 
     sscanf((char *)str, "0x%x", &id);
     if (id == None)
-	EMSG2(_("E573: Invalid server id used: %s"), str);
+	semsg(_("E573: Invalid server id used: %s"), str);
 
     return (Window)id;
 }
@@ -1110,7 +1110,7 @@ GetRegProp(
 	    XFree(*regPropp);
 	XDeleteProperty(dpy, RootWindow(dpy, 0), registryProperty);
 	if (domsg)
-	    EMSG(_("E251: VIM instance registry property is badly formed.  Deleted!"));
+	    emsg(_("E251: VIM instance registry property is badly formed.  Deleted!"));
 	return FAIL;
     }
     return OK;
--- a/src/json.c
+++ b/src/json.c
@@ -232,7 +232,7 @@ json_encode_item(garray_T *gap, typval_T
 	case VAR_JOB:
 	case VAR_CHANNEL:
 	    /* no JSON equivalent TODO: better error */
-	    EMSG(_(e_invarg));
+	    emsg(_(e_invarg));
 	    return FAIL;
 
 	case VAR_BLOB:
@@ -739,7 +739,7 @@ json_decode_item(js_read_T *reader, typv
 			retval = json_decode_string(reader, cur_item, *p);
 		    else
 		    {
-			EMSG(_(e_invarg));
+			emsg(_(e_invarg));
 			retval = FAIL;
 		    }
 		    break;
@@ -747,7 +747,7 @@ json_decode_item(js_read_T *reader, typv
 		case ',': /* comma: empty item */
 		    if ((options & JSON_JS) == 0)
 		    {
-			EMSG(_(e_invarg));
+			emsg(_(e_invarg));
 			retval = FAIL;
 			break;
 		    }
@@ -777,7 +777,7 @@ json_decode_item(js_read_T *reader, typv
 			    }
 			    if (!VIM_ISDIGIT(*sp))
 			    {
-				EMSG(_(e_invarg));
+				emsg(_(e_invarg));
 				retval = FAIL;
 				break;
 			    }
@@ -915,7 +915,7 @@ json_decode_item(js_read_T *reader, typv
 		if (top_item->jd_key == NULL)
 		{
 		    clear_tv(cur_item);
-		    EMSG(_(e_invarg));
+		    emsg(_(e_invarg));
 		    retval = FAIL;
 		    goto theend;
 		}
@@ -953,7 +953,7 @@ item_end:
 			retval = MAYBE;
 		    else
 		    {
-			EMSG(_(e_invarg));
+			emsg(_(e_invarg));
 			retval = FAIL;
 		    }
 		    goto theend;
@@ -971,7 +971,7 @@ item_end:
 			retval = MAYBE;
 		    else
 		    {
-			EMSG(_(e_invarg));
+			emsg(_(e_invarg));
 			retval = FAIL;
 		    }
 		    goto theend;
@@ -988,7 +988,7 @@ item_end:
 			&& dict_find(top_item->jd_tv.vval.v_dict,
 						 top_item->jd_key, -1) != NULL)
 		{
-		    EMSG2(_("E938: Duplicate key in JSON: \"%s\""),
+		    semsg(_("E938: Duplicate key in JSON: \"%s\""),
 							     top_item->jd_key);
 		    clear_tv(&top_item->jd_key_tv);
 		    clear_tv(cur_item);
@@ -1027,7 +1027,7 @@ item_end:
 			retval = MAYBE;
 		    else
 		    {
-			EMSG(_(e_invarg));
+			emsg(_(e_invarg));
 			retval = FAIL;
 		    }
 		    goto theend;
@@ -1046,7 +1046,7 @@ item_end:
 	res->v_type = VAR_SPECIAL;
 	res->vval.v_number = VVAL_NONE;
     }
-    EMSG(_(e_invarg));
+    emsg(_(e_invarg));
 
 theend:
     ga_clear(&stack);
@@ -1070,13 +1070,13 @@ json_decode_all(js_read_T *reader, typva
     if (ret != OK)
     {
 	if (ret == MAYBE)
-	    EMSG(_(e_invarg));
+	    emsg(_(e_invarg));
 	return FAIL;
     }
     json_skip_white(reader);
     if (reader->js_buf[reader->js_used] != NUL)
     {
-	EMSG(_(e_trailing));
+	emsg(_(e_trailing));
 	return FAIL;
     }
     return OK;
--- a/src/list.c
+++ b/src/list.c
@@ -417,7 +417,7 @@ list_find_str(list_T *l, long idx)
     li = list_find(l, idx - 1);
     if (li == NULL)
     {
-	EMSGN(_(e_listidx), idx);
+	semsg(_(e_listidx), idx);
 	return NULL;
     }
     return tv_get_string(&li->li_tv);
@@ -914,7 +914,7 @@ get_list_tv(char_u **arg, typval_T *rett
 	    break;
 	if (**arg != ',')
 	{
-	    EMSG2(_("E696: Missing comma in List: %s"), *arg);
+	    semsg(_("E696: Missing comma in List: %s"), *arg);
 	    goto failret;
 	}
 	*arg = skipwhite(*arg + 1);
@@ -922,7 +922,7 @@ get_list_tv(char_u **arg, typval_T *rett
 
     if (**arg != ']')
     {
-	EMSG2(_("E697: Missing end of List ']': %s"), *arg);
+	semsg(_("E697: Missing end of List ']': %s"), *arg);
 failret:
 	if (evaluate)
 	    list_free(l);
@@ -969,7 +969,7 @@ write_list(FILE *fd, list_T *list, int b
 	    }
 	if (ret == FAIL)
 	{
-	    EMSG(_(e_write));
+	    emsg(_(e_write));
 	    break;
 	}
     }
--- a/src/main.c
+++ b/src/main.c
@@ -945,7 +945,7 @@ common_init(mparm_T *paramp)
 
     /*
      * Allocate space for the generic buffers (needed for set_init_1() and
-     * EMSG2()).
+     * emsg()).
      */
     if ((IObuff = alloc(IOSIZE)) == NULL
 	    || (NameBuff = alloc(MAXPATHL)) == NULL)
@@ -3020,7 +3020,7 @@ source_startup_scripts(mparm_T *parmp)
 	else
 	{
 	    if (do_source(parmp->use_vimrc, FALSE, DOSO_NONE) != OK)
-		EMSG2(_("E282: Cannot read from \"%s\""), parmp->use_vimrc);
+		semsg(_("E282: Cannot read from \"%s\""), parmp->use_vimrc);
 	}
     }
     else if (!silent_mode)
--- a/src/mark.c
+++ b/src/mark.c
@@ -606,7 +606,7 @@ check_mark(pos_T *pos)
 {
     if (pos == NULL)
     {
-	EMSG(_(e_umark));
+	emsg(_(e_umark));
 	return FAIL;
     }
     if (pos->lnum <= 0)
@@ -614,12 +614,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_marknotset));
 	return FAIL;
     }
     if (pos->lnum > curbuf->b_ml.ml_line_count)
     {
-	EMSG(_(e_markinval));
+	emsg(_(e_markinval));
 	return FAIL;
     }
     return OK;
@@ -763,7 +763,7 @@ show_one_mark(
 	    if (arg == NULL)
 		MSG(_("No marks set"));
 	    else
-		EMSG2(_("E283: No marks matching \"%s\""), arg);
+		semsg(_("E283: No marks matching \"%s\""), arg);
 	}
     }
     /* don't output anything if 'q' typed at --more-- prompt */
@@ -815,9 +815,9 @@ ex_delmarks(exarg_T *eap)
 	/* clear all marks */
 	clrallmarks(curbuf);
     else if (eap->forceit)
-	EMSG(_(e_invarg));
+	emsg(_(e_invarg));
     else if (*eap->arg == NUL)
-	EMSG(_(e_argreq));
+	emsg(_(e_argreq));
     else
     {
 	/* clear specified marks only */
@@ -837,7 +837,7 @@ ex_delmarks(exarg_T *eap)
 				    : ASCII_ISUPPER(p[2])))
 			    || to < from)
 		    {
-			EMSG2(_(e_invarg2), p);
+			semsg(_(e_invarg2), p);
 			return;
 		    }
 		    p += 2;
@@ -875,7 +875,7 @@ ex_delmarks(exarg_T *eap)
 		    case '<': curbuf->b_visual.vi_start.lnum = 0; break;
 		    case '>': curbuf->b_visual.vi_end.lnum   = 0; break;
 		    case ' ': break;
-		    default:  EMSG2(_(e_invarg2), p);
+		    default:  semsg(_(e_invarg2), p);
 			      return;
 		}
 	}
--- a/src/mbyte.c
+++ b/src/mbyte.c
@@ -199,7 +199,7 @@ xim_log(char *s, ...)
 	fd = mch_fopen("xim.log", "w");
 	if (fd == NULL)
 	{
-	    EMSG("Cannot open xim.log");
+	    emsg("Cannot open xim.log");
 	    fd = (FILE *)-1;
 	    return;
 	}
@@ -509,7 +509,7 @@ enc_canon_props(char_u *name)
  * When there is something wrong: Returns an error message and doesn't change
  * anything.
  */
-    char_u *
+    char *
 mb_init(void)
 {
     int		i;
@@ -4749,7 +4749,7 @@ iconv_enabled(int verbose)
 	if (verbose && p_verbose > 0)
 	{
 	    verbose_enter();
-	    EMSG2(_(e_loadlib),
+	    semsg(_(e_loadlib),
 		    hIconvDLL == 0 ? DYNAMIC_ICONV_DLL : DYNAMIC_MSVCRT_DLL);
 	    verbose_leave();
 	}
@@ -4771,7 +4771,7 @@ iconv_enabled(int verbose)
 	if (verbose && p_verbose > 0)
 	{
 	    verbose_enter();
-	    EMSG2(_(e_loadfunc), "for libiconv");
+	    semsg(_(e_loadfunc), "for libiconv");
 	    verbose_leave();
 	}
 	return FALSE;
@@ -6028,7 +6028,7 @@ xim_set_preedit(void)
 					XNLineSpace, line_space,
 					NULL);
 	if (XSetICValues(xic, XNPreeditAttributes, attr_list, NULL))
-	    EMSG(_("E284: Cannot set IC values"));
+	    emsg(_("E284: Cannot set IC values"));
 	XFree(attr_list);
     }
 }
@@ -6187,7 +6187,7 @@ xim_real_init(Window x11_window, Display
 	if (p_verbose > 0)
 	{
 	    verbose_enter();
-	    EMSG(_("E286: Failed to open input method"));
+	    emsg(_("E286: Failed to open input method"));
 	    verbose_leave();
 	}
 	return FALSE;
@@ -6200,13 +6200,13 @@ xim_real_init(Window x11_window, Display
 	destroy_cb.callback = xim_destroy_cb;
 	destroy_cb.client_data = NULL;
 	if (XSetIMValues(xim, XNDestroyCallback, &destroy_cb, NULL))
-	    EMSG(_("E287: Warning: Could not set destroy callback to IM"));
+	    emsg(_("E287: Warning: Could not set destroy callback to IM"));
     }
 #  endif
 
     if (XGetIMValues(xim, XNQueryInputStyle, &xim_styles, NULL) || !xim_styles)
     {
-	EMSG(_("E288: input method doesn't support any style"));
+	emsg(_("E288: input method doesn't support any style"));
 	XCloseIM(xim);
 	return FALSE;
     }
@@ -6265,7 +6265,7 @@ xim_real_init(Window x11_window, Display
 	if (p_verbose > 0)
 	{
 	    verbose_enter();
-	    EMSG(_("E289: input method doesn't support my preedit type"));
+	    emsg(_("E289: input method doesn't support my preedit type"));
 	    verbose_leave();
 	}
 	XCloseIM(xim);
@@ -6329,7 +6329,7 @@ xim_real_init(Window x11_window, Display
     else
     {
 	if (!is_not_a_term())
-	    EMSG(_(e_xim));
+	    emsg(_(e_xim));
 	XCloseIM(xim);
 	return FALSE;
     }
--- a/src/memfile.c
+++ b/src/memfile.c
@@ -245,7 +245,7 @@ mf_close(memfile_T *mfp, int del_file)
     if (mfp->mf_fd >= 0)
     {
 	if (close(mfp->mf_fd) < 0)
-	    EMSG(_(e_swapclose));
+	    emsg(_(e_swapclose));
     }
     if (del_file && mfp->mf_fname != NULL)
 	mch_remove(mfp->mf_fname);
@@ -291,7 +291,7 @@ mf_close_file(
     }
 
     if (close(mfp->mf_fd) < 0)			/* close the file */
-	EMSG(_(e_swapclose));
+	emsg(_(e_swapclose));
     mfp->mf_fd = -1;
 
     if (mfp->mf_fname != NULL)
@@ -480,7 +480,7 @@ mf_put(
     flags = hp->bh_flags;
 
     if ((flags & BH_LOCKED) == 0)
-	IEMSG(_("E293: block was not locked"));
+	iemsg(_("E293: block was not locked"));
     flags &= ~BH_LOCKED;
     if (dirty)
     {
@@ -1040,7 +1040,7 @@ mf_write(memfile_T *mfp, bhdr_T *hp)
 	     * space becomes available.
 	     */
 	    if (!did_swapwrite_msg)
-		EMSG(_("E297: Write error in swap file"));
+		emsg(_("E297: Write error in swap file"));
 	    did_swapwrite_msg = TRUE;
 	    return FAIL;
 	}
@@ -1256,7 +1256,7 @@ mf_do_open(
     if ((flags & O_CREAT) && mch_lstat((char *)mfp->mf_fname, &sb) >= 0)
     {
 	mfp->mf_fd = -1;
-	EMSG(_("E300: Swap file already exists (symlink attack?)"));
+	emsg(_("E300: Swap file already exists (symlink attack?)"));
     }
     else
 #endif
--- a/src/memline.c
+++ b/src/memline.c
@@ -8,7 +8,7 @@
  */
 
 /* for debugging */
-/* #define CHECK(c, s)	do { if (c) EMSG(s); } while (0) */
+/* #define CHECK(c, s)	do { if (c) emsg((s)); } while (0) */
 #define CHECK(c, s)	do { /**/ } while (0)
 
 /*
@@ -328,7 +328,7 @@ ml_open(buf_T *buf)
 	goto error;
     if (hp->bh_bnum != 0)
     {
-	IEMSG(_("E298: Didn't get block nr 0?"));
+	iemsg(_("E298: Didn't get block nr 0?"));
 	goto error;
     }
     b0p = (ZERO_BL *)(hp->bh_data);
@@ -378,7 +378,7 @@ ml_open(buf_T *buf)
 	goto error;
     if (hp->bh_bnum != 1)
     {
-	IEMSG(_("E298: Didn't get block nr 1?"));
+	iemsg(_("E298: Didn't get block nr 1?"));
 	goto error;
     }
     pp = (PTR_BL *)(hp->bh_data);
@@ -396,7 +396,7 @@ ml_open(buf_T *buf)
 	goto error;
     if (hp->bh_bnum != 2)
     {
-	IEMSG(_("E298: Didn't get block nr 2?"));
+	iemsg(_("E298: Didn't get block nr 2?"));
 	goto error;
     }
 
@@ -610,7 +610,7 @@ ml_set_crypt_key(
 	    mf_put(mfp, hp, FALSE, FALSE);  /* release previous block */
 
 	if (error > 0)
-	    EMSG(_("E843: Error while updating swap file crypt"));
+	    emsg(_("E843: Error while updating swap file crypt"));
     }
 
     mfp->mf_old_key = NULL;
@@ -708,7 +708,7 @@ ml_setname(buf_T *buf)
 	if (mfp->mf_fd < 0)
 	{
 	    /* could not (re)open the swap file, what can we do???? */
-	    EMSG(_("E301: Oops, lost the swap file!!!"));
+	    emsg(_("E301: Oops, lost the swap file!!!"));
 	    return;
 	}
 #ifdef HAVE_FD_CLOEXEC
@@ -720,7 +720,7 @@ ml_setname(buf_T *buf)
 #endif
     }
     if (!success)
-	EMSG(_("E302: Could not rename swap file"));
+	emsg(_("E302: Could not rename swap file"));
 }
 
 /*
@@ -811,7 +811,7 @@ ml_open_file(buf_T *buf)
     {
 	need_wait_return = TRUE;	/* call wait_return later */
 	++no_wait_return;
-	(void)EMSG2(_("E303: Unable to open swap file for \"%s\", recovery impossible"),
+	(void)semsg(_("E303: Unable to open swap file for \"%s\", recovery impossible"),
 		    buf_spname(buf) != NULL ? buf_spname(buf) : buf->b_fname);
 	--no_wait_return;
     }
@@ -946,7 +946,7 @@ ml_upd_block0(buf_T *buf, upd_block0_T w
 
     b0p = (ZERO_BL *)(hp->bh_data);
     if (ml_check_b0_id(b0p) == FAIL)
-	IEMSG(_("E304: ml_upd_block0(): Didn't get block 0??"));
+	iemsg(_("E304: ml_upd_block0(): Didn't get block 0??"));
     else
     {
 	if (what == UB_FNAME)
@@ -1164,7 +1164,7 @@ ml_recover(void)
 	len = recover_names(fname, FALSE, 0, NULL);
 	if (len == 0)		    /* no swap files found */
 	{
-	    EMSG2(_("E305: No swap file found for %s"), fname);
+	    semsg(_("E305: No swap file found for %s"), fname);
 	    goto theend;
 	}
 	if (len == 1)		    /* one swap file found, use it */
@@ -1221,7 +1221,7 @@ ml_recover(void)
     if (mfp == NULL || mfp->mf_fd < 0)
     {
 	if (fname_used != NULL)
-	    EMSG2(_("E306: Cannot open %s"), fname_used);
+	    semsg(_("E306: Cannot open %s"), fname_used);
 	goto theend;
     }
     buf->b_ml.ml_mfp = mfp;
@@ -1263,7 +1263,7 @@ ml_recover(void)
     }
     if (ml_check_b0_id(b0p) == FAIL)
     {
-	EMSG2(_("E307: %s does not look like a Vim swap file"), mfp->mf_fname);
+	semsg(_("E307: %s does not look like a Vim swap file"), mfp->mf_fname);
 	goto theend;
     }
     if (b0_magic_wrong(b0p))
@@ -1297,7 +1297,7 @@ ml_recover(void)
 #else
     if (b0p->b0_id[1] != BLOCK0_ID1)
     {
-	EMSG2(_("E833: %s is encrypted and this version of Vim does not support encryption"), mfp->mf_fname);
+	semsg(_("E833: %s is encrypted and this version of Vim does not support encryption"), mfp->mf_fname);
 	goto theend;
     }
 #endif
@@ -1347,13 +1347,13 @@ ml_recover(void)
     }
 
     home_replace(NULL, mfp->mf_fname, NameBuff, MAXPATHL, TRUE);
-    smsg((char_u *)_("Using swap file \"%s\""), NameBuff);
+    smsg(_("Using swap file \"%s\""), NameBuff);
 
     if (buf_spname(curbuf) != NULL)
 	vim_strncpy(NameBuff, buf_spname(curbuf), MAXPATHL - 1);
     else
 	home_replace(NULL, curbuf->b_ffname, NameBuff, MAXPATHL, TRUE);
-    smsg((char_u *)_("Original file \"%s\""), NameBuff);
+    smsg(_("Original file \"%s\""), NameBuff);
     msg_putchar('\n');
 
     /*
@@ -1366,7 +1366,7 @@ ml_recover(void)
 		    && org_stat.st_mtime > swp_stat.st_mtime)
 		|| org_stat.st_mtime != mtime))
     {
-	EMSG(_("E308: Warning: Original file may have been changed"));
+	emsg(_("E308: Warning: Original file may have been changed"));
     }
     out_flush();
 
@@ -1412,14 +1412,14 @@ ml_recover(void)
 	 * without a key, will probably get garbage text. */
 	if (*curbuf->b_p_key != NUL)
 	{
-	    smsg((char_u *)_("Swap file is encrypted: \"%s\""), fname_used);
+	    smsg(_("Swap file is encrypted: \"%s\""), fname_used);
 	    MSG_PUTS(_("\nIf you entered a new crypt key but did not write the text file,"));
 	    MSG_PUTS(_("\nenter the new crypt key."));
 	    MSG_PUTS(_("\nIf you wrote the text file after changing the crypt key press enter"));
 	    MSG_PUTS(_("\nto use the same key for text file and swap file"));
 	}
 	else
-	    smsg((char_u *)_(need_key_msg), fname_used);
+	    smsg(_(need_key_msg), fname_used);
 	buf->b_p_key = crypt_get_key(FALSE, FALSE);
 	if (buf->b_p_key == NULL)
 	    buf->b_p_key = curbuf->b_p_key;
@@ -1471,7 +1471,7 @@ ml_recover(void)
 	{
 	    if (bnum == 1)
 	    {
-		EMSG2(_("E309: Unable to read block 1 from %s"), mfp->mf_fname);
+		semsg(_("E309: Unable to read block 1 from %s"), mfp->mf_fname);
 		goto theend;
 	    }
 	    ++error;
@@ -1557,7 +1557,7 @@ ml_recover(void)
 		{
 		    if (bnum == 1)
 		    {
-			EMSG2(_("E310: Block 1 ID wrong (%s not a .swp file?)"),
+			semsg(_("E310: Block 1 ID wrong (%s not a .swp file?)"),
 							       mfp->mf_fname);
 			goto theend;
 		    }
@@ -1677,12 +1677,12 @@ ml_recover(void)
 
     recoverymode = FALSE;
     if (got_int)
-	EMSG(_("E311: Recovery Interrupted"));
+	emsg(_("E311: Recovery Interrupted"));
     else if (error)
     {
 	++no_wait_return;
 	MSG(">>>>>>>>>>>>>");
-	EMSG(_("E312: Errors detected while recovering; look for lines starting with ???"));
+	emsg(_("E312: Errors detected while recovering; look for lines starting with ???"));
 	--no_wait_return;
 	MSG(_("See \":help E312\" for more information."));
 	MSG(">>>>>>>>>>>>>");
@@ -2361,7 +2361,7 @@ ml_preserve(buf_T *buf, int message)
     if (mfp == NULL || mfp->mf_fname == NULL)
     {
 	if (message)
-	    EMSG(_("E313: Cannot preserve, there is no swap file"));
+	    emsg(_("E313: Cannot preserve, there is no swap file"));
 	return;
     }
 
@@ -2416,7 +2416,7 @@ theend:
 	if (status == OK)
 	    MSG(_("File preserved"));
 	else
-	    EMSG(_("E314: Preserve failed"));
+	    emsg(_("E314: Preserve failed"));
     }
 }
 
@@ -2490,7 +2490,7 @@ ml_get_buf(
 	    /* Avoid giving this message for a recursive call, may happen when
 	     * the GUI redraws part of the text. */
 	    ++recursive;
-	    IEMSGN(_("E315: ml_get: invalid lnum: %ld"), lnum);
+	    siemsg(_("E315: ml_get: invalid lnum: %ld"), lnum);
 	    --recursive;
 	}
 errorret:
@@ -2529,7 +2529,7 @@ errorret:
 		/* Avoid giving this message for a recursive call, may happen
 		 * when the GUI redraws part of the text. */
 		++recursive;
-		IEMSGN(_("E316: ml_get: cannot find line %ld"), lnum);
+		siemsg(_("E316: ml_get: cannot find line %ld"), lnum);
 		--recursive;
 	    }
 	    goto errorret;
@@ -3026,7 +3026,7 @@ ml_append_int(
 	    pp = (PTR_BL *)(hp->bh_data);   /* must be pointer block */
 	    if (pp->pb_id != PTR_ID)
 	    {
-		IEMSG(_("E317: pointer block id wrong 3"));
+		iemsg(_("E317: pointer block id wrong 3"));
 		mf_put(mfp, hp, FALSE, FALSE);
 		goto theend;
 	    }
@@ -3168,7 +3168,7 @@ ml_append_int(
 	 */
 	if (stack_idx < 0)
 	{
-	    IEMSG(_("E318: Updated too many blocks?"));
+	    iemsg(_("E318: Updated too many blocks?"));
 	    buf->b_ml.ml_stack_top = 0;	/* invalidate stack */
 	}
     }
@@ -3544,7 +3544,7 @@ ml_delete_int(buf_T *buf, linenr_T lnum,
 	    pp = (PTR_BL *)(hp->bh_data);   /* must be pointer block */
 	    if (pp->pb_id != PTR_ID)
 	    {
-		IEMSG(_("E317: pointer block id wrong 4"));
+		iemsg(_("E317: pointer block id wrong 4"));
 		mf_put(mfp, hp, FALSE, FALSE);
 		goto theend;
 	    }
@@ -3770,7 +3770,7 @@ ml_flush_line(buf_T *buf)
 
 	hp = ml_find_line(buf, lnum, ML_FIND);
 	if (hp == NULL)
-	    IEMSGN(_("E320: Cannot find line %ld"), lnum);
+	    siemsg(_("E320: Cannot find line %ld"), lnum);
 	else
 	{
 	    dp = (DATA_BL *)(hp->bh_data);
@@ -4012,7 +4012,7 @@ ml_find_line(buf_T *buf, linenr_T lnum, 
 	pp = (PTR_BL *)(dp);		/* must be pointer block */
 	if (pp->pb_id != PTR_ID)
 	{
-	    IEMSG(_("E317: pointer block id wrong"));
+	    iemsg(_("E317: pointer block id wrong"));
 	    goto error_block;
 	}
 
@@ -4057,11 +4057,11 @@ ml_find_line(buf_T *buf, linenr_T lnum, 
 	if (idx >= (int)pp->pb_count)	    /* past the end: something wrong! */
 	{
 	    if (lnum > buf->b_ml.ml_line_count)
-		IEMSGN(_("E322: line number out of range: %ld past the end"),
+		siemsg(_("E322: line number out of range: %ld past the end"),
 					      lnum - buf->b_ml.ml_line_count);
 
 	    else
-		IEMSGN(_("E323: line count wrong in block %ld"), bnum);
+		siemsg(_("E323: line count wrong in block %ld"), bnum);
 	    goto error_block;
 	}
 	if (action == ML_DELETE)
@@ -4155,7 +4155,7 @@ ml_lineadd(buf_T *buf, int count)
 	if (pp->pb_id != PTR_ID)
 	{
 	    mf_put(mfp, hp, FALSE, FALSE);
-	    IEMSG(_("E317: pointer block id wrong 2"));
+	    iemsg(_("E317: pointer block id wrong 2"));
 	    break;
 	}
 	pp->pb_pointer[ip->ip_index].pe_line_count += count;
@@ -4190,7 +4190,7 @@ resolve_symlink(char_u *fname, char_u *b
 	/* Limit symlink depth to 100, catch recursive loops. */
 	if (++depth == 100)
 	{
-	    EMSG2(_("E773: Symlink loop for \"%s\""), fname);
+	    semsg(_("E773: Symlink loop for \"%s\""), fname);
 	    return FAIL;
 	}
 
@@ -4372,7 +4372,7 @@ attention_message(
     char	*p;
 
     ++no_wait_return;
-    (void)EMSG(_("E325: ATTENTION"));
+    (void)emsg(_("E325: ATTENTION"));
     MSG_PUTS(_("\nFound a swap file by the name \""));
     msg_home_replace(fname);
     MSG_PUTS("\"\n");
@@ -4915,7 +4915,7 @@ findswapname(
 	{
 	    if (fname[n - 2] == 'a')    /* ".saa": tried enough, give up */
 	    {
-		EMSG(_("E326: Too many swap files found"));
+		emsg(_("E326: Too many swap files found"));
 		VIM_CLEAR(fname);
 		break;
 	    }
--- a/src/menu.c
+++ b/src/menu.c
@@ -274,7 +274,7 @@ ex_menu(
     menu_path = arg;
     if (*menu_path == '.')
     {
-	EMSG2(_(e_invarg2), menu_path);
+	semsg(_(e_invarg2), menu_path);
 	goto theend;
     }
 
@@ -290,7 +290,7 @@ ex_menu(
     }
     else if (*map_to != NUL && (unmenu || enable != MAYBE))
     {
-	EMSG(_(e_trailing));
+	emsg(_(e_trailing));
 	goto theend;
     }
 #if defined(FEAT_GUI) && !(defined(FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON))
@@ -515,7 +515,7 @@ add_menu_path(
 	if (*dname == NUL)
 	{
 	    /* Only a mnemonic or accelerator is not valid. */
-	    EMSG(_("E792: Empty menu name"));
+	    emsg(_("E792: Empty menu name"));
 	    goto erret;
 	}
 
@@ -533,7 +533,7 @@ add_menu_path(
 		if (*next_name == NUL && menu->children != NULL)
 		{
 		    if (!sys_menu)
-			EMSG(_("E330: Menu path must not lead to a sub-menu"));
+			emsg(_("E330: Menu path must not lead to a sub-menu"));
 		    goto erret;
 		}
 		if (*next_name != NUL && menu->children == NULL
@@ -543,7 +543,7 @@ add_menu_path(
 			)
 		{
 		    if (!sys_menu)
-			EMSG(_(e_notsubmenu));
+			emsg(_(e_notsubmenu));
 		    goto erret;
 		}
 		break;
@@ -572,13 +572,13 @@ add_menu_path(
 	{
 	    if (*next_name == NUL && parent == NULL)
 	    {
-		EMSG(_("E331: Must not add menu items directly to menu bar"));
+		emsg(_("E331: Must not add menu items directly to menu bar"));
 		goto erret;
 	    }
 
 	    if (menu_is_separator(dname) && *next_name != NUL)
 	    {
-		EMSG(_("E332: Separator cannot be part of a menu path"));
+		emsg(_("E332: Separator cannot be part of a menu path"));
 		goto erret;
 	    }
 
@@ -867,7 +867,7 @@ menu_nable_recurse(
 	    {
 		if (menu->children == NULL)
 		{
-		    EMSG(_(e_notsubmenu));
+		    emsg(_(e_notsubmenu));
 		    return FAIL;
 		}
 		if (menu_nable_recurse(menu->children, p, modes, enable)
@@ -892,7 +892,7 @@ menu_nable_recurse(
     }
     if (*name != NUL && *name != '*' && menu == NULL)
     {
-	EMSG2(_(e_nomenu), name);
+	semsg(_(e_nomenu), name);
 	return FAIL;
     }
 
@@ -933,7 +933,7 @@ remove_menu(
 	    if (*p != NUL && menu->children == NULL)
 	    {
 		if (!silent)
-		    EMSG(_(e_notsubmenu));
+		    emsg(_(e_notsubmenu));
 		return FAIL;
 	    }
 	    if ((menu->modes & modes) != 0x0)
@@ -955,7 +955,7 @@ remove_menu(
 	    else if (*name != NUL)
 	    {
 		if (!silent)
-		    EMSG(_(e_menuothermode));
+		    emsg(_(e_menuothermode));
 		return FAIL;
 	    }
 
@@ -985,7 +985,7 @@ remove_menu(
 	if (menu == NULL)
 	{
 	    if (!silent)
-		EMSG2(_(e_nomenu), name);
+		semsg(_(e_nomenu), name);
 	    return FAIL;
 	}
 
@@ -1123,13 +1123,13 @@ show_menus(char_u *path_name, int modes)
 		/* Found menu */
 		if (*p != NUL && menu->children == NULL)
 		{
-		    EMSG(_(e_notsubmenu));
+		    emsg(_(e_notsubmenu));
 		    vim_free(path_name);
 		    return FAIL;
 		}
 		else if ((menu->modes & modes) == 0x0)
 		{
-		    EMSG(_(e_menuothermode));
+		    emsg(_(e_menuothermode));
 		    vim_free(path_name);
 		    return FAIL;
 		}
@@ -1139,7 +1139,7 @@ show_menus(char_u *path_name, int modes)
 	}
 	if (menu == NULL)
 	{
-	    EMSG2(_(e_nomenu), name);
+	    semsg(_(e_nomenu), name);
 	    vim_free(path_name);
 	    return FAIL;
 	}
@@ -2400,7 +2400,7 @@ execute_menu(exarg_T *eap, vimmenu_T *me
 	    default:
 		mode = (char_u *)"Normal";
 	}
-	EMSG2(_("E335: Menu not defined for %s mode"), mode);
+	semsg(_("E335: Menu not defined for %s mode"), mode);
     }
 }
 
@@ -2430,7 +2430,7 @@ ex_emenu(exarg_T *eap)
 	    case 't': mode_idx = MENU_INDEX_TERMINAL; break;
 	    case 'i': mode_idx = MENU_INDEX_INSERT; break;
 	    case 'c': mode_idx = MENU_INDEX_CMDLINE; break;
-	    default: EMSG2(_(e_invarg2), arg);
+	    default: semsg(_(e_invarg2), arg);
 		     return;
 	}
 	arg = skipwhite(arg + 2);
@@ -2453,13 +2453,13 @@ ex_emenu(exarg_T *eap)
 	    {
 		if (*p == NUL && menu->children != NULL)
 		{
-		    EMSG(_("E333: Menu path must lead to a menu item"));
+		    emsg(_("E333: Menu path must lead to a menu item"));
 		    gave_emsg = TRUE;
 		    menu = NULL;
 		}
 		else if (*p != NUL && menu->children == NULL)
 		{
-		    EMSG(_(e_notsubmenu));
+		    emsg(_(e_notsubmenu));
 		    menu = NULL;
 		}
 		break;
@@ -2475,7 +2475,7 @@ ex_emenu(exarg_T *eap)
     if (menu == NULL)
     {
 	if (!gave_emsg)
-	    EMSG2(_("E334: Menu not found: %s"), arg);
+	    semsg(_("E334: Menu not found: %s"), arg);
 	return;
     }
 
@@ -2567,9 +2567,9 @@ gui_find_menu(char_u *path_name)
 		{
 		    /* found a menu item instead of a sub-menu */
 		    if (*p == NUL)
-			EMSG(_("E336: Menu path must lead to a sub-menu"));
+			emsg(_("E336: Menu path must lead to a sub-menu"));
 		    else
-			EMSG(_(e_notsubmenu));
+			emsg(_(e_notsubmenu));
 		    menu = NULL;
 		    goto theend;
 		}
@@ -2588,7 +2588,7 @@ gui_find_menu(char_u *path_name)
     }
 
     if (menu == NULL)
-	EMSG(_("E337: Menu not found - check menu names"));
+	emsg(_("E337: Menu not found - check menu names"));
 theend:
     vim_free(saved_name);
     return menu;
@@ -2654,7 +2654,7 @@ ex_menutranslate(exarg_T *eap UNUSED)
 	*arg = NUL;
 	arg = menu_skip_part(to);
 	if (arg == to)
-	    EMSG(_(e_invarg));
+	    emsg(_(e_invarg));
 	else
 	{
 	    if (ga_grow(&menutrans_ga, 1) == OK)
--- a/src/message.c
+++ b/src/message.c
@@ -358,23 +358,23 @@ trunc_string(
 
 /*
  * Automatic prototype generation does not understand this function.
- * Note: Caller of smgs() and smsg_attr() must check the resulting string is
+ * Note: Caller of smsg() and smsg_attr() must check the resulting string is
  * shorter than IOSIZE!!!
  */
 #ifndef PROTO
 
-int vim_snprintf(char *str, size_t str_m, char *fmt, ...);
+int vim_snprintf(char *str, size_t str_m, const char *fmt, ...);
 
     int
 # ifdef __BORLANDC__
 _RTLENTRYF
 # endif
-smsg(char_u *s, ...)
+smsg(const char *s, ...)
 {
     va_list arglist;
 
     va_start(arglist, s);
-    vim_vsnprintf((char *)IObuff, IOSIZE, (char *)s, arglist);
+    vim_vsnprintf((char *)IObuff, IOSIZE, s, arglist);
     va_end(arglist);
     return msg(IObuff);
 }
@@ -383,12 +383,12 @@ smsg(char_u *s, ...)
 # ifdef __BORLANDC__
 _RTLENTRYF
 # endif
-smsg_attr(int attr, char_u *s, ...)
+smsg_attr(int attr, const char *s, ...)
 {
     va_list arglist;
 
     va_start(arglist, s);
-    vim_vsnprintf((char *)IObuff, IOSIZE, (char *)s, arglist);
+    vim_vsnprintf((char *)IObuff, IOSIZE, s, arglist);
     va_end(arglist);
     return msg_attr(IObuff, attr);
 }
@@ -397,12 +397,12 @@ smsg_attr(int attr, char_u *s, ...)
 # ifdef __BORLANDC__
 _RTLENTRYF
 # endif
-smsg_attr_keep(int attr, char_u *s, ...)
+smsg_attr_keep(int attr, const char *s, ...)
 {
     va_list arglist;
 
     va_start(arglist, s);
-    vim_vsnprintf((char *)IObuff, IOSIZE, (char *)s, arglist);
+    vim_vsnprintf((char *)IObuff, IOSIZE, s, arglist);
     va_end(arglist);
     return msg_attr_keep(IObuff, attr, TRUE);
 }
@@ -582,21 +582,22 @@ do_perror(char *msg)
 {
     perror(msg);
     ++emsg_silent;
-    emsg((char_u *)msg);
+    emsg(msg);
     --emsg_silent;
 }
 #endif
 
 /*
- * emsg() - display an error message
+ * emsg_core() - display an error message
  *
  * Rings the bell, if appropriate, and calls message() to do the real work
  * When terminal not initialized (yet) mch_errmsg(..) is used.
  *
- * return TRUE if wait_return not called
+ * Return TRUE if wait_return not called.
+ * Note: caller must check 'emsg_not_now()' before calling this.
  */
-    int
-emsg(char_u *s)
+    static int
+emsg_core(char_u *s)
 {
     int		attr;
     char_u	*p;
@@ -606,10 +607,6 @@ emsg(char_u *s)
     int		severe;
 #endif
 
-    /* Skip this if not giving error messages at the moment. */
-    if (emsg_not_now())
-	return TRUE;
-
 #ifdef FEAT_EVAL
     /* When testing some errors are turned into a normal message. */
     if (ignore_error(s))
@@ -727,40 +724,36 @@ emsg(char_u *s)
     return r;
 }
 
-
 /*
- * Print an error message with one "%s" and one string argument.
+ * Print an error message.
  */
     int
-emsg2(char_u *s, char_u *a1)
+emsg(char *s)
 {
-    return emsg3(s, a1, NULL);
+    /* Skip this if not giving error messages at the moment. */
+    if (!emsg_not_now())
+	return emsg_core((char_u *)s);
+    return TRUE;		/* no error messages at the moment */
 }
 
 /*
- * Print an error message with one or two "%s" and one or two string arguments.
- * This is not in message.c to avoid a warning for prototypes.
+ * Print an error message with format string and variable arguments.
+ * Note: caller must not pass 'IObuff' as 1st argument.
  */
     int
-emsg3(char_u *s, char_u *a1, char_u *a2)
+semsg(const char *s, ...)
 {
-    if (emsg_not_now())
-	return TRUE;		/* no error messages at the moment */
-    vim_snprintf((char *)IObuff, IOSIZE, (char *)s, a1, a2);
-    return emsg(IObuff);
-}
-
-/*
- * Print an error message with one "%ld" and one long int argument.
- * This is not in message.c to avoid a warning for prototypes.
- */
-    int
-emsgn(char_u *s, long n)
-{
-    if (emsg_not_now())
-	return TRUE;		/* no error messages at the moment */
-    vim_snprintf((char *)IObuff, IOSIZE, (char *)s, n);
-    return emsg(IObuff);
+    /* Skip this if not giving error messages at the moment. */
+    if (!emsg_not_now())
+    {
+	va_list ap;
+
+	va_start(ap, s);
+	vim_vsnprintf((char *)IObuff, IOSIZE, s, ap);
+	va_end(ap);
+	return emsg_core(IObuff);
+    }
+    return TRUE;		/* no error messages at the moment */
 }
 
 /*
@@ -769,38 +762,33 @@ emsgn(char_u *s, long n)
  * detected when fuzzing vim.
  */
     void
-iemsg(char_u *s)
+iemsg(char *s)
 {
-    emsg(s);
-#ifdef ABORT_ON_INTERNAL_ERROR
-    abort();
-#endif
-}
-
-
-/*
- * Same as emsg2(...) but abort on error when ABORT_ON_INTERNAL_ERROR is
- * defined. It is used for internal errors only, so that they can be
- * detected when fuzzing vim.
- */
-    void
-iemsg2(char_u *s, char_u *a1)
-{
-    emsg2(s, a1);
+    if (!emsg_not_now())
+	emsg_core((char_u *)s);
 #ifdef ABORT_ON_INTERNAL_ERROR
     abort();
 #endif
 }
 
 /*
- * Same as emsgn(...) but abort on error when ABORT_ON_INTERNAL_ERROR is
+ * Same as semsg(...) but abort on error when ABORT_ON_INTERNAL_ERROR is
  * defined. It is used for internal errors only, so that they can be
  * detected when fuzzing vim.
+ * Note: caller must not pass 'IObuff' as 1st argument.
  */
     void
-iemsgn(char_u *s, long n)
+siemsg(const char *s, ...)
 {
-    emsgn(s, n);
+    if (!emsg_not_now())
+    {
+	va_list ap;
+
+	va_start(ap, s);
+	vim_vsnprintf((char *)IObuff, IOSIZE, s, ap);
+	va_end(ap);
+	emsg_core(IObuff);
+    }
 #ifdef ABORT_ON_INTERNAL_ERROR
     abort();
 #endif
@@ -812,7 +800,7 @@ iemsgn(char_u *s, long n)
     void
 internal_error(char *where)
 {
-    IEMSG2(_(e_intern2), where);
+    siemsg(_(e_intern2), where);
 }
 
 /* emsg3() and emsgn() are in misc2.c to avoid warnings for the prototypes. */
@@ -820,7 +808,7 @@ internal_error(char *where)
     void
 emsg_invreg(int name)
 {
-    EMSG2(_("E354: Invalid register name: '%s'"), transchar(name));
+    semsg(_("E354: Invalid register name: '%s'"), transchar(name));
 }
 
 /*
@@ -969,7 +957,7 @@ ex_messages(exarg_T *eap)
 
     if (*eap->arg != NUL)
     {
-	EMSG(_(e_invarg));
+	emsg(_(e_invarg));
 	return;
     }
 
@@ -3473,7 +3461,7 @@ verbose_open(void)
 	verbose_fd = mch_fopen((char *)p_vfile, "a");
 	if (verbose_fd == NULL)
 	{
-	    EMSG2(_(e_notopen), p_vfile);
+	    semsg(_(e_notopen), p_vfile);
 	    return FAIL;
 	}
     }
@@ -4092,7 +4080,7 @@ do_browse(
 # endif
     {
 	/* TODO: non-GUI file selector here */
-	EMSG(_("E338: Sorry, no file browser in console mode"));
+	emsg(_("E338: Sorry, no file browser in console mode"));
 	fname = NULL;
     }
 
@@ -4136,7 +4124,7 @@ tv_nr(typval_T *tvs, int *idxp)
     int		err = FALSE;
 
     if (tvs[idx].v_type == VAR_UNKNOWN)
-	EMSG(_(e_printf));
+	emsg(_(e_printf));
     else
     {
 	++*idxp;
@@ -4163,7 +4151,7 @@ tv_str(typval_T *tvs, int *idxp, char_u 
     static char_u   numbuf[NUMBUFLEN];
 
     if (tvs[idx].v_type == VAR_UNKNOWN)
-	EMSG(_(e_printf));
+	emsg(_(e_printf));
     else
     {
 	++*idxp;
@@ -4186,7 +4174,7 @@ tv_float(typval_T *tvs, int *idxp)
     double	f = 0;
 
     if (tvs[idx].v_type == VAR_UNKNOWN)
-	EMSG(_(e_printf));
+	emsg(_(e_printf));
     else
     {
 	++*idxp;
@@ -4195,7 +4183,7 @@ tv_float(typval_T *tvs, int *idxp)
 	else if (tvs[idx].v_type == VAR_NUMBER)
 	    f = (double)tvs[idx].vval.v_number;
 	else
-	    EMSG(_("E807: Expected Float argument for printf()"));
+	    emsg(_("E807: Expected Float argument for printf()"));
     }
     return f;
 }
@@ -4274,7 +4262,7 @@ infinity_str(int positive,
 
 /* Like vim_vsnprintf() but append to the string. */
     int
-vim_snprintf_add(char *str, size_t str_m, char *fmt, ...)
+vim_snprintf_add(char *str, size_t str_m, const char *fmt, ...)
 {
     va_list	ap;
     int		str_l;
@@ -4292,7 +4280,7 @@ vim_snprintf_add(char *str, size_t str_m
 }
 
     int
-vim_snprintf(char *str, size_t str_m, char *fmt, ...)
+vim_snprintf(char *str, size_t str_m, const char *fmt, ...)
 {
     va_list	ap;
     int		str_l;
@@ -4307,7 +4295,7 @@ vim_snprintf(char *str, size_t str_m, ch
 vim_vsnprintf(
     char	*str,
     size_t	str_m,
-    char	*fmt,
+    const char	*fmt,
     va_list	ap)
 {
     return vim_vsnprintf_typval(str, str_m, fmt, ap, NULL);
@@ -4317,12 +4305,12 @@ vim_vsnprintf(
 vim_vsnprintf_typval(
     char	*str,
     size_t	str_m,
-    char	*fmt,
+    const char	*fmt,
     va_list	ap,
     typval_T	*tvs)
 {
     size_t	str_l = 0;
-    char	*p = fmt;
+    const char	*p = fmt;
     int		arg_idx = 1;
 
     if (p == NULL)
@@ -4370,7 +4358,7 @@ vim_vsnprintf_typval(
 	    char    tmp[TMP_LEN];
 
 	    /* string address in case of string argument */
-	    char    *str_arg;
+	    const char  *str_arg = NULL;
 
 	    /* natural field width of arg without padding and sign */
 	    size_t  str_arg_l;
@@ -4394,7 +4382,6 @@ vim_vsnprintf_typval(
 	    char_u  *tofree = NULL;
 
 
-	    str_arg = NULL;
 	    p++;  /* skip '%' */
 
 	    /* parse flags */
@@ -5239,7 +5226,7 @@ vim_vsnprintf_typval(
     }
 
     if (tvs != NULL && tvs[arg_idx - 1].v_type != VAR_UNKNOWN)
-	EMSG(_("E767: Too many arguments to printf()"));
+	emsg(_("E767: 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/misc1.c
+++ b/src/misc1.c
@@ -2658,7 +2658,7 @@ del_bytes(
     /* If "count" is negative the caller must be doing something wrong. */
     if (count < 1)
     {
-	IEMSGN("E950: Invalid count for del_bytes(): %ld", count);
+	siemsg("E950: Invalid count for del_bytes(): %ld", count);
 	return FAIL;
     }
 
@@ -3521,7 +3521,7 @@ ask_yesno(char_u *str, int direct)
     while (r != 'y' && r != 'n')
     {
 	/* same highlighting as for wait_return */
-	smsg_attr(HL_ATTR(HLF_R), (char_u *)"%s (y/n)?", str);
+	smsg_attr(HL_ATTR(HLF_R), "%s (y/n)?", str);
 	if (direct)
 	    r = get_keystroke();
 	else
@@ -4060,7 +4060,7 @@ init_homedir(void)
 	    if (!mch_chdir((char *)var) && mch_dirname(IObuff, IOSIZE) == OK)
 		var = IObuff;
 	    if (mch_chdir((char *)NameBuff) != 0)
-		EMSG(_(e_prev_dir));
+		emsg(_(e_prev_dir));
 	}
 #endif
 	homedir = vim_strsave(var);
@@ -9942,7 +9942,7 @@ expand_wildcards_eval(
     int		ret = FAIL;
     char_u	*eval_pat = NULL;
     char_u	*exp_pat = *pat;
-    char_u      *ignored_msg;
+    char      *ignored_msg;
     int		usedlen;
 
     if (*exp_pat == '%' || *exp_pat == '#' || *exp_pat == '<')
@@ -11434,7 +11434,7 @@ get_cmd_output(
     /* get a name for the temp file */
     if ((tempname = vim_tempname('o', FALSE)) == NULL)
     {
-	EMSG(_(e_notmp));
+	emsg(_(e_notmp));
 	return NULL;
     }
 
@@ -11465,7 +11465,7 @@ get_cmd_output(
 
     if (fd == NULL)
     {
-	EMSG2(_(e_notopen), tempname);
+	semsg(_(e_notopen), tempname);
 	goto done;
     }
 
@@ -11485,7 +11485,7 @@ get_cmd_output(
 #endif
     if (i != len)
     {
-	EMSG2(_(e_notread), tempname);
+	semsg(_(e_notread), tempname);
 	VIM_CLEAR(buffer);
     }
     else if (ret_len == NULL)
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -920,7 +920,7 @@ alloc_check(unsigned size)
     {
 	/* Don't hide this message */
 	emsg_silent = 0;
-	EMSG(_("E340: Line is becoming too long"));
+	emsg(_("E340: Line is becoming too long"));
 	return NULL;
     }
 #endif
@@ -960,7 +960,7 @@ lalloc(long_u size, int message)
     {
 	/* Don't hide this message */
 	emsg_silent = 0;
-	IEMSGN(_("E341: Internal error: lalloc(%ld, )"), size);
+	siemsg(_("E341: Internal error: lalloc(%ld, )"), size);
 	return NULL;
     }
 
@@ -1079,7 +1079,7 @@ do_outofmem_msg(long_u size)
 	 * message fails, e.g. when setting v:errmsg. */
 	did_outofmem_msg = TRUE;
 
-	EMSGN(_("E342: Out of memory!  (allocating %lu bytes)"), size);
+	semsg(_("E342: Out of memory!  (allocating %lu bytes)"), size);
     }
 }
 
@@ -3272,7 +3272,7 @@ call_shell(char_u *cmd, int opt)
     if (p_verbose > 3)
     {
 	verbose_enter();
-	smsg((char_u *)_("Calling shell to execute: \"%s\""),
+	smsg(_("Calling shell to execute: \"%s\""),
 						    cmd == NULL ? p_sh : cmd);
 	out_char('\n');
 	cursor_on();
@@ -3286,7 +3286,7 @@ call_shell(char_u *cmd, int opt)
 
     if (*p_sh == NUL)
     {
-	EMSG(_(e_shellempty));
+	emsg(_(e_shellempty));
 	retval = -1;
     }
     else
@@ -3538,7 +3538,7 @@ static char * mshape_names[] =
  * ("what" is SHAPE_MOUSE).
  * Returns error message for an illegal option, NULL otherwise.
  */
-    char_u *
+    char *
 parse_shape_opt(int what)
 {
     char_u	*modep;
@@ -3574,9 +3574,9 @@ parse_shape_opt(int what)
 	    commap = vim_strchr(modep, ',');
 
 	    if (colonp == NULL || (commap != NULL && commap < colonp))
-		return (char_u *)N_("E545: Missing colon");
+		return N_("E545: Missing colon");
 	    if (colonp == modep)
-		return (char_u *)N_("E546: Illegal mode");
+		return N_("E546: Illegal mode");
 
 	    /*
 	     * Repeat for all mode's before the colon.
@@ -3602,7 +3602,7 @@ parse_shape_opt(int what)
 				break;
 			if (idx == SHAPE_IDX_COUNT
 				   || (shape_table[idx].used_for & what) == 0)
-			    return (char_u *)N_("E546: Illegal mode");
+			    return N_("E546: Illegal mode");
 			if (len == 2 && modep[0] == 'v' && modep[1] == 'e')
 			    found_ve = TRUE;
 		    }
@@ -3641,7 +3641,7 @@ parse_shape_opt(int what)
 			    if (mshape_names[i] == NULL)
 			    {
 				if (!VIM_ISDIGIT(*p))
-				    return (char_u *)N_("E547: Illegal mouseshape");
+				    return N_("E547: Illegal mouseshape");
 				if (round == 2)
 				    shape_table[idx].mshape =
 					      getdigits(&p) + MSHAPE_NUMBERED;
@@ -3681,12 +3681,12 @@ parse_shape_opt(int what)
 			{
 			    p += len;
 			    if (!VIM_ISDIGIT(*p))
-				return (char_u *)N_("E548: digit expected");
+				return N_("E548: digit expected");
 			    n = getdigits(&p);
 			    if (len == 3)   /* "ver" or "hor" */
 			    {
 				if (n == 0)
-				    return (char_u *)N_("E549: Illegal percentage");
+				    return N_("E549: Illegal percentage");
 				if (round == 2)
 				{
 				    if (TOLOWER_ASC(i) == 'v')
@@ -4385,7 +4385,7 @@ vim_findfile_init(
 	{
 	    if (len + 5 >= MAXPATHL)
 	    {
-		EMSG(_(e_pathtoolong));
+		emsg(_(e_pathtoolong));
 		break;
 	    }
 	    if (STRNCMP(wc_part, "**", 2) == 0)
@@ -4404,7 +4404,7 @@ vim_findfile_init(
 		wc_part = (char_u *)errpt;
 		if (*wc_part != NUL && !vim_ispathsep(*wc_part))
 		{
-		    EMSG2(_("E343: Invalid path: '**[number]' must be at the end of the path or be followed by '%s'."), PATHSEPSTR);
+		    semsg(_("E343: Invalid path: '**[number]' must be at the end of the path or be followed by '%s'."), PATHSEPSTR);
 		    goto error_return;
 		}
 	    }
@@ -4436,7 +4436,7 @@ vim_findfile_init(
     if (STRLEN(search_ctx->ffsc_start_dir)
 			  + STRLEN(search_ctx->ffsc_fix_path) + 3 >= MAXPATHL)
     {
-	EMSG(_(e_pathtoolong));
+	emsg(_(e_pathtoolong));
 	goto error_return;
     }
     STRCPY(ff_expand_buffer, search_ctx->ffsc_start_dir);
@@ -4667,7 +4667,7 @@ vim_findfile(void *search_ctx_arg)
 		if (p_verbose >= 5)
 		{
 		    verbose_enter_scroll();
-		    smsg((char_u *)"Already Searched: %s (%s)",
+		    smsg("Already Searched: %s (%s)",
 				   stackp->ffs_fix_path, stackp->ffs_wc_path);
 		    /* don't overwrite this either */
 		    msg_puts((char_u *)"\n");
@@ -4681,7 +4681,7 @@ vim_findfile(void *search_ctx_arg)
 	    else if (p_verbose >= 5)
 	    {
 		verbose_enter_scroll();
-		smsg((char_u *)"Searching: %s (%s)",
+		smsg("Searching: %s (%s)",
 				   stackp->ffs_fix_path, stackp->ffs_wc_path);
 		/* don't overwrite this either */
 		msg_puts((char_u *)"\n");
@@ -4900,7 +4900,7 @@ vim_findfile(void *search_ctx_arg)
 				    if (p_verbose >= 5)
 				    {
 					verbose_enter_scroll();
-					smsg((char_u *)"Already: %s",
+					smsg("Already: %s",
 								   file_path);
 					/* don't overwrite this either */
 					msg_puts((char_u *)"\n");
@@ -4928,7 +4928,7 @@ vim_findfile(void *search_ctx_arg)
 				if (p_verbose >= 5)
 				{
 				    verbose_enter_scroll();
-				    smsg((char_u *)"HIT: %s", file_path);
+				    smsg("HIT: %s", file_path);
 				    /* don't overwrite this either */
 				    msg_puts((char_u *)"\n");
 				    verbose_leave_scroll();
@@ -5128,7 +5128,7 @@ ff_get_visited_list(
 		if (p_verbose >= 5)
 		{
 		    verbose_enter_scroll();
-		    smsg((char_u *)"ff_get_visited_list: FOUND list for %s",
+		    smsg("ff_get_visited_list: FOUND list for %s",
 								    filename);
 		    /* don't overwrite this either */
 		    msg_puts((char_u *)"\n");
@@ -5145,7 +5145,7 @@ ff_get_visited_list(
     if (p_verbose >= 5)
     {
 	verbose_enter_scroll();
-	smsg((char_u *)"ff_get_visited_list: new list for %s", filename);
+	smsg("ff_get_visited_list: new list for %s", filename);
 	/* don't overwrite this either */
 	msg_puts((char_u *)"\n");
 	verbose_leave_scroll();
@@ -5766,19 +5766,19 @@ find_file_in_path_option(
 	if (first == TRUE)
 	{
 	    if (find_what == FINDFILE_DIR)
-		EMSG2(_("E344: Can't find directory \"%s\" in cdpath"),
+		semsg(_("E344: Can't find directory \"%s\" in cdpath"),
 			ff_file_to_find);
 	    else
-		EMSG2(_("E345: Can't find file \"%s\" in path"),
+		semsg(_("E345: Can't find file \"%s\" in path"),
 			ff_file_to_find);
 	}
 	else
 	{
 	    if (find_what == FINDFILE_DIR)
-		EMSG2(_("E346: No more directory \"%s\" found in cdpath"),
+		semsg(_("E346: No more directory \"%s\" found in cdpath"),
 			ff_file_to_find);
 	    else
-		EMSG2(_("E347: No more file \"%s\" found in path"),
+		semsg(_("E347: No more file \"%s\" found in path"),
 			ff_file_to_find);
 	}
     }
--- a/src/netbeans.c
+++ b/src/netbeans.c
@@ -257,7 +257,7 @@ getConnInfo(char *file, char **host, cha
     {
 	nbdebug(("Wrong access mode for NetBeans connection info file: \"%s\"\n",
 								       file));
-	EMSG2(_("E668: Wrong access mode for NetBeans connection info file: \"%s\""),
+	semsg(_("E668: Wrong access mode for NetBeans connection info file: \"%s\""),
 									file);
 	return FAIL;
     }
@@ -477,7 +477,7 @@ nb_parse_cmd(char_u *cmd)
     if (*verb != ':')
     {
 	nbdebug(("    missing colon: %s\n", cmd));
-	EMSG2("E627: missing colon: %s", cmd);
+	semsg("E627: missing colon: %s", cmd);
 	return;
     }
     ++verb; /* skip colon */
@@ -501,7 +501,7 @@ nb_parse_cmd(char_u *cmd)
     if (isfunc < 0)
     {
 	nbdebug(("    missing ! or / in: %s\n", cmd));
-	EMSG2("E628: missing ! or / in: %s", cmd);
+	semsg("E628: missing ! or / in: %s", cmd);
 	return;
     }
 
@@ -518,7 +518,7 @@ nb_parse_cmd(char_u *cmd)
 	 * so I'm disabling it except for debugging.
 	 */
 	nbdebug(("nb_parse_cmd: Command error for \"%s\"\n", cmd));
-	EMSG("E629: bad return from nb_do_cmd");
+	emsg("E629: bad return from nb_do_cmd");
 #endif
     }
 }
@@ -1032,7 +1032,7 @@ nb_do_cmd(
 	    if (buf == NULL || buf->bufp == NULL)
 	    {
 		nbdebug(("    Invalid buffer identifier in getAnno\n"));
-		EMSG("E652: Invalid buffer identifier in getAnno");
+		emsg("E652: Invalid buffer identifier in getAnno");
 		retval = FAIL;
 	    }
 	    else
@@ -1055,7 +1055,7 @@ nb_do_cmd(
 	    if (buf == NULL || buf->bufp == NULL)
 	    {
 		nbdebug(("    invalid buffer identifier in getLength\n"));
-		EMSG("E632: invalid buffer identifier in getLength");
+		emsg("E632: invalid buffer identifier in getLength");
 		retval = FAIL;
 	    }
 	    else
@@ -1077,7 +1077,7 @@ nb_do_cmd(
 	    if (buf == NULL || buf->bufp == NULL)
 	    {
 		nbdebug(("    invalid buffer identifier in getText\n"));
-		EMSG("E633: invalid buffer identifier in getText");
+		emsg("E633: invalid buffer identifier in getText");
 		retval = FAIL;
 	    }
 	    else
@@ -1141,7 +1141,7 @@ nb_do_cmd(
 	    if (buf == NULL || buf->bufp == NULL)
 	    {
 		nbdebug(("    invalid buffer identifier in remove\n"));
-		EMSG("E634: invalid buffer identifier in remove");
+		emsg("E634: invalid buffer identifier in remove");
 		retval = FAIL;
 	    }
 	    else
@@ -1311,7 +1311,7 @@ nb_do_cmd(
 	    if (buf == NULL || buf->bufp == NULL)
 	    {
 		nbdebug(("    invalid buffer identifier in insert\n"));
-		EMSG("E635: invalid buffer identifier in insert");
+		emsg("E635: invalid buffer identifier in insert");
 		retval = FAIL;
 	    }
 	    else if (args != NULL)
@@ -1471,7 +1471,7 @@ nb_do_cmd(
 	    if (buf == NULL)
 	    {
 		nbdebug(("    invalid buffer identifier in create\n"));
-		EMSG("E636: invalid buffer identifier in create");
+		emsg("E636: invalid buffer identifier in create");
 		return FAIL;
 	    }
 	    VIM_CLEAR(buf->displayname);
@@ -1521,7 +1521,7 @@ nb_do_cmd(
 	    if (buf == NULL)
 	    {
 		nbdebug(("    invalid buffer identifier in startDocumentListen\n"));
-		EMSG("E637: invalid buffer identifier in startDocumentListen");
+		emsg("E637: invalid buffer identifier in startDocumentListen");
 		return FAIL;
 	    }
 	    buf->fireChanges = 1;
@@ -1532,7 +1532,7 @@ nb_do_cmd(
 	    if (buf == NULL)
 	    {
 		nbdebug(("    invalid buffer identifier in stopDocumentListen\n"));
-		EMSG("E638: invalid buffer identifier in stopDocumentListen");
+		emsg("E638: invalid buffer identifier in stopDocumentListen");
 		return FAIL;
 	    }
 	    buf->fireChanges = 0;
@@ -1541,7 +1541,7 @@ nb_do_cmd(
 		if (!buf->bufp->b_netbeans_file)
 		{
 		    nbdebug(("E658: NetBeans connection lost for buffer %ld\n", buf->bufp->b_fnum));
-		    EMSGN(_("E658: NetBeans connection lost for buffer %ld"),
+		    semsg(_("E658: NetBeans connection lost for buffer %ld"),
 							   buf->bufp->b_fnum);
 		}
 		else
@@ -1561,7 +1561,7 @@ nb_do_cmd(
 	    if (buf == NULL)
 	    {
 		nbdebug(("    invalid buffer identifier in setTitle\n"));
-		EMSG("E639: invalid buffer identifier in setTitle");
+		emsg("E639: invalid buffer identifier in setTitle");
 		return FAIL;
 	    }
 	    vim_free(buf->displayname);
@@ -1573,7 +1573,7 @@ nb_do_cmd(
 	    if (buf == NULL || buf->bufp == NULL)
 	    {
 		nbdebug(("    invalid buffer identifier in initDone\n"));
-		EMSG("E640: invalid buffer identifier in initDone");
+		emsg("E640: invalid buffer identifier in initDone");
 		return FAIL;
 	    }
 	    do_update = 1;
@@ -1594,7 +1594,7 @@ nb_do_cmd(
 	    if (buf == NULL)
 	    {
 		nbdebug(("    invalid buffer identifier in setBufferNumber\n"));
-		EMSG("E641: invalid buffer identifier in setBufferNumber");
+		emsg("E641: invalid buffer identifier in setBufferNumber");
 		return FAIL;
 	    }
 	    path = (char_u *)nb_unquote(args, NULL);
@@ -1605,7 +1605,7 @@ nb_do_cmd(
 	    if (bufp == NULL)
 	    {
 		nbdebug(("    File %s not found in setBufferNumber\n", args));
-		EMSG2("E642: File %s not found in setBufferNumber", args);
+		semsg("E642: File %s not found in setBufferNumber", args);
 		return FAIL;
 	    }
 	    buf->bufp = bufp;
@@ -1630,7 +1630,7 @@ nb_do_cmd(
 	    if (buf == NULL)
 	    {
 		nbdebug(("    invalid buffer identifier in setFullName\n"));
-		EMSG("E643: invalid buffer identifier in setFullName");
+		emsg("E643: invalid buffer identifier in setFullName");
 		return FAIL;
 	    }
 	    vim_free(buf->displayname);
@@ -1653,7 +1653,7 @@ nb_do_cmd(
 	    if (buf == NULL)
 	    {
 		nbdebug(("    invalid buffer identifier in editFile\n"));
-		EMSG("E644: invalid buffer identifier in editFile");
+		emsg("E644: invalid buffer identifier in editFile");
 		return FAIL;
 	    }
 	    /* Edit a file: like create + setFullName + read the file. */
@@ -1681,7 +1681,7 @@ nb_do_cmd(
 		/* This message was commented out, probably because it can
 		 * happen when shutting down. */
 		if (p_verbose > 0)
-		    EMSG("E645: invalid buffer identifier in setVisible");
+		    emsg("E645: invalid buffer identifier in setVisible");
 		return FAIL;
 	    }
 	    if (streq((char *)args, "T") && buf->bufp != curbuf)
@@ -1721,7 +1721,7 @@ nb_do_cmd(
 		/* This message was commented out, probably because it can
 		 * happen when shutting down. */
 		if (p_verbose > 0)
-		    EMSG("E646: invalid buffer identifier in setModified");
+		    emsg("E646: invalid buffer identifier in setModified");
 		return FAIL;
 	    }
 	    prev_b_changed = buf->bufp->b_changed;
@@ -1803,7 +1803,7 @@ nb_do_cmd(
 	    if (buf == NULL || buf->bufp == NULL)
 	    {
 		nbdebug(("    invalid buffer identifier in setDot\n"));
-		EMSG("E647: invalid buffer identifier in setDot");
+		emsg("E647: invalid buffer identifier in setDot");
 		return FAIL;
 	    }
 
@@ -1856,7 +1856,7 @@ nb_do_cmd(
 	    if (buf == NULL)
 	    {
 		nbdebug(("    invalid buffer identifier in close\n"));
-		EMSG("E648: invalid buffer identifier in close");
+		emsg("E648: invalid buffer identifier in close");
 		return FAIL;
 	    }
 
@@ -1870,7 +1870,7 @@ nb_do_cmd(
 		/* This message was commented out, probably because it can
 		 * happen when shutting down. */
 		if (p_verbose > 0)
-		    EMSG("E649: invalid buffer identifier in close");
+		    emsg("E649: invalid buffer identifier in close");
 	    }
 	    nbdebug(("    CLOSE %d: %s\n", bufno, name));
 #ifdef FEAT_GUI
@@ -1909,7 +1909,7 @@ nb_do_cmd(
 	    if (buf == NULL)
 	    {
 		nbdebug(("    invalid buffer identifier in defineAnnoType\n"));
-		EMSG("E650: invalid buffer identifier in defineAnnoType");
+		emsg("E650: invalid buffer identifier in defineAnnoType");
 		return FAIL;
 	    }
 
@@ -1937,7 +1937,7 @@ nb_do_cmd(
 	    bg = vim_strsave(p);
 	    if (STRLEN(fg) > MAX_COLOR_LENGTH || STRLEN(bg) > MAX_COLOR_LENGTH)
 	    {
-		EMSG("E532: highlighting color name too long in defineAnnoType");
+		emsg("E532: highlighting color name too long in defineAnnoType");
 		vim_free(typeName);
 		parse_error = TRUE;
 	    }
@@ -1968,7 +1968,7 @@ nb_do_cmd(
 	    if (buf == NULL || buf->bufp == NULL)
 	    {
 		nbdebug(("    invalid buffer identifier in addAnno\n"));
-		EMSG("E651: invalid buffer identifier in addAnno");
+		emsg("E651: invalid buffer identifier in addAnno");
 		return FAIL;
 	    }
 
@@ -2352,7 +2352,7 @@ ex_nbstart(
 		&& !defined(FEAT_GUI_W32)
     if (gui.in_use)
     {
-	EMSG(_("E838: netbeans is not supported with this GUI"));
+	emsg(_("E838: netbeans is not supported with this GUI"));
 	return;
     }
 # endif
@@ -2517,7 +2517,7 @@ netbeans_open(char *params, int doabort)
 
     if (NETBEANS_OPEN)
     {
-	EMSG(_("E511: netbeans already connected"));
+	emsg(_("E511: netbeans already connected"));
 	return;
     }
 
@@ -3482,10 +3482,10 @@ print_save_msg(nbbuf_T *buf, off_T nchar
     }
     else
     {
-	char_u msgbuf[IOSIZE];
-
-	vim_snprintf((char *)msgbuf, IOSIZE,
-		_("E505: %s is read-only (add ! to override)"), IObuff);
+	char msgbuf[IOSIZE];
+
+	vim_snprintf(msgbuf, IOSIZE,
+		       _("E505: %s is read-only (add ! to override)"), IObuff);
 	nbdebug(("    %s\n", msgbuf));
 	emsg(msgbuf);
     }
--- a/src/normal.c
+++ b/src/normal.c
@@ -2211,7 +2211,7 @@ op_function(oparg_T *oap UNUSED)
 # endif
 
     if (*p_opfunc == NUL)
-	EMSG(_("E774: 'operatorfunc' is empty"));
+	emsg(_("E774: 'operatorfunc' is empty"));
     else
     {
 	/* Set '[ and '] marks to text to be operated on. */
@@ -2243,7 +2243,7 @@ op_function(oparg_T *oap UNUSED)
 # endif
     }
 #else
-    EMSG(_("E775: Eval feature not available"));
+    emsg(_("E775: Eval feature not available"));
 #endif
 }
 
@@ -3542,9 +3542,9 @@ find_ident_at_pos(
 	 * didn't find an identifier or string
 	 */
 	if (find_type & FIND_STRING)
-	    EMSG(_("E348: No string under cursor"));
+	    emsg(_("E348: No string under cursor"));
 	else
-	    EMSG(_(e_noident));
+	    emsg(_(e_noident));
 	return 0;
     }
     ptr += col;
@@ -5016,7 +5016,7 @@ dozet:
 		    deleteFold((linenr_T)1, curbuf->b_ml.ml_line_count,
 								 TRUE, FALSE);
 		else
-		    EMSG(_("E352: Cannot erase folds with current 'foldmethod'"));
+		    emsg(_("E352: Cannot erase folds with current 'foldmethod'"));
 		break;
 
 		/* "zn": fold none: reset 'foldenable' */
@@ -5616,7 +5616,7 @@ nv_ident(cmdarg_T *cap)
 						 || STRCMP(kp, ":help") == 0);
     if (kp_help && *skipwhite(ptr) == NUL)
     {
-	EMSG(_(e_noident));	 /* found white space only */
+	emsg(_(e_noident));	 /* found white space only */
 	return;
     }
     kp_ex = (*kp == ':');
@@ -5667,7 +5667,7 @@ nv_ident(cmdarg_T *cap)
 		}
 		if (n == 0)
 		{
-		    EMSG(_(e_noident));	 /* found dashes only */
+		    emsg(_(e_noident));	 /* found dashes only */
 		    vim_free(buf);
 		    return;
 		}
@@ -7275,7 +7275,7 @@ nv_Replace(cmdarg_T *cap)
     else if (!checkclearopq(cap->oap))
     {
 	if (!curbuf->b_p_ma)
-	    EMSG(_(e_modifiable));
+	    emsg(_(e_modifiable));
 	else
 	{
 #ifdef FEAT_VIRTUALEDIT
@@ -7302,7 +7302,7 @@ nv_vreplace(cmdarg_T *cap)
     else if (!checkclearopq(cap->oap))
     {
 	if (!curbuf->b_p_ma)
-	    EMSG(_(e_modifiable));
+	    emsg(_(e_modifiable));
 	else
 	{
 	    if (cap->extra_char == Ctrl_V)	/* get another character */
@@ -7629,11 +7629,11 @@ nv_pcmark(cmdarg_T *cap)
 	else if (cap->cmdchar == 'g')
 	{
 	    if (curbuf->b_changelistlen == 0)
-		EMSG(_("E664: changelist is empty"));
+		emsg(_("E664: changelist is empty"));
 	    else if (cap->count1 < 0)
-		EMSG(_("E662: At start of changelist"));
+		emsg(_("E662: At start of changelist"));
 	    else
-		EMSG(_("E663: At end of changelist"));
+		emsg(_("E663: At end of changelist"));
 	}
 	else
 	    clearopbeep(cap->oap);
@@ -8514,14 +8514,14 @@ n_opencmd(cmdarg_T *cap)
 	    if (curwin->w_p_cole > 0 && oldline != curwin->w_cursor.lnum)
 		redrawWinline(curwin, oldline);
 #endif
-	    /* When '#' is in 'cpoptions' ignore the count. */
-	    if (vim_strchr(p_cpo, CPO_HASH) != NULL)
-		cap->count1 = 1;
 #ifdef FEAT_SYN_HL
 	    if (curwin->w_p_cul)
 		/* force redraw of cursorline */
 		curwin->w_valid &= ~VALID_CROW;
 #endif
+	    /* When '#' is in 'cpoptions' ignore the count. */
+	    if (vim_strchr(p_cpo, CPO_HASH) != NULL)
+		cap->count1 = 1;
 	    invoke_edit(cap, FALSE, cap->cmdchar, TRUE);
 	}
     }
@@ -9107,7 +9107,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_modifiable));
 	clearop(cap->oap);
 	if (cap->cmdchar == K_PS)
 	    /* drop the pasted text */
--- a/src/ops.c
+++ b/src/ops.c
@@ -712,7 +712,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_modifiable));
 	return;
     }
 
@@ -724,7 +724,7 @@ op_reindent(oparg_T *oap, int (*how)(voi
 	if (i > 1
 		&& (i % 50 == 0 || i == oap->line_count - 1)
 		&& oap->line_count > p_report)
-	    smsg((char_u *)_("%ld lines to indent... "), i);
+	    smsg(_("%ld lines to indent... "), i);
 
 	/*
 	 * Be vi-compatible: For lisp indenting the first line is not
@@ -770,7 +770,7 @@ op_reindent(oparg_T *oap, int (*how)(voi
     if (oap->line_count > p_report)
     {
 	i = oap->line_count - (i + 1);
-	smsg((char_u *)NGETTEXT("%ld line indented ",
+	smsg(NGETTEXT("%ld line indented ",
 						 "%ld lines indented ", i), i);
     }
     /* set '[ and '] marks */
@@ -1218,7 +1218,7 @@ do_execreg(
     {
 	if (execreg_lastc == NUL)
 	{
-	    EMSG(_("E748: No previously used register"));
+	    emsg(_("E748: No previously used register"));
 	    return FAIL;
 	}
 	regname = execreg_lastc;
@@ -1243,7 +1243,7 @@ do_execreg(
     {
 	if (last_cmdline == NULL)
 	{
-	    EMSG(_(e_nolastcmd));
+	    emsg(_(e_nolastcmd));
 	    return FAIL;
 	}
 	VIM_CLEAR(new_last_cmdline); /* don't keep the cmdline containing @: */
@@ -1277,7 +1277,7 @@ do_execreg(
 	p = get_last_insert_save();
 	if (p == NULL)
 	{
-	    EMSG(_(e_noinstext));
+	    emsg(_(e_noinstext));
 	    return FAIL;
 	}
 	retval = put_in_typebuf(p, FALSE, colon, silent);
@@ -1535,13 +1535,13 @@ get_spec_reg(
 
 	case ':':		/* last command line */
 	    if (last_cmdline == NULL && errmsg)
-		EMSG(_(e_nolastcmd));
+		emsg(_(e_nolastcmd));
 	    *argp = last_cmdline;
 	    return TRUE;
 
 	case '/':		/* last search-pattern */
 	    if (last_search_pat() == NULL && errmsg)
-		EMSG(_(e_noprevre));
+		emsg(_(e_noprevre));
 	    *argp = last_search_pat();
 	    return TRUE;
 
@@ -1549,7 +1549,7 @@ get_spec_reg(
 	    *argp = get_last_insert_save();
 	    *allocated = TRUE;
 	    if (*argp == NULL && errmsg)
-		EMSG(_(e_noinstext));
+		emsg(_(e_noinstext));
 	    return TRUE;
 
 #ifdef FEAT_SEARCHPATH
@@ -1761,7 +1761,7 @@ op_delete(oparg_T *oap)
 
     if (!curbuf->b_p_ma)
     {
-	EMSG(_(e_modifiable));
+	emsg(_(e_modifiable));
 	return FAIL;
     }
 
@@ -1884,7 +1884,7 @@ op_delete(oparg_T *oap)
 	    msg_silent = msg_silent_save;
 	    if (n != 'y')
 	    {
-		EMSG(_(e_abort));
+		emsg(_(e_abort));
 		return FAIL;
 	    }
 	}
@@ -2506,7 +2506,7 @@ op_tilde(oparg_T *oap)
     curbuf->b_op_end = oap->end;
 
     if (oap->line_count > p_report)
-	smsg((char_u *)NGETTEXT("%ld line changed", "%ld lines changed",
+	smsg(NGETTEXT("%ld line changed", "%ld lines changed",
 					    oap->line_count), oap->line_count);
 }
 
@@ -3038,7 +3038,7 @@ free_yank(long n)
 		 * Overwrite this message with any next message.
 		 */
 		++no_wait_return;
-		smsg((char_u *)_("freeing %ld lines"), i + 1);
+		smsg(_("freeing %ld lines"), i + 1);
 		--no_wait_return;
 		msg_didout = FALSE;
 		msg_col = 0;
@@ -3325,13 +3325,13 @@ op_yank(oparg_T *oap, int deleting, int 
 	    update_topline_redraw();
 	    if (oap->block_mode)
 	    {
-		smsg((char_u *)NGETTEXT("block of %ld line yanked%s",
+		smsg(NGETTEXT("block of %ld line yanked%s",
 				     "block of %ld lines yanked%s", yanklines),
 			yanklines, namebuf);
 	    }
 	    else
 	    {
-		smsg((char_u *)NGETTEXT("%ld line yanked%s",
+		smsg(NGETTEXT("%ld line yanked%s",
 					      "%ld lines yanked%s", yanklines),
 			yanklines, namebuf);
 	    }
@@ -3649,7 +3649,7 @@ do_put(
 
     if (y_size == 0 || y_array == NULL)
     {
-	EMSG2(_("E353: Nothing in register %s"),
+	semsg(_("E353: Nothing in register %s"),
 		  regname == 0 ? (char_u *)"\"" : transchar(regname));
 	goto end;
     }
@@ -5646,7 +5646,7 @@ op_addsub(
 	    curbuf->b_op_start = startpos;
 
 	if (change_cnt > p_report)
-	    smsg((char_u *)NGETTEXT("%ld line changed", "%ld lines changed",
+	    smsg(NGETTEXT("%ld line changed", "%ld lines changed",
 						      change_cnt), change_cnt);
     }
 }
@@ -6423,9 +6423,7 @@ write_viminfo_registers(FILE *fp)
 		type = (char_u *)"BLOCK";
 		break;
 	    default:
-		sprintf((char *)IObuff, _("E574: Unknown register type %d"),
-							    y_ptr->y_type);
-		emsg(IObuff);
+		semsg(_("E574: Unknown register type %d"), y_ptr->y_type);
 		type = (char_u *)"LINE";
 		break;
 	}
@@ -7054,7 +7052,7 @@ write_reg_contents_lst(
 	    s = (char_u *)"";
 	else if (strings[1] != NULL)
 	{
-	    EMSG(_("E883: search pattern and expression register may not "
+	    emsg(_("E883: search pattern and expression register may not "
 			"contain two or more lines"));
 	    return;
 	}
@@ -7110,7 +7108,7 @@ write_reg_contents_ex(
 
 	    buf = buflist_findnr(num);
 	    if (buf == NULL)
-		EMSGN(_(e_nobufnr), (long)num);
+		semsg(_(e_nobufnr), (long)num);
 	}
 	else
 	    buf = buflist_findnr(buflist_findpat(str, str + STRLEN(str),
--- a/src/option.c
+++ b/src/option.c
@@ -3295,20 +3295,20 @@ static long_u *insecure_flag(int opt_idx
 # define insecure_flag(opt_idx, opt_flags) (&options[opt_idx].flags)
 #endif
 static void set_string_option_global(int opt_idx, char_u **varp);
-static char_u *did_set_string_option(int opt_idx, char_u **varp, int new_value_alloced, char_u *oldval, char_u *errbuf, int opt_flags, int *value_checked);
-static char_u *set_chars_option(char_u **varp);
+static char *did_set_string_option(int opt_idx, char_u **varp, int new_value_alloced, char_u *oldval, char *errbuf, int opt_flags, int *value_checked);
+static char *set_chars_option(char_u **varp);
 #ifdef FEAT_CLIPBOARD
-static char_u *check_clipboard_option(void);
+static char *check_clipboard_option(void);
 #endif
 #ifdef FEAT_SPELL
-static char_u *did_set_spell_option(int is_spellfile);
-static char_u *compile_cap_prog(synblock_T *synblock);
+static char *did_set_spell_option(int is_spellfile);
+static char *compile_cap_prog(synblock_T *synblock);
 #endif
 #ifdef FEAT_EVAL
 static void set_option_sctx_idx(int opt_idx, int opt_flags, sctx_T script_ctx);
 #endif
-static char_u *set_bool_option(int opt_idx, char_u *varp, int value, int opt_flags);
-static char_u *set_num_option(int opt_idx, char_u *varp, long value, char_u *errbuf, size_t errbuflen, int opt_flags);
+static char *set_bool_option(int opt_idx, char_u *varp, int value, int opt_flags);
+static char *set_num_option(int opt_idx, char_u *varp, long value, char *errbuf, size_t errbuflen, int opt_flags);
 static void check_redraw(long_u flags);
 static int findoption(char_u *);
 static int find_key_option(char_u *arg_arg, int has_lt);
@@ -3708,11 +3708,7 @@ set_init_1(int clean_arg)
 	    }
 
 #if defined(MSWIN) || defined(MACOS_X) || defined(VMS)
-	    if (STRCMP(p_enc, "latin1") == 0
-# ifdef FEAT_MBYTE
-		    || enc_utf8
-# endif
-		    )
+	    if (STRCMP(p_enc, "latin1") == 0 || enc_utf8)
 	    {
 		/* Adjust the default for 'isprint' and 'iskeyword' to match
 		 * latin1.  Also set the defaults for when 'nocompatible' is
@@ -4393,8 +4389,8 @@ do_set(
     int		opt_flags)
 {
     int		opt_idx;
-    char_u	*errmsg;
-    char_u	errbuf[80];
+    char	*errmsg;
+    char	errbuf[80];
     char_u	*startarg;
     int		prefix;	/* 1: nothing, 0: "no", 2: "inv" in front of name */
     int		nextchar;	    /* next non-white char after option name */
@@ -4546,7 +4542,7 @@ do_set(
 
 	    if (opt_idx == -1 && key == 0)	/* found a mismatch: skip */
 	    {
-		errmsg = (char_u *)N_("E518: Unknown option");
+		errmsg = N_("E518: Unknown option");
 		goto skip;
 	    }
 
@@ -4559,7 +4555,7 @@ do_set(
 		    if (vim_strchr((char_u *)"=:!&<", nextchar) == NULL
 			    && (!(options[opt_idx].flags & P_BOOL)
 				|| nextchar == '?'))
-			errmsg = (char_u *)N_("E519: Option not supported");
+			errmsg = N_("E519: Option not supported");
 		    goto skip;
 		}
 
@@ -4597,7 +4593,7 @@ do_set(
 	    {
 		if (flags & (P_SECURE | P_NO_ML))
 		{
-		    errmsg = (char_u *)_("E520: Not allowed in a modeline");
+		    errmsg = _("E520: Not allowed in a modeline");
 		    goto skip;
 		}
 #ifdef FEAT_DIFF
@@ -4619,7 +4615,7 @@ do_set(
 	    /* Disallow changing some options in the sandbox */
 	    if (sandbox != 0 && (flags & P_SECURE))
 	    {
-		errmsg = (char_u *)_(e_sandbox);
+		errmsg = _(e_sandbox);
 		goto skip;
 	    }
 #endif
@@ -4693,7 +4689,7 @@ do_set(
 		    p = find_termcode(key_name);
 		    if (p == NULL)
 		    {
-			errmsg = (char_u *)N_("E846: Key code not set");
+			errmsg = N_("E846: Key code not set");
 			goto skip;
 		    }
 		    else
@@ -4822,7 +4818,7 @@ do_set(
 			}
 			else
 			{
-			    errmsg = (char_u *)N_("E521: Number required after =");
+			    errmsg = N_("E521: Number required after =");
 			    goto skip;
 			}
 
@@ -4923,7 +4919,7 @@ do_set(
 			    {
 				STRCPY(errbuf, ":help");
 				save_arg = arg;
-				arg = errbuf;
+				arg = (char_u *)errbuf;
 			    }
 			    /*
 			     * Convert 'backspace' number to string, for
@@ -4975,7 +4971,7 @@ do_set(
 				if (*errbuf != NUL)	/* remove trailing , */
 				    errbuf[STRLEN(errbuf) - 1] = NUL;
 				save_arg = arg;
-				arg = errbuf;
+				arg = (char_u *)errbuf;
 			    }
 			    /*
 			     * Remove '>' before 'dir' and 'bdir', for
@@ -5259,7 +5255,7 @@ do_set(
 			if (nextchar == '&')
 			{
 			    if (add_termcap_entry(key_name, TRUE) == FAIL)
-				errmsg = (char_u *)N_("E522: Not found in termcap");
+				errmsg = N_("E522: Not found in termcap");
 			}
 			else
 			{
@@ -5315,8 +5311,8 @@ skip:
 	    /* make sure all characters are printable */
 	    trans_characters(IObuff, IOSIZE);
 
-	    ++no_wait_return;	/* wait_return done later */
-	    emsg(IObuff);	/* show error highlighted */
+	    ++no_wait_return;		// wait_return done later
+	    emsg((char *)IObuff);	// show error highlighted
 	    --no_wait_return;
 
 	    return FAIL;
@@ -5371,11 +5367,11 @@ did_set_option(
 	*p = *p & ~P_INSECURE;
 }
 
-    static char_u *
-illegal_char(char_u *errbuf, int c)
+    static char *
+illegal_char(char *errbuf, int c)
 {
     if (errbuf == NULL)
-	return (char_u *)"";
+	return "";
     sprintf((char *)errbuf, _("E539: Illegal character <%s>"),
 							(char *)transchar(c));
     return errbuf;
@@ -5403,7 +5399,7 @@ string_to_key(char_u *arg, int multi_byt
  * Check value of 'cedit' and set cedit_key.
  * Returns NULL if value is OK, error message otherwise.
  */
-    static char_u *
+    static char *
 check_cedit(void)
 {
     int n;
@@ -5945,8 +5941,8 @@ set_string_option_direct(
 	idx = findoption(name);
 	if (idx < 0)	/* not found (should not happen) */
 	{
-	    EMSG2(_(e_intern2), "set_string_option_direct()");
-	    IEMSG2(_("For option %s"), name);
+	    semsg(_(e_intern2), "set_string_option_direct()");
+	    siemsg(_("For option %s"), name);
 	    return;
 	}
     }
@@ -6024,7 +6020,7 @@ set_string_option_global(
  *
  * Returns NULL on success or error message on error.
  */
-    static char_u *
+    static char *
 set_string_option(
     int		opt_idx,
     char_u	*value,
@@ -6037,7 +6033,7 @@ set_string_option(
     char_u	*saved_oldval = NULL;
     char_u	*saved_newval = NULL;
 #endif
-    char_u	*r = NULL;
+    char	*r = NULL;
     int		value_checked = FALSE;
 
     if (options[opt_idx].var == NULL)	/* don't set hidden option */
@@ -6100,18 +6096,18 @@ valid_filetype(char_u *val)
  * Handle string options that need some action to perform when changed.
  * Returns NULL for success, or an error message for an error.
  */
-    static char_u *
+    static char *
 did_set_string_option(
     int		opt_idx,		// index in options[] table
     char_u	**varp,			// pointer to the option variable
     int		new_value_alloced,	// new value was allocated
     char_u	*oldval,		// previous value of the option
-    char_u	*errbuf,		// buffer for errors, or NULL
+    char	*errbuf,		// buffer for errors, or NULL
     int		opt_flags,		// OPT_LOCAL and/or OPT_GLOBAL
     int		*value_checked)		// value was checked to be save, no
 					// need to set P_INSECURE
 {
-    char_u	*errmsg = NULL;
+    char	*errmsg = NULL;
     char_u	*s, *p;
     int		did_chartab = FALSE;
     char_u	**gvarp;
@@ -6155,15 +6151,15 @@ did_set_string_option(
     else if (varp == &T_NAME)
     {
 	if (T_NAME[0] == NUL)
-	    errmsg = (char_u *)N_("E529: Cannot set 'term' to empty string");
+	    errmsg = N_("E529: Cannot set 'term' to empty string");
 #ifdef FEAT_GUI
 	if (gui.in_use)
-	    errmsg = (char_u *)N_("E530: Cannot change term in GUI");
+	    errmsg = N_("E530: Cannot change term in GUI");
 	else if (term_is_gui(T_NAME))
-	    errmsg = (char_u *)N_("E531: Use \":gui\" to start the GUI");
+	    errmsg = N_("E531: Use \":gui\" to start the GUI");
 #endif
 	else if (set_termname(T_NAME) == FAIL)
-	    errmsg = (char_u *)N_("E522: Not found in termcap");
+	    errmsg = N_("E522: Not found in termcap");
 	else
 	{
 	    /* Screen colors may have changed. */
@@ -6211,7 +6207,7 @@ did_set_string_option(
     {
 	if (STRCMP(*p_bex == '.' ? p_bex + 1 : p_bex,
 		     *p_pm == '.' ? p_pm + 1 : p_pm) == 0)
-	    errmsg = (char_u *)N_("E589: 'backupext' and 'patchmode' are equal");
+	    errmsg = N_("E589: 'backupext' and 'patchmode' are equal");
     }
 #ifdef FEAT_LINEBREAK
     /* 'breakindentopt' */
@@ -6328,9 +6324,9 @@ did_set_string_option(
 	if (check_opt_strings(p_ambw, p_ambw_values, FALSE) != OK)
 	    errmsg = e_invarg;
 	else if (set_chars_option(&p_lcs) != NULL)
-	    errmsg = (char_u *)_("E834: Conflicts with value of 'listchars'");
+	    errmsg = _("E834: Conflicts with value of 'listchars'");
 	else if (set_chars_option(&p_fcs) != NULL)
-	    errmsg = (char_u *)_("E835: Conflicts with value of 'fillchars'");
+	    errmsg = _("E835: Conflicts with value of 'fillchars'");
     }
 #endif
 
@@ -6454,7 +6450,7 @@ did_set_string_option(
 	{
 	    /* GTK+ 2 uses only a single encoding, and that is UTF-8. */
 	    if (STRCMP(p_tenc, "utf-8") != 0)
-		errmsg = (char_u *)N_("E617: Cannot be changed in the GTK+ 2 GUI");
+		errmsg = N_("E617: Cannot be changed in the GTK+ 2 GUI");
 	}
 # endif
 
@@ -6475,7 +6471,7 @@ did_set_string_option(
 		if (convert_setup(&input_conv, p_tenc, p_enc) == FAIL
 			|| convert_setup(&output_conv, p_enc, p_tenc) == FAIL)
 		{
-		    EMSG3(_("E950: Cannot convert between %s and %s"),
+		    semsg(_("E950: Cannot convert between %s and %s"),
 			    p_tenc, p_enc);
 		    errmsg = e_invarg;
 		}
@@ -6748,9 +6744,9 @@ did_set_string_option(
 		++s;
 	    }
 	    if (*s++ == NUL)
-		errmsg = (char_u *)N_("E524: Missing colon");
+		errmsg = N_("E524: Missing colon");
 	    else if (*s == ',' || *s == NUL)
-		errmsg = (char_u *)N_("E525: Zero length string");
+		errmsg = N_("E525: Zero length string");
 	    if (errmsg != NULL)
 		break;
 	    while (*s && *s != ',')
@@ -6830,13 +6826,12 @@ did_set_string_option(
 		{
 		    if (errbuf != NULL)
 		    {
-			sprintf((char *)errbuf,
-					 _("E526: Missing number after <%s>"),
+			sprintf(errbuf, _("E526: Missing number after <%s>"),
 						    transchar_byte(*(s - 1)));
 			errmsg = errbuf;
 		    }
 		    else
-			errmsg = (char_u *)"";
+			errmsg = "";
 		    break;
 		}
 	    }
@@ -6845,14 +6840,14 @@ did_set_string_option(
 	    else if (*s)
 	    {
 		if (errbuf != NULL)
-		    errmsg = (char_u *)N_("E527: Missing comma");
+		    errmsg = N_("E527: Missing comma");
 		else
-		    errmsg = (char_u *)"";
+		    errmsg = "";
 		break;
 	    }
 	}
 	if (*p_viminfo && errmsg == NULL && get_viminfo_parameter('\'') < 0)
-	    errmsg = (char_u *)N_("E528: Must specify a ' value");
+	    errmsg = N_("E528: Must specify a ' value");
     }
 #endif /* FEAT_VIMINFO */
 
@@ -6917,7 +6912,7 @@ did_set_string_option(
 	for (s = p_sbr; *s; )
 	{
 	    if (ptr2cells(s) != 1)
-		errmsg = (char_u *)N_("E595: contains unprintable or wide character");
+		errmsg = N_("E595: contains unprintable or wide character");
 	    MB_PTR_ADV(s);
 	}
     }
@@ -6961,7 +6956,7 @@ did_set_string_option(
 		}
 		else
 # endif
-		    errmsg = (char_u *)N_("E596: Invalid font(s)");
+		    errmsg = N_("E596: Invalid font(s)");
 	    }
 	}
 	redraw_gui_only = TRUE;
@@ -6980,9 +6975,9 @@ did_set_string_option(
     else if (varp == &p_guifontwide)
     {
 	if (STRCMP(p_guifontwide, "*") == 0)
-	    errmsg = (char_u *)N_("E533: can't select wide font");
+	    errmsg = N_("E533: can't select wide font");
 	else if (gui_get_wide_font() == FAIL)
-	    errmsg = (char_u *)N_("E534: Invalid wide font");
+	    errmsg = N_("E534: Invalid wide font");
 	redraw_gui_only = TRUE;
     }
 # endif
@@ -7285,7 +7280,7 @@ did_set_string_option(
 			errmsg = errbuf;
 		    }
 		    else
-			errmsg = (char_u *)"";
+			errmsg = "";
 		    break;
 		}
 	    }
@@ -7445,7 +7440,7 @@ did_set_string_option(
     {
 	p = vim_strchr(*varp, ',');
 	if (p == NULL)
-	    errmsg = (char_u *)N_("E536: comma required");
+	    errmsg = N_("E536: comma required");
 	else if (p == *varp || p[1] == NUL)
 	    errmsg = e_invarg;
 	else if (foldmethodIsMarker(curwin))
@@ -7455,7 +7450,7 @@ did_set_string_option(
     else if (gvarp == &p_cms)
     {
 	if (**varp != NUL && strstr((char *)*varp, "%s") == NULL)
-	    errmsg = (char_u *)N_("E537: 'commentstring' must be empty or contain %s");
+	    errmsg = N_("E537: 'commentstring' must be empty or contain %s");
     }
     /* 'foldopen' */
     else if (varp == &p_fdo)
@@ -7878,7 +7873,7 @@ int_cmp(const void *a, const void *b)
  * Handle setting 'colorcolumn' or 'textwidth' in window "wp".
  * Returns error message, NULL if it's OK.
  */
-    char_u *
+    char *
 check_colorcolumn(win_T *wp)
 {
     char_u	*s;
@@ -7949,7 +7944,7 @@ skip:
  * Handle setting 'listchars' or 'fillchars'.
  * Returns error message, NULL if it's OK.
  */
-    static char_u *
+    static char *
 set_chars_option(char_u **varp)
 {
     int		round, i, len, entries;
@@ -8075,12 +8070,12 @@ set_chars_option(char_u **varp)
  * Check validity of options with the 'statusline' format.
  * Return error message or NULL.
  */
-    char_u *
+    char *
 check_stl_option(char_u *s)
 {
     int		itemcnt = 0;
     int		groupdepth = 0;
-    static char_u   errbuf[80];
+    static char errbuf[80];
 
     while (*s && itemcnt < STL_MAX_ITEM)
     {
@@ -8131,13 +8126,13 @@ check_stl_option(char_u *s)
 	    while (*s != '}' && *s)
 		s++;
 	    if (*s != '}')
-		return (char_u *)N_("E540: Unclosed expression sequence");
+		return N_("E540: Unclosed expression sequence");
 	}
     }
     if (itemcnt >= STL_MAX_ITEM)
-	return (char_u *)N_("E541: too many items");
+	return N_("E541: too many items");
     if (groupdepth != 0)
-	return (char_u *)N_("E542: unbalanced groups");
+	return N_("E542: unbalanced groups");
     return NULL;
 }
 #endif
@@ -8145,8 +8140,9 @@ check_stl_option(char_u *s)
 #ifdef FEAT_CLIPBOARD
 /*
  * Extract the items in the 'clipboard' option and set global values.
- */
-    static char_u *
+ * Return an error message or NULL for success.
+ */
+    static char *
 check_clipboard_option(void)
 {
     int		new_unnamed = 0;
@@ -8155,7 +8151,7 @@ check_clipboard_option(void)
     int		new_autoselectml = FALSE;
     int		new_html = FALSE;
     regprog_T	*new_exclude_prog = NULL;
-    char_u	*errmsg = NULL;
+    char	*errmsg = NULL;
     char_u	*p;
 
     for (p = p_cb; *p != NUL; )
@@ -8235,10 +8231,14 @@ check_clipboard_option(void)
 #endif
 
 #ifdef FEAT_SPELL
-    static char_u *
+/*
+ * Handle side effects of setting 'spell'.
+ * Return an error message or NULL for success.
+ */
+    static char *
 did_set_spell_option(int is_spellfile)
 {
-    char_u  *errmsg = NULL;
+    char    *errmsg = NULL;
     win_T   *wp;
     int	    l;
 
@@ -8266,7 +8266,7 @@ did_set_spell_option(int is_spellfile)
  * Set curbuf->b_cap_prog to the regexp program for 'spellcapcheck'.
  * Return error message when failed, NULL when OK.
  */
-    static char_u *
+    static char *
 compile_cap_prog(synblock_T *synblock)
 {
     regprog_T   *rp = synblock->b_cap_prog;
@@ -8353,7 +8353,7 @@ set_term_option_sctx_idx(char *name, int
  * Set the value of a boolean option, and take care of side effects.
  * Returns NULL for success, or an error message for an error.
  */
-    static char_u *
+    static char *
 set_bool_option(
     int		opt_idx,		/* index in options[] table */
     char_u	*varp,			/* pointer to the option variable */
@@ -8471,7 +8471,7 @@ set_bool_option(
 		      && curbuf->b_term != NULL && !term_is_finished(curbuf))))
 	{
 	    curbuf->b_p_ma = FALSE;
-	    return (char_u *)N_("E946: Cannot make a terminal with running job modifiable");
+	    return N_("E946: Cannot make a terminal with running job modifiable");
 	}
 # endif
 # ifdef FEAT_TITLE
@@ -8607,7 +8607,7 @@ set_bool_option(
 		if (win->w_p_pvw && win != curwin)
 		{
 		    curwin->w_p_pvw = FALSE;
-		    return (char_u *)N_("E590: A preview window already exists");
+		    return N_("E590: A preview window already exists");
 		}
 	}
     }
@@ -8765,9 +8765,10 @@ set_bool_option(
     {
 	if (curwin->w_p_spell)
 	{
-	    char_u	*errmsg = did_set_spelllang(curwin);
+	    char	*errmsg = did_set_spelllang(curwin);
+
 	    if (errmsg != NULL)
-		EMSG(_(errmsg));
+		emsg(_(errmsg));
 	}
     }
 #endif
@@ -8989,17 +8990,17 @@ set_bool_option(
  * Set the value of a number option, and take care of side effects.
  * Returns NULL for success, or an error message for an error.
  */
-    static char_u *
+    static char *
 set_num_option(
     int		opt_idx,		/* index in options[] table */
     char_u	*varp,			/* pointer to the option variable */
     long	value,			/* new value */
-    char_u	*errbuf,		/* buffer for error messages */
+    char	*errbuf,		/* buffer for error messages */
     size_t	errbuflen,		/* length of "errbuf" */
     int		opt_flags)		/* OPT_LOCAL, OPT_GLOBAL and
 					   OPT_MODELINE */
 {
-    char_u	*errmsg = NULL;
+    char	*errmsg = NULL;
     long	old_value = *(long *)varp;
     long	old_Rows = Rows;	/* remember old Rows */
     long	old_Columns = Columns;	/* remember old Columns */
@@ -9937,7 +9938,7 @@ option_iter_next(void **option, int opt_
  *
  * Returns NULL on success or error message on error.
  */
-    char_u *
+    char *
 set_option_value(
     char_u	*name,
     long	number,
@@ -9975,7 +9976,7 @@ set_option_value(
 	    return NULL;
 	}
 
-	EMSG2(_("E355: Unknown option: %s"), name);
+	semsg(_("E355: Unknown option: %s"), name);
     }
     else
     {
@@ -9984,7 +9985,7 @@ set_option_value(
 	/* Disallow changing some options in the sandbox */
 	if (sandbox > 0 && (flags & P_SECURE))
 	{
-	    EMSG(_(e_sandbox));
+	    emsg(_(e_sandbox));
 	    return NULL;
 	}
 #endif
@@ -10008,7 +10009,7 @@ set_option_value(
 			/* There's another character after zeros or the string
 			 * is empty.  In both cases, we are trying to set a
 			 * num option using a string. */
-			EMSG3(_("E521: Number required: &%s = '%s'"),
+			semsg(_("E521: Number required: &%s = '%s'"),
 								name, string);
 			return NULL;     /* do nothing as we hit an error */
 
@@ -11086,7 +11087,7 @@ get_varp(struct vimoption *p)
 	case PV_VSTS:	return (char_u *)&(curbuf->b_p_vsts);
 	case PV_VTS:	return (char_u *)&(curbuf->b_p_vts);
 #endif
-	default:	IEMSG(_("E356: get_varp ERROR"));
+	default:	iemsg(_("E356: get_varp ERROR"));
     }
     /* always return a valid pointer to avoid a crash! */
     return (char_u *)&(curbuf->b_p_wm);
@@ -12283,7 +12284,7 @@ langmap_set(void)
 	    }
 	    if (to == NUL)
 	    {
-		EMSG2(_("E357: 'langmap': Matching character missing for %s"),
+		semsg(_("E357: 'langmap': Matching character missing for %s"),
 							     transchar(from));
 		return;
 	    }
@@ -12307,7 +12308,7 @@ langmap_set(void)
 		    {
 			if (p[0] != ',')
 			{
-			    EMSG2(_("E358: 'langmap': Extra characters after semicolon: %s"), p);
+			    semsg(_("E358: 'langmap': Extra characters after semicolon: %s"), p);
 			    return;
 			}
 			++p;
@@ -12877,9 +12878,9 @@ tabstop_set(char_u *var, int **array)
 	    if (strtol((char *)cp, (char **)&end, 10) <= 0)
 	    {
 		if (cp != end)
-		    EMSG(_(e_positive));
+		    emsg(_(e_positive));
 		else
-		    EMSG(_(e_invarg));
+		    emsg(_(e_invarg));
 		return FALSE;
 	    }
 	}
@@ -12891,7 +12892,7 @@ tabstop_set(char_u *var, int **array)
 	    ++valcount;
 	    continue;
 	}
-	EMSG(_(e_invarg));
+	emsg(_(e_invarg));
 	return FALSE;
     }
 
--- a/src/os_amiga.c
+++ b/src/os_amiga.c
@@ -963,7 +963,7 @@ mch_settmode(int tmode)
     int
 mch_screenmode(char_u *arg)
 {
-    EMSG(_(e_screenmode));
+    emsg(_(e_screenmode));
     return FAIL;
 }
 
@@ -1189,7 +1189,7 @@ mch_call_shell(
     if (close_win)
     {
 	/* if Vim opened a window: Executing a shell may cause crashes */
-	EMSG(_("E360: Cannot execute shell with -f option"));
+	emsg(_("E360: Cannot execute shell with -f option"));
 	return -1;
     }
 
@@ -1517,11 +1517,11 @@ mch_expandpath(
     matches = gap->ga_len - start_len;
 
     if (Result == ERROR_BUFFER_OVERFLOW)
-	EMSG(_("ANCHOR_BUF_SIZE too small."));
+	emsg(_("ANCHOR_BUF_SIZE too small."));
     else if (matches == 0 && Result != ERROR_OBJECT_NOT_FOUND
 			  && Result != ERROR_DEVICE_NOT_MOUNTED
 			  && Result != ERROR_NO_MORE_ENTRIES)
-	EMSG(_("I/O ERROR"));
+	emsg(_("I/O ERROR"));
 
     /*
      * Sort the files for this pattern.
--- a/src/os_mswin.c
+++ b/src/os_mswin.c
@@ -776,7 +776,7 @@ mch_chdir(char *path)
     if (p_verbose >= 5)
     {
 	verbose_enter();
-	smsg((char_u *)"chdir(%s)", path);
+	smsg("chdir(%s)", path);
 	verbose_leave();
     }
     if (isalpha(path[0]) && path[1] == ':')	/* has a drive name */
@@ -841,7 +841,7 @@ mch_check_messages(void)
     int
 mch_screenmode(char_u *arg UNUSED)
 {
-    EMSG(_(e_screenmode));
+    emsg(_(e_screenmode));
     return FAIL;
 }
 
@@ -1004,7 +1004,7 @@ mch_libcall(
 
     if (!fRunTimeLinkSuccess)
     {
-	EMSG2(_(e_libcall), funcname);
+	semsg(_(e_libcall), funcname);
 	return FAIL;
     }
 
@@ -1524,7 +1524,7 @@ mch_print_init(prt_settings_T *psettings
 
     if (prt_dlg.hDC == NULL)
     {
-	EMSG(_("E237: Printer selection failed"));
+	emsg(_("E237: Printer selection failed"));
 	mch_print_cleanup();
 	return FALSE;
     }
@@ -1601,7 +1601,7 @@ mch_print_init(prt_settings_T *psettings
     vim_memset(&fLogFont, 0, sizeof(fLogFont));
     if (get_logfont(&fLogFont, p_pfn, prt_dlg.hDC, TRUE) == FAIL)
     {
-	EMSG2(_("E613: Unknown printer font: %s"), p_pfn);
+	semsg(_("E613: Unknown printer font: %s"), p_pfn);
 	mch_print_cleanup();
 	return FALSE;
     }
@@ -1662,7 +1662,7 @@ init_fail_dlg:
 			  FORMAT_MESSAGE_FROM_SYSTEM |
 			  FORMAT_MESSAGE_IGNORE_INSERTS,
 			  NULL, err, 0, (LPTSTR)(&buf), 0, NULL);
-	    EMSG2(_("E238: Print error: %s"),
+	    semsg(_("E238: Print error: %s"),
 				  buf == NULL ? (char_u *)_("Unknown") : buf);
 	    LocalFree((LPVOID)(buf));
 	}
@@ -2504,7 +2504,7 @@ serverSendToVim(
     if (target == 0)
     {
 	if (!silent)
-	    EMSG2(_(e_noserver), name);
+	    semsg(_(e_noserver), name);
 	return -1;
     }
 
@@ -3070,9 +3070,7 @@ get_logfont(
 			}
 		    if (cp->name == NULL && verbose)
 		    {
-			vim_snprintf((char *)IObuff, IOSIZE,
-				_("E244: Illegal charset name \"%s\" in font name \"%s\""), p, name);
-			EMSG(IObuff);
+			semsg(_("E244: Illegal charset name \"%s\" in font name \"%s\""), p, name);
 			break;
 		    }
 		    break;
@@ -3090,21 +3088,14 @@ get_logfont(
 			}
 		    if (qp->name == NULL && verbose)
 		    {
-			vim_snprintf((char *)IObuff, IOSIZE,
-				_("E244: Illegal quality name \"%s\" in font name \"%s\""), p, name);
-			EMSG(IObuff);
+			semsg(_("E244: Illegal quality name \"%s\" in font name \"%s\""), p, name);
 			break;
 		    }
 		    break;
 		}
 	    default:
 		if (verbose)
-		{
-		    vim_snprintf((char *)IObuff, IOSIZE,
-			    _("E245: Illegal char '%c' in font name \"%s\""),
-			    p[-1], name);
-		    EMSG(IObuff);
-		}
+		    semsg(_("E245: Illegal char '%c' in font name \"%s\""), p[-1], name);
 		goto theend;
 	}
 	while (*p == ':')
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -327,7 +327,7 @@ mch_chdir(char *path)
     if (p_verbose >= 5)
     {
 	verbose_enter();
-	smsg((char_u *)"chdir(%s)", path);
+	smsg("chdir(%s)", path);
 	verbose_leave();
     }
 # ifdef VMS
@@ -1004,7 +1004,7 @@ static volatile sig_atomic_t lc_active I
  *	if (SETJMP(lc_jump_env) != 0)
  *	{
  *	    mch_didjmp();
- *	    EMSG("crash!");
+ *	    emsg("crash!");
  *	}
  *	else
  *	{
@@ -1632,7 +1632,7 @@ mch_input_isatty(void)
     static void
 xopen_message(long elapsed_msec)
 {
-    smsg((char_u *)_("Opening the X display took %ld msec"), elapsed_msec);
+    smsg(_("Opening the X display took %ld msec"), elapsed_msec);
 }
 # endif
 #endif
@@ -2670,7 +2670,7 @@ mch_FullName(
 #endif
 		l = mch_chdir((char *)olddir);
 	    if (l != 0)
-		EMSG(_(e_prev_dir));
+		emsg(_(e_prev_dir));
 	}
 
 	l = STRLEN(buf);
@@ -3974,7 +3974,7 @@ check_mouse_termcode(void)
     int
 mch_screenmode(char_u *arg UNUSED)
 {
-    EMSG(_(e_screenmode));
+    emsg(_(e_screenmode));
     return FAIL;
 }
 
@@ -5454,7 +5454,7 @@ mch_job_start(char **argv, job_T *job, j
 	fd_in[0] = mch_open((char *)fname, O_RDONLY, 0);
 	if (fd_in[0] < 0)
 	{
-	    EMSG2(_(e_notopen), fname);
+	    semsg(_(e_notopen), fname);
 	    goto failed;
 	}
     }
@@ -5472,7 +5472,7 @@ mch_job_start(char **argv, job_T *job, j
 	fd_out[1] = mch_open((char *)fname, O_WRONLY | O_CREAT | O_TRUNC, 0644);
 	if (fd_out[1] < 0)
 	{
-	    EMSG2(_(e_notopen), fname);
+	    semsg(_(e_notopen), fname);
 	    goto failed;
 	}
     }
@@ -5486,7 +5486,7 @@ mch_job_start(char **argv, job_T *job, j
 	fd_err[1] = mch_open((char *)fname, O_WRONLY | O_CREAT | O_TRUNC, 0600);
 	if (fd_err[1] < 0)
 	{
-	    EMSG2(_(e_notopen), fname);
+	    semsg(_(e_notopen), fname);
 	    goto failed;
 	}
     }
@@ -6509,7 +6509,7 @@ mch_expand_wildcards(
      */
     if ((tempname = vim_tempname('o', FALSE)) == NULL)
     {
-	EMSG(_(e_notmp));
+	emsg(_(e_notmp));
 	return FAIL;
     }
 
@@ -6763,7 +6763,7 @@ mch_expand_wildcards(
     if (i != (int)len)
     {
 	/* unexpected read error */
-	EMSG2(_(e_notread), tempname);
+	semsg(_(e_notread), tempname);
 	vim_free(tempname);
 	vim_free(buffer);
 	return FAIL;
@@ -7347,7 +7347,7 @@ mch_libcall(
 	/* "dlerr" must be used before dlclose() */
 	dlerr = (char *)dlerror();
 	if (dlerr != NULL)
-	    EMSG2(_("dlerror = \"%s\""), dlerr);
+	    semsg(_("dlerror = \"%s\""), dlerr);
     }
 # else
     hinstLib = shl_load((const char*)libname, BIND_IMMEDIATE|BIND_VERBOSE, 0L);
@@ -7442,7 +7442,7 @@ mch_libcall(
 	    for (i = 0; signal_info[i].sig != -1; i++)
 		if (lc_signal == signal_info[i].sig)
 		    break;
-	    EMSG2("E368: got SIG%s in libcall()", signal_info[i].name);
+	    semsg("E368: got SIG%s in libcall()", signal_info[i].name);
 	}
 #  endif
 # endif
@@ -7450,7 +7450,7 @@ mch_libcall(
 # if defined(USE_DLOPEN)
 	/* "dlerr" must be used before dlclose() */
 	if (dlerr != NULL)
-	    EMSG2(_("dlerror = \"%s\""), dlerr);
+	    semsg(_("dlerror = \"%s\""), dlerr);
 
 	/* Free the DLL module. */
 	(void)dlclose(hinstLib);
@@ -7461,7 +7461,7 @@ mch_libcall(
 
     if (!success)
     {
-	EMSG2(_(e_libcall), funcname);
+	semsg(_(e_libcall), funcname);
 	return FAIL;
     }
 
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -633,7 +633,7 @@ dyn_libintl_init(void)
 	if (p_verbose > 0)
 	{
 	    verbose_enter();
-	    EMSG2(_(e_loadlib), GETTEXT_DLL);
+	    semsg(_(e_loadlib), GETTEXT_DLL);
 	    verbose_leave();
 	}
 	return 0;
@@ -648,7 +648,7 @@ dyn_libintl_init(void)
 	    if (p_verbose > 0)
 	    {
 		verbose_enter();
-		EMSG2(_(e_loadfunc), libintl_entry[i].name);
+		semsg(_(e_loadfunc), libintl_entry[i].name);
 		verbose_leave();
 	    }
 	    return 0;
@@ -5182,7 +5182,7 @@ mch_call_shell(
 	    {
 		x = -1;
 #ifdef FEAT_GUI_W32
-		EMSG(_("E371: Command not found"));
+		emsg(_("E371: Command not found"));
 #endif
 	    }
 
@@ -5260,7 +5260,7 @@ mch_call_shell(
 #endif
 	    )
     {
-	smsg((char_u *)_("shell returned %d"), x);
+	smsg(_("shell returned %d"), x);
 	msg_putchar('\n');
     }
 #ifdef FEAT_TITLE
@@ -5489,7 +5489,7 @@ mch_job_start(char *cmd, job_T *job, job
 		&saAttr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL);
 	if (ifd[0] == INVALID_HANDLE_VALUE)
 	{
-	    EMSG2(_(e_notopen), fname);
+	    semsg(_(e_notopen), fname);
 	    goto failed;
 	}
     }
@@ -5507,7 +5507,7 @@ mch_job_start(char *cmd, job_T *job, job
 		&saAttr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL);
 	if (ofd[1] == INVALID_HANDLE_VALUE)
 	{
-	    EMSG2(_(e_notopen), fname);
+	    semsg(_(e_notopen), fname);
 	    goto failed;
 	}
     }
@@ -5525,7 +5525,7 @@ mch_job_start(char *cmd, job_T *job, job
 		&saAttr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL);
 	if (efd[1] == INVALID_HANDLE_VALUE)
 	{
-	    EMSG2(_(e_notopen), fname);
+	    semsg(_(e_notopen), fname);
 	    goto failed;
 	}
     }
--- a/src/popupmnu.c
+++ b/src/popupmnu.c
@@ -1199,7 +1199,7 @@ pum_show_popupmenu(vimmenu_T *menu)
     // pum_size being zero.
     if (pum_size <= 0)
     {
-	EMSG(e_menuothermode);
+	emsg(e_menuothermode);
 	return;
     }
 
--- a/src/proto.h
+++ b/src/proto.h
@@ -108,25 +108,25 @@ int
 #  ifdef __BORLANDC__
 _RTLENTRYF
 #  endif
-smsg(char_u *, ...);
+smsg(const char *, ...);
 
 int
 #  ifdef __BORLANDC__
 _RTLENTRYF
 #  endif
-smsg_attr(int, char_u *, ...);
+smsg_attr(int, const char *, ...);
 
 int
 #  ifdef __BORLANDC__
 _RTLENTRYF
 #  endif
-smsg_attr_keep(int, char_u *, ...);
+smsg_attr_keep(int, const char *, ...);
 
 int
 #  ifdef __BORLANDC__
 _RTLENTRYF
 #  endif
-vim_snprintf_add(char *, size_t, char *, ...)
+vim_snprintf_add(char *, size_t, const char *, ...)
 #ifdef USE_PRINTF_FORMAT_ATTRIBUTE
     __attribute__((format(printf, 3, 4)))
 #endif
@@ -136,14 +136,14 @@ int
 #  ifdef __BORLANDC__
 _RTLENTRYF
 #  endif
-vim_snprintf(char *, size_t, char *, ...)
+vim_snprintf(char *, size_t, const char *, ...)
 #ifdef USE_PRINTF_FORMAT_ATTRIBUTE
     __attribute__((format(printf, 3, 4)))
 #endif
     ;
 
-int vim_vsnprintf(char *str, size_t str_m, char *fmt, va_list ap);
-int vim_vsnprintf_typval(char *str, size_t str_m, char *fmt, va_list ap, typval_T *tvs);
+int vim_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap);
+int vim_vsnprintf_typval(char *str, size_t str_m, const char *fmt, va_list ap, typval_T *tvs);
 
 # include "message.pro"
 # include "misc1.pro"
--- a/src/proto/buffer.pro
+++ b/src/proto/buffer.pro
@@ -8,7 +8,7 @@ void buf_clear_file(buf_T *buf);
 void buf_freeall(buf_T *buf, int flags);
 void goto_buffer(exarg_T *eap, int start, int dir, int count);
 void handle_swap_exists(bufref_T *old_curbuf);
-char_u *do_bufdel(int command, char_u *arg, int addr_count, int start_bnr, int end_bnr, int forceit);
+char *do_bufdel(int command, char_u *arg, int addr_count, int start_bnr, int end_bnr, int forceit);
 int do_buffer(int action, int start, int dir, int count, int forceit);
 void set_curbuf(buf_T *buf, int action);
 void enter_buffer(buf_T *buf);
--- a/src/proto/digraph.pro
+++ b/src/proto/digraph.pro
@@ -5,7 +5,7 @@ int get_digraph(int cmdline);
 int getdigraph(int char1, int char2, int meta_char);
 void putdigraph(char_u *str);
 void listdigraphs(int use_headers);
-char_u *keymap_init(void);
+char *keymap_init(void);
 void ex_loadkeymap(exarg_T *eap);
 void keymap_clear(garray_T *kmap);
 /* vim: set ft=c : */
--- a/src/proto/ex_docmd.pro
+++ b/src/proto/ex_docmd.pro
@@ -4,15 +4,15 @@ int do_cmdline_cmd(char_u *cmd);
 int do_cmdline(char_u *cmdline, char_u *(*fgetline)(int, void *, int), void *cookie, int flags);
 int getline_equal(char_u *(*fgetline)(int, void *, int), void *cookie, char_u *(*func)(int, void *, int));
 void *getline_cookie(char_u *(*fgetline)(int, void *, int), void *cookie);
-int parse_command_modifiers(exarg_T *eap, char_u **errormsg, int skip_only);
-int parse_cmd_address(exarg_T *eap, char_u **errormsg, int silent);
+int parse_command_modifiers(exarg_T *eap, char **errormsg, int skip_only);
+int parse_cmd_address(exarg_T *eap, char **errormsg, int silent);
 int checkforcmd(char_u **pp, char *cmd, int len);
 int modifier_len(char_u *cmd);
 int cmd_exists(char_u *name);
 char_u *set_one_cmd_context(expand_T *xp, char_u *buff);
 char_u *skip_range(char_u *cmd, int *ctx);
 void ex_ni(exarg_T *eap);
-int expand_filename(exarg_T *eap, char_u **cmdlinep, char_u **errormsgp);
+int expand_filename(exarg_T *eap, char_u **cmdlinep, char **errormsgp);
 void separate_nextcmd(exarg_T *eap);
 int get_bad_opt(char_u *p, exarg_T *eap);
 int ends_excmd(int c);
@@ -61,7 +61,7 @@ void ex_normal(exarg_T *eap);
 void exec_normal_cmd(char_u *cmd, int remap, int silent);
 void exec_normal(int was_typed, int use_vpeekc, int may_use_terminal_loop);
 int find_cmdline_var(char_u *src, int *usedlen);
-char_u *eval_vars(char_u *src, char_u *srcstart, int *usedlen, linenr_T *lnump, char_u **errormsg, int *escaped);
+char_u *eval_vars(char_u *src, char_u *srcstart, int *usedlen, linenr_T *lnump, char **errormsg, int *escaped);
 char_u *expand_sfile(char_u *arg);
 int put_eol(FILE *fd);
 int put_line(FILE *fd, char *s);
--- a/src/proto/ex_eval.pro
+++ b/src/proto/ex_eval.pro
@@ -7,7 +7,7 @@ int cause_errthrow(char_u *mesg, int sev
 void free_global_msglist(void);
 void do_errthrow(struct condstack *cstack, char_u *cmdname);
 int do_intthrow(struct condstack *cstack);
-char_u *get_exception_string(void *value, except_type_T type, char_u *cmdname, int *should_free);
+char *get_exception_string(void *value, except_type_T type, char_u *cmdname, int *should_free);
 void discard_current_exception(void);
 void report_make_pending(int pending, void *value);
 void report_resume_pending(int pending, void *value);
--- a/src/proto/ex_getln.pro
+++ b/src/proto/ex_getln.pro
@@ -4,7 +4,7 @@ char_u *getcmdline(int firstc, long coun
 char_u *getcmdline_prompt(int firstc, char_u *prompt, int attr, int xp_context, char_u *xp_arg);
 int text_locked(void);
 void text_locked_msg(void);
-char_u *get_text_locked_msg(void);
+char *get_text_locked_msg(void);
 int curbuf_locked(void);
 int allbuf_locked(void);
 char_u *getexline(int c, void *cookie, int indent);
--- a/src/proto/hardcopy.pro
+++ b/src/proto/hardcopy.pro
@@ -1,6 +1,6 @@
 /* hardcopy.c */
-char_u *parse_printoptions(void);
-char_u *parse_printmbfont(void);
+char *parse_printoptions(void);
+char *parse_printmbfont(void);
 int prt_header_height(void);
 int prt_use_number(void);
 int prt_get_unit(int idx);
--- a/src/proto/mbyte.pro
+++ b/src/proto/mbyte.pro
@@ -1,6 +1,6 @@
 /* mbyte.c */
 int enc_canon_props(char_u *name);
-char_u *mb_init(void);
+char *mb_init(void);
 int bomb_size(void);
 void remove_bom(char_u *s);
 int mb_get_class(char_u *p);
--- a/src/proto/message.pro
+++ b/src/proto/message.pro
@@ -10,13 +10,10 @@ void msg_source(int attr);
 int emsg_not_now(void);
 void ignore_error_for_testing(char_u *error);
 void do_perror(char *msg);
-int emsg(char_u *s);
-int emsg2(char_u *s, char_u *a1);
-int emsg3(char_u *s, char_u *a1, char_u *a2);
-int emsgn(char_u *s, long n);
-void iemsg(char_u *s);
-void iemsg2(char_u *s, char_u *a1);
-void iemsgn(char_u *s, long n);
+int emsg(char *s);
+int semsg(const char *s, ...);
+void iemsg(char *s);
+void siemsg(const char *s, ...);
 void internal_error(char *where);
 void emsg_invreg(int name);
 char_u *msg_trunc_attr(char_u *s, int force, int attr);
--- a/src/proto/misc2.pro
+++ b/src/proto/misc2.pro
@@ -87,7 +87,7 @@ int after_pathsep(char_u *b, char_u *p);
 int same_directory(char_u *f1, char_u *f2);
 int vim_chdirfile(char_u *fname, char *trigger_autocmd);
 int vim_stat(const char *name, stat_T *stp);
-char_u *parse_shape_opt(int what);
+char *parse_shape_opt(int what);
 int get_shape_idx(int mouse);
 void update_mouseshape(int shape_idx);
 void *vim_findfile_init(char_u *path, char_u *filename, char_u *stopdirs, int level, int free_visited, int find_what, void *search_ctx_arg, int tagfile, char_u *rel_fname);
--- a/src/proto/option.pro
+++ b/src/proto/option.pro
@@ -21,13 +21,13 @@ int get_term_opt_idx(char_u **p);
 int set_term_option_alloced(char_u **p);
 int was_set_insecurely(char_u *opt, int opt_flags);
 void set_string_option_direct(char_u *name, int opt_idx, char_u *val, int opt_flags, int set_sid);
-char_u *check_colorcolumn(win_T *wp);
-char_u *check_stl_option(char_u *s);
+char *check_colorcolumn(win_T *wp);
+char *check_stl_option(char_u *s);
 void set_term_option_sctx_idx(char *name, int opt_idx);
 int get_option_value(char_u *name, long *numval, char_u **stringval, int opt_flags);
 int get_option_value_strict(char_u *name, long *numval, char_u **stringval, int opt_type, void *from);
 char_u *option_iter_next(void **option, int opt_type);
-char_u *set_option_value(char_u *name, long number, char_u *string, int opt_flags);
+char *set_option_value(char_u *name, long number, char_u *string, int opt_flags);
 char_u *get_term_code(char_u *tname);
 char_u *get_highlight_default(void);
 char_u *get_encoding_default(void);
--- a/src/proto/spell.pro
+++ b/src/proto/spell.pro
@@ -10,7 +10,7 @@ void slang_clear_sug(slang_T *lp);
 void count_common_word(slang_T *lp, char_u *word, int len, int count);
 int byte_in_str(char_u *str, int n);
 int init_syl_tab(slang_T *slang);
-char_u *did_set_spelllang(win_T *wp);
+char *did_set_spelllang(win_T *wp);
 int captype(char_u *word, char_u *end);
 void spell_delete_wordlist(void);
 void spell_free_all(void);
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -239,17 +239,14 @@ efmpat_to_regpat(
 	char_u	*regpat,
 	efm_T	*efminfo,
 	int	idx,
-	int	round,
-	char_u	*errmsg)
+	int	round)
 {
     char_u	*srcptr;
 
     if (efminfo->addr[idx])
     {
 	// Each errorformat pattern can occur only once
-	sprintf((char *)errmsg,
-		_("E372: Too many %%%c in format string"), *efmpat);
-	EMSG(errmsg);
+	semsg(_("E372: Too many %%%c in format string"), *efmpat);
 	return NULL;
     }
     if ((idx && idx < 6
@@ -257,9 +254,7 @@ efmpat_to_regpat(
 	    || (idx == 6
 		&& vim_strchr((char_u *)"OPQ", efminfo->prefix) == NULL))
     {
-	sprintf((char *)errmsg,
-		_("E373: Unexpected %%%c in format string"), *efmpat);
-	EMSG(errmsg);
+	semsg(_("E373: Unexpected %%%c in format string"), *efmpat);
 	return NULL;
     }
     efminfo->addr[idx] = (char_u)++round;
@@ -316,8 +311,7 @@ scanf_fmt_to_regpat(
 	char_u	**pefmp,
 	char_u	*efm,
 	int	len,
-	char_u	*regpat,
-	char_u	*errmsg)
+	char_u	*regpat)
 {
     char_u	*efmp = *pefmp;
 
@@ -335,7 +329,7 @@ scanf_fmt_to_regpat(
 		    // skip ;
 		if (efmp == efm + len)
 		{
-		    EMSG(_("E374: Missing ] in format string"));
+		    emsg(_("E374: Missing ] in format string"));
 		    return NULL;
 		}
 	    }
@@ -348,9 +342,7 @@ scanf_fmt_to_regpat(
     else
     {
 	// TODO: scanf()-like: %*ud, %*3c, %*f, ... ?
-	sprintf((char *)errmsg,
-		_("E375: Unsupported %%%c in format string"), *efmp);
-	EMSG(errmsg);
+	semsg(_("E375: Unsupported %%%c in format string"), *efmp);
 	return NULL;
     }
 
@@ -363,7 +355,7 @@ scanf_fmt_to_regpat(
  * Analyze/parse an errorformat prefix.
  */
     static char_u *
-efm_analyze_prefix(char_u *efmp, efm_T *efminfo, char_u *errmsg)
+efm_analyze_prefix(char_u *efmp, efm_T *efminfo)
 {
     if (vim_strchr((char_u *)"+-", *efmp) != NULL)
 	efminfo->flags = *efmp++;
@@ -371,9 +363,7 @@ efm_analyze_prefix(char_u *efmp, efm_T *
 	efminfo->prefix = *efmp;
     else
     {
-	sprintf((char *)errmsg,
-		_("E376: Invalid %%%c in format string prefix"), *efmp);
-	EMSG(errmsg);
+	semsg(_("E376: Invalid %%%c in format string prefix"), *efmp);
 	return NULL;
     }
 
@@ -391,8 +381,7 @@ efm_to_regpat(
 	char_u	*efm,
 	int	len,
 	efm_T	*fmt_ptr,
-	char_u	*regpat,
-	char_u	*errmsg)
+	char_u	*regpat)
 {
     char_u	*ptr;
     char_u	*efmp;
@@ -413,8 +402,7 @@ efm_to_regpat(
 		    break;
 	    if (idx < FMT_PATTERNS)
 	    {
-		ptr = efmpat_to_regpat(efmp, ptr, fmt_ptr, idx, round,
-								errmsg);
+		ptr = efmpat_to_regpat(efmp, ptr, fmt_ptr, idx, round);
 		if (ptr == NULL)
 		    return FAIL;
 		round++;
@@ -422,7 +410,7 @@ efm_to_regpat(
 	    else if (*efmp == '*')
 	    {
 		++efmp;
-		ptr = scanf_fmt_to_regpat(&efmp, efm, len, ptr, errmsg);
+		ptr = scanf_fmt_to_regpat(&efmp, efm, len, ptr);
 		if (ptr == NULL)
 		    return FAIL;
 	    }
@@ -436,15 +424,13 @@ efm_to_regpat(
 	    {
 		// prefix is allowed only at the beginning of the errorformat
 		// option part
-		efmp = efm_analyze_prefix(efmp, fmt_ptr, errmsg);
+		efmp = efm_analyze_prefix(efmp, fmt_ptr);
 		if (efmp == NULL)
 		    return FAIL;
 	    }
 	    else
 	    {
-		sprintf((char *)errmsg,
-			_("E377: Invalid %%%c in format string"), *efmp);
-		EMSG(errmsg);
+		semsg(_("E377: Invalid %%%c in format string"), *efmp);
 		return FAIL;
 	    }
 	}
@@ -526,8 +512,6 @@ efm_option_part_len(char_u *efm)
     static efm_T *
 parse_efm_option(char_u *efm)
 {
-    char_u	*errmsg = NULL;
-    int		errmsglen;
     efm_T	*fmt_ptr = NULL;
     efm_T	*fmt_first = NULL;
     efm_T	*fmt_last = NULL;
@@ -535,11 +519,6 @@ parse_efm_option(char_u *efm)
     int		len;
     int		sz;
 
-    errmsglen = CMDBUFFSIZE + 1;
-    errmsg = alloc_id(errmsglen, aid_qf_errmsg);
-    if (errmsg == NULL)
-	goto parse_efm_end;
-
     // Each part of the format string is copied and modified from errorformat
     // to regex prog.  Only a few % characters are allowed.
 
@@ -563,7 +542,7 @@ parse_efm_option(char_u *efm)
 	// Isolate one part in the 'errorformat' option
 	len = efm_option_part_len(efm);
 
-	if (efm_to_regpat(efm, len, fmt_ptr, fmtstr, errmsg) == FAIL)
+	if (efm_to_regpat(efm, len, fmt_ptr, fmtstr) == FAIL)
 	    goto parse_efm_error;
 	if ((fmt_ptr->prog = vim_regcomp(fmtstr, RE_MAGIC + RE_STRING)) == NULL)
 	    goto parse_efm_error;
@@ -572,7 +551,7 @@ parse_efm_option(char_u *efm)
     }
 
     if (fmt_first == NULL)	// nothing found
-	EMSG(_("E378: 'errorformat' contains no pattern"));
+	emsg(_("E378: 'errorformat' contains no pattern"));
 
     goto parse_efm_end;
 
@@ -581,7 +560,6 @@ parse_efm_error:
 
 parse_efm_end:
     vim_free(fmtstr);
-    vim_free(errmsg);
 
     return fmt_first;
 }
@@ -1271,7 +1249,7 @@ qf_parse_dir_pfx(int idx, qffields_T *fi
     {
 	if (*fields->namebuf == NUL)
 	{
-	    EMSG(_("E379: Missing or empty directory name"));
+	    emsg(_("E379: Missing or empty directory name"));
 	    return QF_FAIL;
 	}
 	qfl->qf_directory =
@@ -1568,7 +1546,7 @@ qf_setup_state(
 
     if (efile != NULL && (pstate->fd = mch_fopen((char *)efile, "r")) == NULL)
     {
-	EMSG2(_(e_openerrf), efile);
+	semsg(_(e_openerrf), efile);
 	return FAIL;
     }
 
@@ -1751,7 +1729,7 @@ qf_init_ext(
 	retval = qfl->qf_count;
 	goto qf_init_end;
     }
-    EMSG(_(e_readerrf));
+    emsg(_(e_readerrf));
 error2:
     if (!adding)
     {
@@ -1968,7 +1946,7 @@ decr_quickfix_busy(void)
 #ifdef ABORT_ON_INTERNAL_ERROR
     if (quickfix_busy < 0)
     {
-	EMSG("quickfix_busy has become negative");
+	emsg("quickfix_busy has become negative");
 	abort();
     }
 #endif
@@ -1980,7 +1958,7 @@ check_quickfix_busy(void)
 {
     if (quickfix_busy != 0)
     {
-	EMSGN("quickfix_busy not zero on exit: %ld", (long)quickfix_busy);
+	semsg("quickfix_busy not zero on exit: %ld", (long)quickfix_busy);
 # ifdef ABORT_ON_INTERNAL_ERROR
 	abort();
 # endif
@@ -2635,7 +2613,7 @@ get_nth_valid_entry(
 	    qf_idx = prev_index;
 	    if (err != NULL)
 	    {
-		EMSG(_(err));
+		emsg(_(err));
 		return NULL;
 	    }
 	    break;
@@ -3041,14 +3019,14 @@ qf_jump_edit_buffer(