aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorKaroly Lorentey2005-09-10 23:51:08 +0000
committerKaroly Lorentey2005-09-10 23:51:08 +0000
commit92071250fabab9d4daa7c6cf0bd7d7c36f73ea41 (patch)
tree1fdb99d17b67629236ce13a68c0d2eb45121c4c1 /lib-src
parent79cf212310d3b1dc039f2f752fd91d54cd03670c (diff)
downloademacs-92071250fabab9d4daa7c6cf0bd7d7c36f73ea41.tar.gz
emacs-92071250fabab9d4daa7c6cf0bd7d7c36f73ea41.zip
Fix `emacsclient -ne '(+ 2 2)'' (reported by Han Boetes), and clean up some corner cases in Emacs server.
* lib-src/emacsclient.c (decode_options): Make --no-wait imply --current-frame, except when it is the only option given. Make sure no frame is opened when --current-frame is set. (main): Pass --current-frame to server.el. * lisp/server.el (server-process-filter): Handle -current-frame command. Don't create frames when it is given. Don't bind X frames to the client when we are in -no-wait mode. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-407
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/emacsclient.c37
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. */
68int eval = 0; 68int eval = 0;
69 69
70/* Nonzero means don't open a new frame. --current-frame. */
71int current_frame = 0;
72
70/* Nonzero means open a new graphical frame. */ 73/* Nonzero means open a new graphical frame. */
71int window_system = 0; 74int 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
187void 197void
@@ -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 ");