diff options
| author | Karoly Lorentey | 2004-02-20 01:46:26 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2004-02-20 01:46:26 +0000 |
| commit | e5299d8d654237697301709aacfa65d58858cb07 (patch) | |
| tree | c7faff565fdf31ddf8866fdc3e900378c8cc3187 | |
| parent | a9298135d89f27d4dba9c3e7ca5a7f91839ad944 (diff) | |
| download | emacs-e5299d8d654237697301709aacfa65d58858cb07.tar.gz emacs-e5299d8d654237697301709aacfa65d58858cb07.zip | |
Changed emacsclient to open new frames by default.
lib-src/emacsclient.c (decode_options): Handle the case when $DISPLAY
is an empty string. Set window_system or tty to one by default,
depending on if there is a valid display.
(longopts, decode_options, print_help_and_exit): Removed -w, added -c.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-85
| -rw-r--r-- | README.multi-tty | 4 | ||||
| -rw-r--r-- | lib-src/emacsclient.c | 17 |
2 files changed, 16 insertions, 5 deletions
diff --git a/README.multi-tty b/README.multi-tty index 6579a5baf0c..477bbb39ffe 100644 --- a/README.multi-tty +++ b/README.multi-tty | |||
| @@ -134,6 +134,10 @@ For the NEWS file: | |||
| 134 | *** Emacsclient has been extended to support opening a new terminal | 134 | *** Emacsclient has been extended to support opening a new terminal |
| 135 | frame (see -t option). | 135 | frame (see -t option). |
| 136 | 136 | ||
| 137 | *** The behaviour of Emacsclient has been changed to open a new Emacs | ||
| 138 | frame by default. Use the -c option to get the old behavior of | ||
| 139 | opening files in the currently selected Emacs frame. | ||
| 140 | |||
| 137 | *** A make-frame-on-tty function has been added to make it easier to | 141 | *** A make-frame-on-tty function has been added to make it easier to |
| 138 | create frames on new terminals. | 142 | create frames on new terminals. |
| 139 | 143 | ||
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 3bb2b70ba6d..1ef45481840 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c | |||
| @@ -95,7 +95,7 @@ struct option longopts[] = | |||
| 95 | { "help", no_argument, NULL, 'H' }, | 95 | { "help", no_argument, NULL, 'H' }, |
| 96 | { "version", no_argument, NULL, 'V' }, | 96 | { "version", no_argument, NULL, 'V' }, |
| 97 | { "tty", no_argument, NULL, 't' }, | 97 | { "tty", no_argument, NULL, 't' }, |
| 98 | { "window-system", no_argument, NULL, 'w' }, | 98 | { "current-frame", no_argument, NULL, 'c' }, |
| 99 | { "alternate-editor", required_argument, NULL, 'a' }, | 99 | { "alternate-editor", required_argument, NULL, 'a' }, |
| 100 | { "socket-name", required_argument, NULL, 's' }, | 100 | { "socket-name", required_argument, NULL, 's' }, |
| 101 | { "display", required_argument, NULL, 'd' }, | 101 | { "display", required_argument, NULL, 'd' }, |
| @@ -112,11 +112,18 @@ decode_options (argc, argv) | |||
| 112 | { | 112 | { |
| 113 | alternate_editor = getenv ("ALTERNATE_EDITOR"); | 113 | alternate_editor = getenv ("ALTERNATE_EDITOR"); |
| 114 | display = getenv ("DISPLAY"); | 114 | display = getenv ("DISPLAY"); |
| 115 | if (strlen (display) == 0) | ||
| 116 | display = NULL; | ||
| 117 | |||
| 118 | if (display) | ||
| 119 | window_system = 1; | ||
| 120 | else | ||
| 121 | tty = 1; | ||
| 115 | 122 | ||
| 116 | while (1) | 123 | while (1) |
| 117 | { | 124 | { |
| 118 | int opt = getopt_long (argc, argv, | 125 | int opt = getopt_long (argc, argv, |
| 119 | "VHnea:s:d:tw", longopts, 0); | 126 | "VHnea:s:d:tc", longopts, 0); |
| 120 | 127 | ||
| 121 | if (opt == EOF) | 128 | if (opt == EOF) |
| 122 | break; | 129 | break; |
| @@ -158,8 +165,8 @@ decode_options (argc, argv) | |||
| 158 | window_system = 0; | 165 | window_system = 0; |
| 159 | break; | 166 | break; |
| 160 | 167 | ||
| 161 | case 'w': | 168 | case 'c': |
| 162 | window_system = 1; | 169 | window_system = 0; |
| 163 | tty = 0; | 170 | tty = 0; |
| 164 | break; | 171 | break; |
| 165 | 172 | ||
| @@ -192,7 +199,7 @@ The following OPTIONS are accepted:\n\ | |||
| 192 | -V, --version Just print a version info and return\n\ | 199 | -V, --version Just print a version info and return\n\ |
| 193 | -H, --help Print this usage information message\n\ | 200 | -H, --help Print this usage information message\n\ |
| 194 | -t, --tty Open a new Emacs frame on the current terminal\n\ | 201 | -t, --tty Open a new Emacs frame on the current terminal\n\ |
| 195 | -w, --window-system Open a new graphical Emacs frame\n\ | 202 | -c, --current-frame Do not create a new frame; use the current Emacs frame\n\ |
| 196 | -n, --no-wait Don't wait for the server to return\n\ | 203 | -n, --no-wait Don't wait for the server to return\n\ |
| 197 | -e, --eval Evaluate the FILE arguments as ELisp expressions\n\ | 204 | -e, --eval Evaluate the FILE arguments as ELisp expressions\n\ |
| 198 | -d, --display=DISPLAY Visit the file in the given display\n\ | 205 | -d, --display=DISPLAY Visit the file in the given display\n\ |