diff options
Diffstat (limited to 'lib-src/emacsclient.c')
| -rw-r--r-- | lib-src/emacsclient.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index c334fb6a196..2daed7eb9da 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -160,6 +160,10 @@ const char *server_file = NULL; /* PID of the Emacs server process. */ int emacs_pid = 0; +/* If non-NULL, a string that should form a frame parameter alist to + be used for the new frame */ +const char *frame_parameters = NULL; + static void print_help_and_exit (void) NO_RETURN; static void fail (void) NO_RETURN; @@ -175,6 +179,7 @@ struct option longopts[] = { "nw", no_argument, NULL, 't' }, { "create-frame", no_argument, NULL, 'c' }, { "alternate-editor", required_argument, NULL, 'a' }, + { "frame-parameters", required_argument, NULL, 'F' }, #ifndef NO_SOCKETS_IN_FILE_SYSTEM { "socket-name", required_argument, NULL, 's' }, #endif @@ -526,9 +531,9 @@ decode_options (int argc, char **argv) { int opt = getopt_long_only (argc, argv, #ifndef NO_SOCKETS_IN_FILE_SYSTEM - "VHneqa:s:f:d:tc", + "VHneqa:s:f:d:F:tc", #else - "VHneqa:f:d:tc", + "VHneqa:f:d:F:tc", #endif longopts, 0); @@ -599,6 +604,10 @@ decode_options (int argc, char **argv) print_help_and_exit (); break; + case 'F': + frame_parameters = optarg; + break; + default: message (TRUE, "Try `%s --help' for more information\n", progname); exit (EXIT_FAILURE); @@ -665,6 +674,7 @@ The following OPTIONS are accepted:\n\ -nw, -t, --tty Open a new Emacs frame on the current terminal\n\ -c, --create-frame Create a new frame instead of trying to\n\ use the current Emacs frame\n\ +-F, --frame-parameters Set the parameters of a new frame\n\ -e, --eval Evaluate the FILE arguments as ELisp expressions\n\ -n, --no-wait Don't wait for the server to return\n\ -q, --quiet Don't display messages on success\n\ @@ -1630,6 +1640,13 @@ main (int argc, char **argv) send_to_emacs (emacs_socket, " "); } + if (frame_parameters && !current_frame) + { + send_to_emacs (emacs_socket, "-frame-parameters "); + quote_argument (emacs_socket, frame_parameters); + send_to_emacs (emacs_socket, " "); + } + /* If using the current frame, send tty information to Emacs anyway. In daemon mode, Emacs may need to occupy this tty if no other frame is available. */ |
