From 1682bd18f50ed2095b2162207603c6b8a3f0225f Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 19 Nov 2022 21:34:07 +0200 Subject: Fix encoding and display of messages sent by server to emacsclient * lisp/server.el (server-start): Use 'locale-coding-system' to encode messages sent back to the client. * lib-src/emacsclient.c (main): Print '-error' messages via 'message', not directly via 'fprintf'. This shows the error on MS-Windows when the client is invoked as 'emacsclientw', since stderr goes to the bit bucket in that case. --- lib-src/emacsclient.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib-src') diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 425db8cface..ee124ea135c 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -2240,7 +2240,7 @@ main (int argc, char **argv) char *str = unquote_argument (p + strlen ("-error ")); if (!skiplf) printf ("\n"); - fprintf (stderr, "*ERROR*: %s", str); + message (true, "*ERROR*: %s", str); if (str[0]) skiplf = str[strlen (str) - 1] == '\n'; exit_status = EXIT_FAILURE; -- cgit v1.2.3