Mercurial > emacs
diff lib-src/emacsclient.c @ 83367:2b5fb28780be
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
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Sat, 10 Sep 2005 23:51:08 +0000 |
parents | 532e0a9335a9 |
children | f4766b398a30 |
line wrap: on
line diff
--- a/lib-src/emacsclient.c Sat Sep 10 23:00:15 2005 +0000 +++ b/lib-src/emacsclient.c Sat Sep 10 23:51:08 2005 +0000 @@ -67,6 +67,9 @@ /* Nonzero means args are expressions to be evaluated. --eval. */ int eval = 0; +/* Nonzero means don't open a new frame. --current-frame. */ +int current_frame = 0; + /* Nonzero means open a new graphical frame. */ int window_system = 0; @@ -112,11 +115,6 @@ if (display && strlen (display) == 0) display = NULL; - if (display) - window_system = 1; - else - tty = 1; - while (1) { int opt = getopt_long (argc, argv, @@ -159,12 +157,10 @@ case 't': tty = 1; - window_system = 0; break; case 'c': - window_system = 0; - tty = 0; + current_frame = 1; break; case 'H': @@ -178,10 +174,24 @@ } } - if (tty) { - nowait = 0; - display = 0; - } + if (!tty && display) + window_system = 1; + else + tty = 1; + + /* `emacsclient --no-wait' should open a new permanent frame, then exit. + Otherwise, --no-wait always implies --current-frame. */ + if (nowait && argc - optind > 0) + current_frame = 1; + + if (current_frame) + { + tty = 0; + window_system = 0; + } + + if (tty) + window_system = 0; } void @@ -710,6 +720,9 @@ if (nowait) fprintf (out, "-nowait "); + if (current_frame) + fprintf (out, "-current-frame "); + if (display) { fprintf (out, "-display ");