diff options
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/emacsclient.c | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 4908d49441b..ecd0d18ce85 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c | |||
| @@ -67,6 +67,9 @@ int nowait = 0; | |||
| 67 | /* Nonzero means args are expressions to be evaluated. --eval. */ | 67 | /* Nonzero means args are expressions to be evaluated. --eval. */ |
| 68 | int eval = 0; | 68 | int eval = 0; |
| 69 | 69 | ||
| 70 | /* Nonzero means don't open a new frame. --current-frame. */ | ||
| 71 | int current_frame = 0; | ||
| 72 | |||
| 70 | /* Nonzero means open a new graphical frame. */ | 73 | /* Nonzero means open a new graphical frame. */ |
| 71 | int window_system = 0; | 74 | int window_system = 0; |
| 72 | 75 | ||
| @@ -112,11 +115,6 @@ decode_options (argc, argv) | |||
| 112 | if (display && strlen (display) == 0) | 115 | if (display && strlen (display) == 0) |
| 113 | display = NULL; | 116 | display = NULL; |
| 114 | 117 | ||
| 115 | if (display) | ||
| 116 | window_system = 1; | ||
| 117 | else | ||
| 118 | tty = 1; | ||
| 119 | |||
| 120 | while (1) | 118 | while (1) |
| 121 | { | 119 | { |
| 122 | int opt = getopt_long (argc, argv, | 120 | int opt = getopt_long (argc, argv, |
| @@ -159,12 +157,10 @@ decode_options (argc, argv) | |||
| 159 | 157 | ||
| 160 | case 't': | 158 | case 't': |
| 161 | tty = 1; | 159 | tty = 1; |
| 162 | window_system = 0; | ||
| 163 | break; | 160 | break; |
| 164 | 161 | ||
| 165 | case 'c': | 162 | case 'c': |
| 166 | window_system = 0; | 163 | current_frame = 1; |
| 167 | tty = 0; | ||
| 168 | break; | 164 | break; |
| 169 | 165 | ||
| 170 | case 'H': | 166 | case 'H': |
| @@ -178,10 +174,24 @@ decode_options (argc, argv) | |||
| 178 | } | 174 | } |
| 179 | } | 175 | } |
| 180 | 176 | ||
| 181 | if (tty) { | 177 | if (!tty && display) |
| 182 | nowait = 0; | 178 | window_system = 1; |
| 183 | display = 0; | 179 | else |
| 184 | } | 180 | tty = 1; |
| 181 | |||
| 182 | /* `emacsclient --no-wait' should open a new permanent frame, then exit. | ||
| 183 | Otherwise, --no-wait always implies --current-frame. */ | ||
| 184 | if (nowait && argc - optind > 0) | ||
| 185 | current_frame = 1; | ||
| 186 | |||
| 187 | if (current_frame) | ||
| 188 | { | ||
| 189 | tty = 0; | ||
| 190 | window_system = 0; | ||
| 191 | } | ||
| 192 | |||
| 193 | if (tty) | ||
| 194 | window_system = 0; | ||
| 185 | } | 195 | } |
| 186 | 196 | ||
| 187 | void | 197 | void |
| @@ -710,6 +720,9 @@ To start the server in Emacs, type \"M-x server-start\".\n", | |||
| 710 | if (nowait) | 720 | if (nowait) |
| 711 | fprintf (out, "-nowait "); | 721 | fprintf (out, "-nowait "); |
| 712 | 722 | ||
| 723 | if (current_frame) | ||
| 724 | fprintf (out, "-current-frame "); | ||
| 725 | |||
| 713 | if (display) | 726 | if (display) |
| 714 | { | 727 | { |
| 715 | fprintf (out, "-display "); | 728 | fprintf (out, "-display "); |