diff options
| author | Chong Yidong | 2010-05-29 19:50:47 -0400 |
|---|---|---|
| committer | Chong Yidong | 2010-05-29 19:50:47 -0400 |
| commit | 0191e222e375db31e08ef55f4eddc9e01e8d1f80 (patch) | |
| tree | 4d968cbb6a7df0b288311f3275253b45194541ff /lib-src | |
| parent | b233600fbd201794a34bee1f3a819adb63eda7ec (diff) | |
| download | emacs-0191e222e375db31e08ef55f4eddc9e01e8d1f80.tar.gz emacs-0191e222e375db31e08ef55f4eddc9e01e8d1f80.zip | |
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')
| -rw-r--r-- | lib-src/ChangeLog | 6 | ||||
| -rw-r--r-- | lib-src/emacsclient.c | 19 |
2 files changed, 24 insertions, 1 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index ac1641a552e..d23fe3ff6c2 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2010-05-29 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * emacsclient.c (longopts, decode_options, print_help_and_exit): | ||
| 4 | New arg `-parent-id'. | ||
| 5 | (main): Send parent-id to Emacs. | ||
| 6 | |||
| 1 | 2010-05-27 Glenn Morris <rgm@gnu.org> | 7 | 2010-05-27 Glenn Morris <rgm@gnu.org> |
| 2 | 8 | ||
| 3 | * Makefile.in (distclean): No more Makefile.c. | 9 | * Makefile.in (distclean): No more Makefile.c. |
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; | |||
| 138 | /* The display on which Emacs should work. --display. */ | 138 | /* The display on which Emacs should work. --display. */ |
| 139 | char *display = NULL; | 139 | char *display = NULL; |
| 140 | 140 | ||
| 141 | /* The parent window ID, if we are opening a frame via XEmbed. */ | ||
| 142 | char *parent_id = NULL; | ||
| 143 | |||
| 141 | /* Nonzero means open a new Emacs frame on the current terminal. */ | 144 | /* Nonzero means open a new Emacs frame on the current terminal. */ |
| 142 | int tty = 0; | 145 | int tty = 0; |
| 143 | 146 | ||
| @@ -173,6 +176,7 @@ struct option longopts[] = | |||
| 173 | #ifndef WINDOWSNT | 176 | #ifndef WINDOWSNT |
| 174 | { "display", required_argument, NULL, 'd' }, | 177 | { "display", required_argument, NULL, 'd' }, |
| 175 | #endif | 178 | #endif |
| 179 | { "parent-id", required_argument, NULL, 'p' }, | ||
| 176 | { 0, 0, 0, 0 } | 180 | { 0, 0, 0, 0 } |
| 177 | }; | 181 | }; |
| 178 | 182 | ||
| @@ -583,6 +587,11 @@ decode_options (argc, argv) | |||
| 583 | current_frame = 0; | 587 | current_frame = 0; |
| 584 | break; | 588 | break; |
| 585 | 589 | ||
| 590 | case 'p': | ||
| 591 | parent_id = optarg; | ||
| 592 | current_frame = 0; | ||
| 593 | break; | ||
| 594 | |||
| 586 | case 'H': | 595 | case 'H': |
| 587 | print_help_and_exit (); | 596 | print_help_and_exit (); |
| 588 | break; | 597 | break; |
| @@ -656,7 +665,8 @@ The following OPTIONS are accepted:\n\ | |||
| 656 | -e, --eval Evaluate the FILE arguments as ELisp expressions\n\ | 665 | -e, --eval Evaluate the FILE arguments as ELisp expressions\n\ |
| 657 | -n, --no-wait Don't wait for the server to return\n\ | 666 | -n, --no-wait Don't wait for the server to return\n\ |
| 658 | -d DISPLAY, --display=DISPLAY\n\ | 667 | -d DISPLAY, --display=DISPLAY\n\ |
| 659 | Visit the file in the given display\n" | 668 | Visit the file in the given display\n\ |
| 669 | --parent-id=ID Open in parent window ID, via XEmbed\n" | ||
| 660 | #ifndef NO_SOCKETS_IN_FILE_SYSTEM | 670 | #ifndef NO_SOCKETS_IN_FILE_SYSTEM |
| 661 | "-s SOCKET, --socket-name=SOCKET\n\ | 671 | "-s SOCKET, --socket-name=SOCKET\n\ |
| 662 | Set filename of the UNIX socket for communication\n" | 672 | Set filename of the UNIX socket for communication\n" |
| @@ -1620,6 +1630,13 @@ main (argc, argv) | |||
| 1620 | send_to_emacs (emacs_socket, " "); | 1630 | send_to_emacs (emacs_socket, " "); |
| 1621 | } | 1631 | } |
| 1622 | 1632 | ||
| 1633 | if (parent_id) | ||
| 1634 | { | ||
| 1635 | send_to_emacs (emacs_socket, "-parent-id "); | ||
| 1636 | quote_argument (emacs_socket, parent_id); | ||
| 1637 | send_to_emacs (emacs_socket, " "); | ||
| 1638 | } | ||
| 1639 | |||
| 1623 | /* If using the current frame, send tty information to Emacs anyway. | 1640 | /* If using the current frame, send tty information to Emacs anyway. |
| 1624 | In daemon mode, Emacs may need to occupy this tty if no other | 1641 | In daemon mode, Emacs may need to occupy this tty if no other |
| 1625 | frame is available. */ | 1642 | frame is available. */ |