diff options
author | Daniel Colascione <dancol@dancol.org> | 2012-09-17 03:55:05 -0800 |
---|---|---|
committer | Daniel Colascione <dancol@dancol.org> | 2012-09-17 03:55:05 -0800 |
commit | efc3dd3ccceae28db0a3fde54ed00478ff77c2e2 (patch) | |
tree | 19d4077c435c3fcc678c30fccbd2aa18b2f60ce1 /lisp/term | |
parent | ce9f00e4e53c3a55cb78fa3dd1043d8f59ed47e3 (diff) | |
download | emacs-efc3dd3ccceae28db0a3fde54ed00478ff77c2e2.tar.gz |
Detect window-system from display name
Diffstat (limited to 'lisp/term')
-rw-r--r-- | lisp/term/ns-win.el | 4 | ||||
-rw-r--r-- | lisp/term/w32-win.el | 7 | ||||
-rw-r--r-- | lisp/term/x-win.el | 5 |
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 @@ ;; this file, which works in close coordination with src/nsfns.m. ;;; Code: - +(eval-when-compile (require 'cl-lib)) (or (featurep 'ns) (error "%s: Loading ns-win.el but not compiled for GNUstep/MacOS" (invocation-name))) @@ -897,6 +897,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.") ;; defines functions and variables that we use now. (defun ns-initialize-window-system () "Initialize Emacs for Nextstep (Cocoa / GNUstep) windowing." + (cl-assert (not ns-initialized)) ;; PENDING: not needed? (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.") (x-apply-session-resources) (setq ns-initialized t)) +(add-to-list 'display-format-alist '("\\`ns\\'" . ns)) (add-to-list 'handle-args-function-alist '(ns . x-handle-args)) (add-to-list 'frame-creation-function-alist '(ns . x-create-frame-with-faces)) (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 @@ ;; (if (not (eq window-system 'w32)) ;; (error "%s: Loading w32-win.el but not compiled for w32" (invocation-name))) +(eval-when-compile (require 'cl-lib)) (require 'frame) (require 'mouse) (require 'scroll-bar) @@ -240,6 +241,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.") (defun w32-initialize-window-system () "Initialize Emacs for W32 GUI frames." + (cl-assert (not w32-initialized)) ;; Do the actual Windows setup here; the above code just defines ;; functions and variables that we use now. @@ -253,7 +255,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.") ;; so as not to choke when we use it in X resource queries. (replace-regexp-in-string "[.*]" "-" (invocation-name)))) - (x-open-connection "" x-command-line-resources + (x-open-connection "w32" x-command-line-resources ;; Exit with a fatal error if this fails and we ;; are the initial display (eq initial-window-system 'w32)) @@ -304,7 +306,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.") (setq default-frame-alist (cons '(reverse . t) default-frame-alist))))) - ;; Don't let Emacs suspend under w32 gui + ;; Don't let Emacs suspend under Windows. (add-hook 'suspend-hook 'x-win-suspend-error) ;; 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.") (x-apply-session-resources) (setq w32-initialized t)) +(add-to-list 'display-format-alist '("\\`w32\\'" . w32)) (add-to-list 'handle-args-function-alist '(w32 . x-handle-args)) (add-to-list 'frame-creation-function-alist '(w32 . x-create-frame-with-faces)) (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 @@ ;; An alist of X options and the function which handles them. See ;; ../startup.el. +(eval-when-compile (require 'cl-lib)) + (if (not (fboundp 'x-create-frame)) (error "%s: Loading x-win.el but not compiled for X" (invocation-name))) @@ -1338,6 +1340,8 @@ Request data types in the order specified by `x-select-request-type'." (defun x-initialize-window-system () "Initialize Emacs for X frames and open the first connection to an X server." + (cl-assert (not x-initialized)) + ;; Make sure we have a valid resource name. (or (stringp x-resource-name) (let (i) @@ -1451,6 +1455,7 @@ Request data types in the order specified by `x-select-request-type'." (x-apply-session-resources) (setq x-initialized t)) +(add-to-list 'display-format-alist '("\\`[^:]*:[0-9]+\\(\\.[0-9]+\\)?\\'" . x)) (add-to-list 'handle-args-function-alist '(x . x-handle-args)) (add-to-list 'frame-creation-function-alist '(x . x-create-frame-with-faces)) (add-to-list 'window-system-initialization-alist '(x . x-initialize-window-system)) |