summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorMark Laws <mdl@60hz.org>2015-02-27 12:43:30 +0200
committerEli Zaretskii <eliz@gnu.org>2015-02-27 12:43:30 +0200
commit805fe507087b9675a010a30a8a8840587ffdf5be (patch)
tree9b91858096495590692d1f5fe814cb64d9712f8b /lisp
parent6ef14349fa73922473ba8202e256f20e17661b25 (diff)
downloademacs-805fe507087b9675a010a30a8a8840587ffdf5be.tar.gz
Support daemon mode on MS-Windows (bug#19688)
src/emacs.c <w32_daemon_event> [WINDOWSNT]: New global var. (main) [WINDOWSNT]: Initialize it to NULL. Create the event to signal clients we are ready for connections. (Fdaemon_initialized): Use DAEMON_RUNNING. [WINDOWSNT]: MS-Windows specific code to signal clients we are ready for connections. src/lisp.h (DAEMON_RUNNING): New macro, encapsulates Posix and MS-Windows conditions for running in daemon mode. src/minibuf.c (read_minibuf): Use DAEMON_RUNNING. src/keyboard.c (kbd_buffer_get_event): Use DAEMON_RUNNING. src/dispnew.c (init_display) [WINDOWSNT]: Initialize frames/terminal even in daemon mode. nt/inc/ms-w32.h (W32_DAEMON_EVENT): New macro. lib-src/emacsclient.c (decode_options) [WINDOWSNT]: Don't reject empty arguments for --alternate-editor. (print_help_and_exit) [WINDOWSNT]: Don't refrain from advertising empty arguments for --alternate-editor. (start_daemon_and_retry_set_socket) [WINDOWSNT]: MS-Windows specific code to start Emacs in daemon mode and wait for it to be ready for client connections. lisp/server.el (server-process-filter): Force GUI frames on MS-Windows in daemon mode, even if a TTY frame was requested. lisp/frameset.el (frameset-keep-original-display-p): Don't assume windows-nt cannot be in daemon mode. lisp/frame.el (window-system-for-display): Don't assume windows-nt cannot be in daemon mode.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog12
-rw-r--r--lisp/frame.el3
-rw-r--r--lisp/frameset.el4
-rw-r--r--lisp/server.el12
4 files changed, 25 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e9f62365f03..b9681d35cf0 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,15 @@
+2015-02-27 Mark Laws <mdl@60hz.org>
+
+ Support daemon mode on MS-Windows (bug#19688)
+ * server.el (server-process-filter): Force GUI frames on
+ MS-Windows in daemon mode, even if a TTY frame was requested.
+
+ * frameset.el (frameset-keep-original-display-p): Don't assume
+ windows-nt cannot be in daemon mode.
+
+ * frame.el (window-system-for-display): Don't assume windows-nt
+ cannot be in daemon mode.
+
2015-02-26 Ivan Shmakov <ivan@siamics.net>
* faces.el (face-list-p): Split from face-at-point.
diff --git a/lisp/frame.el b/lisp/frame.el
index 0096ef9696a..c81ee9bfa61 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -546,7 +546,8 @@ is not considered (see `next-frame')."
Return nil if we don't know how to interpret DISPLAY."
;; MS-Windows doesn't know how to create a GUI frame in a -nw session.
(if (and (eq system-type 'windows-nt)
- (null (window-system)))
+ (null (window-system))
+ (not (daemonp)))
nil
(cl-loop for descriptor in display-format-alist
for pattern = (car descriptor)
diff --git a/lisp/frameset.el b/lisp/frameset.el
index 4a0637439db..17fe39be844 100644
--- a/lisp/frameset.el
+++ b/lisp/frameset.el
@@ -1022,8 +1022,8 @@ Internal use only."
(defun frameset-keep-original-display-p (force-display)
"True if saved frames' displays should be honored.
For the meaning of FORCE-DISPLAY, see `frameset-restore'."
- (cond ((daemonp) t)
- ((eq system-type 'windows-nt) nil) ;; Does ns support more than one display?
+ (cond ((eq system-type 'windows-nt) nil) ;; Does ns support more than one display?
+ ((daemonp) t)
(t (not force-display))))
(defun frameset-minibufferless-first-p (frame1 _frame2)
diff --git a/lisp/server.el b/lisp/server.el
index 166cd44bb2e..9585b1755c6 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -1139,9 +1139,12 @@ The following commands are accepted by the client:
;; frame. If running a GUI server, force the frame
;; type to GUI. (Cygwin is perfectly happy with
;; multi-tty support, so don't override the user's
- ;; choice there.)
+ ;; choice there.) In daemon mode on Windows, we can't
+ ;; make tty frames, so force the frame type to GUI
+ ;; there too.
(when (and (eq system-type 'windows-nt)
- (eq window-system 'w32))
+ (or (daemonp)
+ (eq window-system 'w32)))
(push "-window-system" args-left)))
;; -position LINE[:COLUMN]: Set point to the given
@@ -1215,7 +1218,10 @@ The following commands are accepted by the client:
terminal-frame)))))
(setq tty-name nil tty-type nil)
(if display (server-select-display display)))
- ((eq tty-name 'window-system)
+ ((or (and (eq system-type 'windows-nt)
+ (daemonp)
+ (setq display "w32"))
+ (eq tty-name 'window-system))
(server-create-window-system-frame display nowait proc
parent-id
frame-parameters))