aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorAndreas Rottmann <[email protected]>2011-06-25 11:05:48 -0700
committerGlenn Morris <[email protected]>2011-06-25 11:05:48 -0700
commit18a4ce5ea1b06bd077e87fd1ac8966b19b10ee8c (patch)
tree3a84ffb4fba8030f72c58f07dbbabe1d3eb67a36 /lib-src
parent919bbce05b7757431247a771efd3943eab251eb2 (diff)
Allow emacsclient to set parameters of new graphical frames (bug#5864)
* lib-src/emacsclient.c (longopts, decode_options, main): Add frame-parameters. * lisp/server.el (server-create-window-system-frame): Add parameters arg. (server-process-filter): Doc fix. Handle frame-parameters. * doc/emacs/misc.texi (emacsclient Options): Mention --frame-parameters. * doc/man/emacsclient.1: Mention --frame-parameters. * etc/NEWS: Mention this.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/ChangeLog4
-rw-r--r--lib-src/emacsclient.c16
2 files changed, 20 insertions, 0 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index ec123e8503..99ec98d62b 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,7 @@
+2011-06-25 Andreas Rottmann <[email protected]>
+
+ * emacsclient.c (longopts, decode_options, main): Add frame-parameters.
+
2011-06-10 Paul Eggert <[email protected]>
* movemail.c: Fix race condition and related bugs (Bug#8836).
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index c334fb6a19..56535a0299 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
@@ -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);
@@ -1630,6 +1639,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. */