aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/ChangeLog8
-rw-r--r--lib-src/emacsclient.c21
2 files changed, 23 insertions, 6 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 228a579c651..2a702b8b719 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,11 @@
12008-11-01 Eli Zaretskii <eliz@gnu.org>
2
3 * emacsclient.c (main) [WINDOWSNT]: Don't ifdef away the call to
4 `ttyname'.
5 (w32_getenv): Treat $TERM specially: if not found in the
6 environment and in the Registry, return "w32console".
7 (ttyname) [WINDOWSNT]: New function.
8
12008-10-31 Andreas Schwab <schwab@suse.de> 92008-10-31 Andreas Schwab <schwab@suse.de>
2 10
3 * emacsclient.c (main): Don't force sending tty when in eval mode. 11 * emacsclient.c (main): Don't force sending tty when in eval mode.
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index 921fc2054e3..cac8bce2fd2 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -353,8 +353,13 @@ w32_getenv (envvar)
353 353
354 if (! (value = w32_get_resource (HKEY_CURRENT_USER, envvar, &dwType)) && 354 if (! (value = w32_get_resource (HKEY_CURRENT_USER, envvar, &dwType)) &&
355 ! (value = w32_get_resource (HKEY_LOCAL_MACHINE, envvar, &dwType))) 355 ! (value = w32_get_resource (HKEY_LOCAL_MACHINE, envvar, &dwType)))
356 /* Not found in the registry. */ 356 {
357 return NULL; 357 /* "w32console" is what Emacs on Windows uses for tty-type under -nw. */
358 if (strcmp (envvar, "TERM") == 0)
359 return xstrdup ("w32console");
360 /* Found neither in the environment nor in the registry. */
361 return NULL;
362 }
358 363
359 if (dwType == REG_SZ) 364 if (dwType == REG_SZ)
360 /* Registry; no need to expand. */ 365 /* Registry; no need to expand. */
@@ -435,6 +440,13 @@ w32_execvp (path, argv)
435#undef execvp 440#undef execvp
436#define execvp w32_execvp 441#define execvp w32_execvp
437 442
443/* Emulation of ttyname for Windows. */
444char *
445ttyname (int fd)
446{
447 return "CONOUT$";
448}
449
438#endif /* WINDOWSNT */ 450#endif /* WINDOWSNT */
439 451
440/* Display a normal or error message. 452/* Display a normal or error message.
@@ -570,10 +582,8 @@ decode_options (argc, argv)
570 582
571 if (!tty && display) 583 if (!tty && display)
572 window_system = 1; 584 window_system = 1;
573#if !defined (WINDOWSNT)
574 else if (!current_frame) 585 else if (!current_frame)
575 tty = 1; 586 tty = 1;
576#endif
577 587
578 /* --no-wait implies --current-frame on ttys when there are file 588 /* --no-wait implies --current-frame on ttys when there are file
579 arguments or expressions given. */ 589 arguments or expressions given. */
@@ -1444,9 +1454,8 @@ main (argc, argv)
1444 { 1454 {
1445 char *type = egetenv ("TERM"); 1455 char *type = egetenv ("TERM");
1446 char *tty_name = NULL; 1456 char *tty_name = NULL;
1447#ifndef WINDOWSNT 1457
1448 tty_name = ttyname (fileno (stdout)); 1458 tty_name = ttyname (fileno (stdout));
1449#endif
1450 1459
1451 if (! tty_name) 1460 if (! tty_name)
1452 { 1461 {