/* Nonzero means don't open a new frame. Inverse of --create-frame. */
int current_frame = 1;
+/* Nonzero means open a new Emacs tab. */
+int create_tab = 0;
+
/* The display on which Emacs should work. --display. */
char *display = NULL;
{ "tty", no_argument, NULL, 't' },
{ "nw", no_argument, NULL, 't' },
{ "create-frame", no_argument, NULL, 'c' },
+ { "create-tab", no_argument, NULL, 'x' },
{ "alternate-editor", required_argument, NULL, 'a' },
#ifndef NO_SOCKETS_IN_FILE_SYSTEM
{ "socket-name", required_argument, NULL, 's' },
current_frame = 0;
break;
+ case 'x':
+ create_tab = 1;
+ break;
+
case 'H':
print_help_and_exit ();
break;
-nw, -t, --tty Open a new Emacs frame on the current terminal\n\
-c, --create-frame Create a new frame instead of trying to\n\
use the current Emacs frame\n\
+-t, --create-tab Create a new tab on the current Emacs frame\n\
-e, --eval Evaluate the FILE arguments as ELisp expressions\n\
-n, --no-wait Don't wait for the server to return\n\
-d DISPLAY, --display=DISPLAY\n\
if (current_frame)
send_to_emacs (emacs_socket, "-current-frame ");
+ if (create_tab)
+ send_to_emacs (emacs_socket, "-create-tab ");
+
if (display)
{
send_to_emacs (emacs_socket, "-display ");
`-current-frame'
Forbid the creation of new frames.
+`-create-tab'
+ Create a new tab on the current Emacs frame.
+
`-nowait'
Request that the next frame created should not be
associated with this client.
commands
dir
use-current-frame
+ create-tab
tty-name ;nil, `window-system', or the tty name.
tty-type ;string.
files
;; -current-frame: Don't create frames.
((equal "-current-frame" arg) (setq use-current-frame t))
+ ;; -create-tab: Create a new tab.
+ ((equal "-create-tab" arg) (setq create-tab t))
+
;; -display DISPLAY:
;; Open X frames on the given display instead of the default.
((and (equal "-display" arg) command-line-args-left)
(tty-name
(server-create-tty-frame tty-name tty-type proc))))
+ (when create-tab
+ (select-tab (make-tab)))
+
(process-put
proc 'continuation
(lexical-let ((proc proc)