From 88b46d84315d9a03b22467eccdcc620db05993bf Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Tue, 7 Nov 2006 11:23:12 +0000 Subject: [PATCH] (get_server_config) [WINDOWSNT]: Search the server file on APPDATA if it doesn't exist on HOME, even if HOME is defined. --- lib-src/ChangeLog | 3 +++ lib-src/emacsclient.c | 13 +++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 9210fa6afb..c2319d6486 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,5 +1,8 @@ 2006-11-07 Juanma Barranquero + * emacsclient.c (get_server_config) [WINDOWSNT]: Look for the server + file on APPDATA if it doesn't exist on HOME, even if HOME is defined. + * emacsclient.c (get_server_config): Extract also the Emacs pid from the server file. On Windows, try to force the Emacs frame to the foreground. diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 76ed21b29f..3c3b27374f 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -449,16 +449,21 @@ get_server_config (server, authentication) else { char *home = getenv ("HOME"); -#ifdef WINDOWSNT - if (! home) - home = getenv ("APPDATA"); -#endif + if (home) { char *path = alloca (32 + strlen (home) + strlen (server_file)); sprintf (path, "%s/.emacs.d/server/%s", home, server_file); config = fopen (path, "rb"); } +#ifdef WINDOWSNT + if (!config && (home = getenv ("APPDATA"))) + { + char *path = alloca (32 + strlen (home) + strlen (server_file)); + sprintf (path, "%s/.emacs.d/server/%s", home, server_file); + config = fopen (path, "rb"); + } +#endif } if (! config) -- 2.39.2