diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2008-02-08 15:25:58 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2008-02-08 15:25:58 +0000 |
commit | 9997dc15294bb1d2daa1e578c180cd297d5d6f78 (patch) | |
tree | 32d71a19d5125f985c8c8bb7d39c8c747922c80a /lib-src/emacsclient.c | |
parent | fe243f8ee2cc2dde8920c097fffdbe0a4bdbf1bf (diff) | |
download | emacs-9997dc15294bb1d2daa1e578c180cd297d5d6f78.tar.gz |
(decode_options): Pass --display implicitly if -c
is specified. Only set tty if -t or -c is specified.
Diffstat (limited to 'lib-src/emacsclient.c')
-rw-r--r-- | lib-src/emacsclient.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 707be43b5f7..cfa5fa00370 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -480,15 +480,6 @@ decode_options (argc, argv) { alternate_editor = egetenv ("ALTERNATE_EDITOR"); - /* We used to set `display' to $DISPLAY by default, but this changed the - default behavior and is sometimes inconvenient. So instead of forcing - users to say "--display ''" when they want to use Emacs's existing tty - or display connection, we force them to use "--display $DISPLAY" if - they want Emacs to connect to their current display. */ -#if 0 - display = egetenv ("DISPLAY"); -#endif - while (1) { int opt = getopt_long (argc, argv, @@ -566,13 +557,24 @@ decode_options (argc, argv) } } + /* We used to set `display' to $DISPLAY by default, but this changed the + default behavior and is sometimes inconvenient. So instead of forcing + users to say "--display ''" when they want to use Emacs's existing tty + or display connection, we force them to use "--display $DISPLAY" if + they want Emacs to connect to their current display. + -c still implicitly passes --display $DISPLAY unless -t was specified + so as to try and mimick the behavior of `emacs' which either uses + the current tty or the current $DISPLAY. */ + if (!current_frame && !tty) + display = egetenv ("DISPLAY"); + if (display && strlen (display) == 0) display = NULL; if (!tty && display) window_system = 1; #if !defined (WINDOWSNT) && !defined (HAVE_CARBON) - else + else if (!current_frame) tty = 1; #endif |