[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/server.el,v
From: |
Chong Yidong |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/server.el,v |
Date: |
Thu, 30 Oct 2008 15:50:02 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Chong Yidong <cyd> 08/10/30 15:50:02
Index: server.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/server.el,v
retrieving revision 1.170
retrieving revision 1.171
diff -u -b -r1.170 -r1.171
--- server.el 29 Oct 2008 10:42:35 -0000 1.170
+++ server.el 30 Oct 2008 15:50:01 -0000 1.171
@@ -810,6 +810,7 @@
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,7 +831,7 @@
((equal "-nowait" arg) (setq nowait t))
;; -current-frame: Don't create frames.
- ((equal "-current-frame" arg) (setq tty-name nil))
+ ((equal "-current-frame" arg) (setq use-current-frame t))
;; -display DISPLAY:
;; Open X frames on the given display instead of the default.
@@ -874,7 +875,8 @@
(cdr command-line-args-left))
(setq tty-name (pop command-line-args-left)
tty-type (pop command-line-args-left)
- dontkill t))
+ dontkill (or dontkill
+ (not use-current-frame))))
;; -position LINE[:COLUMN]: Set point to the given
;; position in the next file.
@@ -902,6 +904,8 @@
;; -eval EXPR: Evaluate a Lisp expression.
((and (equal "-eval" arg)
command-line-args-left)
+ (if use-current-frame
+ (setq use-current-frame 'always))
(lexical-let ((expr (pop command-line-args-left)))
(if coding-system
(setq expr (decode-coding-string expr coding-system)))
@@ -927,9 +931,17 @@
(t (error "Unknown command: %s" arg))))
(setq frame
- (case tty-name
- ((nil) (if display (server-select-display display)))
- ((window-system)
+ (cond
+ ((and use-current-frame
+ (or (eq use-current-frame 'always)
+ ;; We can't use the Emacs daemon's
+ ;; terminal frame.
+ (not (and (= (length (frame-list)) 1)
+ (eq (selected-frame)
+ terminal-frame)))))
+ (setq tty-name nil)
+ (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))))