[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#1267: Emacsclient can't find terminal in daemon mode
From: |
Chong Yidong |
Subject: |
bug#1267: Emacsclient can't find terminal in daemon mode |
Date: |
Wed, 29 Oct 2008 23:55:03 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) |
How bout something on these lines?
The effect is that instead of signalling an error when no -t or -c is
passed and no usable frame exists, Emacs opens the tty of the calling
emacsclient.
*** trunk/lib-src/emacsclient.c.~1.135.~ 2008-10-29 11:38:04.000000000
-0400
--- trunk/lib-src/emacsclient.c 2008-10-29 23:10:45.000000000 -0400
***************
*** 1437,1443 ****
send_to_emacs (emacs_socket, " ");
}
! if (tty)
{
char *type = egetenv ("TERM");
char *tty_name = NULL;
--- 1437,1443 ----
send_to_emacs (emacs_socket, " ");
}
! if (tty || current_frame)
{
char *type = egetenv ("TERM");
char *tty_name = NULL;
*** trunk/lisp/server.el.~1.170.~ 2008-10-29 11:38:05.000000000 -0400
--- trunk/lisp/server.el 2008-10-29 23:48:42.000000000 -0400
***************
*** 810,815 ****
--- 810,816 ----
dontkill ; t if the client should not be killed.
(commands ())
dir
+ use-current-frame
(tty-name nil) ;nil, `window-system', or the tty name.
tty-type ;string.
(files nil)
***************
*** 830,836 ****
((equal "-nowait" arg) (setq nowait t))
;; -current-frame: Don't create frames.
! ((equal "-current-frame" arg) (setq tty-name nil))
;; -display DISPLAY:
;; Open X frames on the given display instead of the default.
--- 831,837 ----
((equal "-nowait" arg) (setq nowait t))
;; -current-frame: Don't create frames.
! ((equal "-current-frame" arg) (setq use-current-frame t))
;; -display DISPLAY:
;; Open X frames on the given display instead of the default.
***************
*** 926,937 ****
;; Unknown command.
(t (error "Unknown command: %s" arg))))
! (setq frame
! (case tty-name
! ((nil) (if display (server-select-display display)))
! ((window-system)
! (server-create-window-system-frame display nowait proc))
! (t (server-create-tty-frame tty-name tty-type proc))))
(process-put
proc 'continuation
--- 927,940 ----
;; Unknown command.
(t (error "Unknown command: %s" arg))))
! (cond ((and use-current-frame
! (not (and (daemonp)
! (= (length (frame-list)) 1)
! (eq (selected-frame) terminal-frame))))
! (if display (server-select-display display)))
! ((eq tty-name 'window-system)
! (server-create-window-system-frame display nowait proc))
! (t (server-create-tty-frame tty-name tty-type proc)))
(process-put
proc 'continuation
bug#1267: Emacsclient can't find terminal in daemon mode, Stefan Monnier, 2008/10/29
bug#1267: marked as done (Emacsclient can't find terminal in daemon mode), Emacs bug Tracking System, 2008/10/30