summaryrefslogtreecommitdiff
path: root/lib-src/emacsclient.c
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2010-05-29 19:50:47 -0400
committerChong Yidong <cyd@stupidchicken.com>2010-05-29 19:50:47 -0400
commit0191e222e375db31e08ef55f4eddc9e01e8d1f80 (patch)
tree4d968cbb6a7df0b288311f3275253b45194541ff /lib-src/emacsclient.c
parentb233600fbd201794a34bee1f3a819adb63eda7ec (diff)
downloademacs-0191e222e375db31e08ef55f4eddc9e01e8d1f80.tar.gz
Add --parent-id argument to emacsclient.
* lib-src/emacsclient.c (longopts, decode_options, print_help_and_exit): New arg `-parent-id'. (main): Send parent-id to Emacs. * lisp/server.el (server-process-filter): Receive parent-id argument from emacsclient. (server-create-window-system-frame): New arg. Pass parent-id as frame parameter.
Diffstat (limited to 'lib-src/emacsclient.c')
-rw-r--r--lib-src/emacsclient.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index 1e7ec7d9678..3172ebb8cd1 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -138,6 +138,9 @@ int current_frame = 1;
/* The display on which Emacs should work. --display. */
char *display = NULL;
+/* The parent window ID, if we are opening a frame via XEmbed. */
+char *parent_id = NULL;
+
/* Nonzero means open a new Emacs frame on the current terminal. */
int tty = 0;
@@ -173,6 +176,7 @@ struct option longopts[] =
#ifndef WINDOWSNT
{ "display", required_argument, NULL, 'd' },
#endif
+ { "parent-id", required_argument, NULL, 'p' },
{ 0, 0, 0, 0 }
};
@@ -583,6 +587,11 @@ decode_options (argc, argv)
current_frame = 0;
break;
+ case 'p':
+ parent_id = optarg;
+ current_frame = 0;
+ break;
+
case 'H':
print_help_and_exit ();
break;
@@ -656,7 +665,8 @@ The following OPTIONS are accepted:\n\
-e, --eval Evaluate the FILE arguments as ELisp expressions\n\
-n, --no-wait Don't wait for the server to return\n\
-d DISPLAY, --display=DISPLAY\n\
- Visit the file in the given display\n"
+ Visit the file in the given display\n\
+--parent-id=ID Open in parent window ID, via XEmbed\n"
#ifndef NO_SOCKETS_IN_FILE_SYSTEM
"-s SOCKET, --socket-name=SOCKET\n\
Set filename of the UNIX socket for communication\n"
@@ -1620,6 +1630,13 @@ main (argc, argv)
send_to_emacs (emacs_socket, " ");
}
+ if (parent_id)
+ {
+ send_to_emacs (emacs_socket, "-parent-id ");
+ quote_argument (emacs_socket, parent_id);
+ 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. */