aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/term
diff options
context:
space:
mode:
authorDaniel Colascione2012-09-17 03:55:05 -0800
committerDaniel Colascione2012-09-17 03:55:05 -0800
commitefc3dd3ccceae28db0a3fde54ed00478ff77c2e2 (patch)
tree19d4077c435c3fcc678c30fccbd2aa18b2f60ce1 /lisp/term
parentce9f00e4e53c3a55cb78fa3dd1043d8f59ed47e3 (diff)
downloademacs-efc3dd3ccceae28db0a3fde54ed00478ff77c2e2.tar.gz
emacs-efc3dd3ccceae28db0a3fde54ed00478ff77c2e2.zip
Detect window-system from display name
Diffstat (limited to 'lisp/term')
-rw-r--r--lisp/term/ns-win.el4
-rw-r--r--lisp/term/w32-win.el7
-rw-r--r--lisp/term/x-win.el5
3 files changed, 13 insertions, 3 deletions
diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el
index 06b67475c1d..b46c31afdeb 100644
--- a/lisp/term/ns-win.el
+++ b/lisp/term/ns-win.el
@@ -39,7 +39,7 @@
39;; this file, which works in close coordination with src/nsfns.m. 39;; this file, which works in close coordination with src/nsfns.m.
40 40
41;;; Code: 41;;; Code:
42 42(eval-when-compile (require 'cl-lib))
43(or (featurep 'ns) 43(or (featurep 'ns)
44 (error "%s: Loading ns-win.el but not compiled for GNUstep/MacOS" 44 (error "%s: Loading ns-win.el but not compiled for GNUstep/MacOS"
45 (invocation-name))) 45 (invocation-name)))
@@ -897,6 +897,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
897;; defines functions and variables that we use now. 897;; defines functions and variables that we use now.
898(defun ns-initialize-window-system () 898(defun ns-initialize-window-system ()
899 "Initialize Emacs for Nextstep (Cocoa / GNUstep) windowing." 899 "Initialize Emacs for Nextstep (Cocoa / GNUstep) windowing."
900 (cl-assert (not ns-initialized))
900 901
901 ;; PENDING: not needed? 902 ;; PENDING: not needed?
902 (setq command-line-args (x-handle-args command-line-args)) 903 (setq command-line-args (x-handle-args command-line-args))
@@ -924,6 +925,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
924 (x-apply-session-resources) 925 (x-apply-session-resources)
925 (setq ns-initialized t)) 926 (setq ns-initialized t))
926 927
928(add-to-list 'display-format-alist '("\\`ns\\'" . ns))
927(add-to-list 'handle-args-function-alist '(ns . x-handle-args)) 929(add-to-list 'handle-args-function-alist '(ns . x-handle-args))
928(add-to-list 'frame-creation-function-alist '(ns . x-create-frame-with-faces)) 930(add-to-list 'frame-creation-function-alist '(ns . x-create-frame-with-faces))
929(add-to-list 'window-system-initialization-alist '(ns . ns-initialize-window-system)) 931(add-to-list 'window-system-initialization-alist '(ns . ns-initialize-window-system))
diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el
index dd577af0ae1..841a45c23a2 100644
--- a/lisp/term/w32-win.el
+++ b/lisp/term/w32-win.el
@@ -68,6 +68,7 @@
68;; (if (not (eq window-system 'w32)) 68;; (if (not (eq window-system 'w32))
69;; (error "%s: Loading w32-win.el but not compiled for w32" (invocation-name))) 69;; (error "%s: Loading w32-win.el but not compiled for w32" (invocation-name)))
70 70
71(eval-when-compile (require 'cl-lib))
71(require 'frame) 72(require 'frame)
72(require 'mouse) 73(require 'mouse)
73(require 'scroll-bar) 74(require 'scroll-bar)
@@ -240,6 +241,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
240 241
241(defun w32-initialize-window-system () 242(defun w32-initialize-window-system ()
242 "Initialize Emacs for W32 GUI frames." 243 "Initialize Emacs for W32 GUI frames."
244 (cl-assert (not w32-initialized))
243 245
244 ;; Do the actual Windows setup here; the above code just defines 246 ;; Do the actual Windows setup here; the above code just defines
245 ;; functions and variables that we use now. 247 ;; functions and variables that we use now.
@@ -253,7 +255,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
253 ;; so as not to choke when we use it in X resource queries. 255 ;; so as not to choke when we use it in X resource queries.
254 (replace-regexp-in-string "[.*]" "-" (invocation-name)))) 256 (replace-regexp-in-string "[.*]" "-" (invocation-name))))
255 257
256 (x-open-connection "" x-command-line-resources 258 (x-open-connection "w32" x-command-line-resources
257 ;; Exit with a fatal error if this fails and we 259 ;; Exit with a fatal error if this fails and we
258 ;; are the initial display 260 ;; are the initial display
259 (eq initial-window-system 'w32)) 261 (eq initial-window-system 'w32))
@@ -304,7 +306,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
304 (setq default-frame-alist 306 (setq default-frame-alist
305 (cons '(reverse . t) default-frame-alist))))) 307 (cons '(reverse . t) default-frame-alist)))))
306 308
307 ;; Don't let Emacs suspend under w32 gui 309 ;; Don't let Emacs suspend under Windows.
308 (add-hook 'suspend-hook 'x-win-suspend-error) 310 (add-hook 'suspend-hook 'x-win-suspend-error)
309 311
310 ;; Turn off window-splitting optimization; w32 is usually fast enough 312 ;; Turn off window-splitting optimization; w32 is usually fast enough
@@ -322,6 +324,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
322 (x-apply-session-resources) 324 (x-apply-session-resources)
323 (setq w32-initialized t)) 325 (setq w32-initialized t))
324 326
327(add-to-list 'display-format-alist '("\\`w32\\'" . w32))
325(add-to-list 'handle-args-function-alist '(w32 . x-handle-args)) 328(add-to-list 'handle-args-function-alist '(w32 . x-handle-args))
326(add-to-list 'frame-creation-function-alist '(w32 . x-create-frame-with-faces)) 329(add-to-list 'frame-creation-function-alist '(w32 . x-create-frame-with-faces))
327(add-to-list 'window-system-initialization-alist '(w32 . w32-initialize-window-system)) 330(add-to-list 'window-system-initialization-alist '(w32 . w32-initialize-window-system))
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el
index 9b7254cd132..2f2125a31db 100644
--- a/lisp/term/x-win.el
+++ b/lisp/term/x-win.el
@@ -67,6 +67,8 @@
67;; An alist of X options and the function which handles them. See 67;; An alist of X options and the function which handles them. See
68;; ../startup.el. 68;; ../startup.el.
69 69
70(eval-when-compile (require 'cl-lib))
71
70(if (not (fboundp 'x-create-frame)) 72(if (not (fboundp 'x-create-frame))
71 (error "%s: Loading x-win.el but not compiled for X" (invocation-name))) 73 (error "%s: Loading x-win.el but not compiled for X" (invocation-name)))
72 74
@@ -1338,6 +1340,8 @@ Request data types in the order specified by `x-select-request-type'."
1338 1340
1339(defun x-initialize-window-system () 1341(defun x-initialize-window-system ()
1340 "Initialize Emacs for X frames and open the first connection to an X server." 1342 "Initialize Emacs for X frames and open the first connection to an X server."
1343 (cl-assert (not x-initialized))
1344
1341 ;; Make sure we have a valid resource name. 1345 ;; Make sure we have a valid resource name.
1342 (or (stringp x-resource-name) 1346 (or (stringp x-resource-name)
1343 (let (i) 1347 (let (i)
@@ -1451,6 +1455,7 @@ Request data types in the order specified by `x-select-request-type'."
1451 (x-apply-session-resources) 1455 (x-apply-session-resources)
1452 (setq x-initialized t)) 1456 (setq x-initialized t))
1453 1457
1458(add-to-list 'display-format-alist '("\\`[^:]*:[0-9]+\\(\\.[0-9]+\\)?\\'" . x))
1454(add-to-list 'handle-args-function-alist '(x . x-handle-args)) 1459(add-to-list 'handle-args-function-alist '(x . x-handle-args))
1455(add-to-list 'frame-creation-function-alist '(x . x-create-frame-with-faces)) 1460(add-to-list 'frame-creation-function-alist '(x . x-create-frame-with-faces))
1456(add-to-list 'window-system-initialization-alist '(x . x-initialize-window-system)) 1461(add-to-list 'window-system-initialization-alist '(x . x-initialize-window-system))