aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorAndreas Rottmann2011-06-25 11:05:48 -0700
committerGlenn Morris2011-06-25 11:05:48 -0700
commit18a4ce5ea1b06bd077e87fd1ac8966b19b10ee8c (patch)
tree3a84ffb4fba8030f72c58f07dbbabe1d3eb67a36 /lib-src
parent919bbce05b7757431247a771efd3943eab251eb2 (diff)
downloademacs-18a4ce5ea1b06bd077e87fd1ac8966b19b10ee8c.tar.gz
emacs-18a4ce5ea1b06bd077e87fd1ac8966b19b10ee8c.zip
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 ec123e85036..99ec98d62b0 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,7 @@
12011-06-25 Andreas Rottmann <a.rottmann@gmx.at>
2
3 * emacsclient.c (longopts, decode_options, main): Add frame-parameters.
4
12011-06-10 Paul Eggert <eggert@cs.ucla.edu> 52011-06-10 Paul Eggert <eggert@cs.ucla.edu>
2 6
3 * movemail.c: Fix race condition and related bugs (Bug#8836). 7 * movemail.c: Fix race condition and related bugs (Bug#8836).
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index c334fb6a196..56535a02990 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -160,6 +160,10 @@ const char *server_file = NULL;
160/* PID of the Emacs server process. */ 160/* PID of the Emacs server process. */
161int emacs_pid = 0; 161int emacs_pid = 0;
162 162
163/* If non-NULL, a string that should form a frame parameter alist to
164 be used for the new frame */
165const char *frame_parameters = NULL;
166
163static void print_help_and_exit (void) NO_RETURN; 167static void print_help_and_exit (void) NO_RETURN;
164static void fail (void) NO_RETURN; 168static void fail (void) NO_RETURN;
165 169
@@ -175,6 +179,7 @@ struct option longopts[] =
175 { "nw", no_argument, NULL, 't' }, 179 { "nw", no_argument, NULL, 't' },
176 { "create-frame", no_argument, NULL, 'c' }, 180 { "create-frame", no_argument, NULL, 'c' },
177 { "alternate-editor", required_argument, NULL, 'a' }, 181 { "alternate-editor", required_argument, NULL, 'a' },
182 { "frame-parameters", required_argument, NULL, 'F' },
178#ifndef NO_SOCKETS_IN_FILE_SYSTEM 183#ifndef NO_SOCKETS_IN_FILE_SYSTEM
179 { "socket-name", required_argument, NULL, 's' }, 184 { "socket-name", required_argument, NULL, 's' },
180#endif 185#endif
@@ -599,6 +604,10 @@ decode_options (int argc, char **argv)
599 print_help_and_exit (); 604 print_help_and_exit ();
600 break; 605 break;
601 606
607 case 'F':
608 frame_parameters = optarg;
609 break;
610
602 default: 611 default:
603 message (TRUE, "Try `%s --help' for more information\n", progname); 612 message (TRUE, "Try `%s --help' for more information\n", progname);
604 exit (EXIT_FAILURE); 613 exit (EXIT_FAILURE);
@@ -1630,6 +1639,13 @@ main (int argc, char **argv)
1630 send_to_emacs (emacs_socket, " "); 1639 send_to_emacs (emacs_socket, " ");
1631 } 1640 }
1632 1641
1642 if (frame_parameters && !current_frame)
1643 {
1644 send_to_emacs (emacs_socket, "-frame-parameters ");
1645 quote_argument (emacs_socket, frame_parameters);
1646 send_to_emacs (emacs_socket, " ");
1647 }
1648
1633 /* If using the current frame, send tty information to Emacs anyway. 1649 /* If using the current frame, send tty information to Emacs anyway.
1634 In daemon mode, Emacs may need to occupy this tty if no other 1650 In daemon mode, Emacs may need to occupy this tty if no other
1635 frame is available. */ 1651 frame is available. */