aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorJoakim Verona2011-06-26 22:00:24 +0200
committerJoakim Verona2011-06-26 22:00:24 +0200
commit76d08552619c83268f1353f449099f50ed6f93fa (patch)
tree321a375628d83d5c8aeea5876cf375ec7ad93f58 /lib-src
parent9fa0e291e866fb7945e18cd2ad8514090c13d510 (diff)
parent5b66d427c05eba5493c27da28c460a129b4203cc (diff)
downloademacs-76d08552619c83268f1353f449099f50ed6f93fa.tar.gz
emacs-76d08552619c83268f1353f449099f50ed6f93fa.zip
first working example of mvc. multiple views of a slider are kept in sync
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/ChangeLog9
-rw-r--r--lib-src/emacsclient.c22
2 files changed, 29 insertions, 2 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index ec123e85036..b7a95fe8043 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,12 @@
12011-06-25 Glenn Morris <rgm@gnu.org>
2
3 * emacsclient.c (decode_options) <opt>: Add `F:'.
4 (print_help_and_exit): Mention --frame-parameters.
5
62011-06-25 Andreas Rottmann <a.rottmann@gmx.at>
7
8 * emacsclient.c (longopts, decode_options, main): Add frame-parameters.
9
12011-06-10 Paul Eggert <eggert@cs.ucla.edu> 102011-06-10 Paul Eggert <eggert@cs.ucla.edu>
2 11
3 * movemail.c: Fix race condition and related bugs (Bug#8836). 12 * movemail.c: Fix race condition and related bugs (Bug#8836).
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index c334fb6a196..c78a42bffe8 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
@@ -526,9 +531,9 @@ decode_options (int argc, char **argv)
526 { 531 {
527 int opt = getopt_long_only (argc, argv, 532 int opt = getopt_long_only (argc, argv,
528#ifndef NO_SOCKETS_IN_FILE_SYSTEM 533#ifndef NO_SOCKETS_IN_FILE_SYSTEM
529 "VHneqa:s:f:d:tc", 534 "VHneqa:s:f:d:F:tc",
530#else 535#else
531 "VHneqa:f:d:tc", 536 "VHneqa:f:d:F:tc",
532#endif 537#endif
533 longopts, 0); 538 longopts, 0);
534 539
@@ -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);
@@ -665,6 +674,8 @@ The following OPTIONS are accepted:\n\
665-nw, -t, --tty Open a new Emacs frame on the current terminal\n\ 674-nw, -t, --tty Open a new Emacs frame on the current terminal\n\
666-c, --create-frame Create a new frame instead of trying to\n\ 675-c, --create-frame Create a new frame instead of trying to\n\
667 use the current Emacs frame\n\ 676 use the current Emacs frame\n\
677-F ALIST, --frame-parameters=ALIST\n\
678 Set the parameters of a new frame\n\
668-e, --eval Evaluate the FILE arguments as ELisp expressions\n\ 679-e, --eval Evaluate the FILE arguments as ELisp expressions\n\
669-n, --no-wait Don't wait for the server to return\n\ 680-n, --no-wait Don't wait for the server to return\n\
670-q, --quiet Don't display messages on success\n\ 681-q, --quiet Don't display messages on success\n\
@@ -1630,6 +1641,13 @@ main (int argc, char **argv)
1630 send_to_emacs (emacs_socket, " "); 1641 send_to_emacs (emacs_socket, " ");
1631 } 1642 }
1632 1643
1644 if (frame_parameters && !current_frame)
1645 {
1646 send_to_emacs (emacs_socket, "-frame-parameters ");
1647 quote_argument (emacs_socket, frame_parameters);
1648 send_to_emacs (emacs_socket, " ");
1649 }
1650
1633 /* If using the current frame, send tty information to Emacs anyway. 1651 /* 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 1652 In daemon mode, Emacs may need to occupy this tty if no other
1635 frame is available. */ 1653 frame is available. */