Index: emacsclient.c =================================================================== RCS file: /sources/emacs/emacs/lib-src/emacsclient.c,v retrieving revision 1.121 diff -U 4 -r1.121 emacsclient.c --- emacsclient.c 26 Jan 2008 21:27:38 -0000 1.121 +++ emacsclient.c 4 Feb 2008 14:50:22 -0000 @@ -171,8 +171,9 @@ #endif { "server-file", required_argument, NULL, 'f' }, #ifndef WINDOWSNT { "display", required_argument, NULL, 'd' }, + { "this-display", no_argument, NULL, 'D'}, #endif { 0, 0, 0, 0 } }; @@ -479,24 +480,15 @@ char **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, #ifndef NO_SOCKETS_IN_FILE_SYSTEM - "VHnea:s:f:d:tc", + "VHnea:s:f:d:Dtc", #else - "VHnea:f:d:tc", + "VHnea:f:d:Dtc", #endif longopts, 0); if (opt == EOF) @@ -530,8 +522,11 @@ #if 1 /* !defined WINDOWS */ case 'd': display = optarg; break; + case 'D': + display = egetenv ("DISPLAY"); + break; #endif case 'n': nowait = 1; @@ -612,9 +607,11 @@ use the current Emacs frame\n\ -e, --eval Evaluate the FILE arguments as ELisp expressions\n\ -n, --no-wait Don't wait for the server to return\n" #ifndef WINDOWSNT -"-d, --display=DISPLAY Visit the file in the given display\n" +"-d, --display=DISPLAY Visit the file in the given X11 display\n" +"-D, --this-display Visit the file in current X11 display\n\ + (found in environment variable $DISPLAY)\n" #endif #ifndef NO_SOCKETS_IN_FILE_SYSTEM "-s, --socket-name=FILENAME\n\ Set filename of the UNIX socket for communication\n"