- (or (string-match "\\`[^:]*:[0-9]+\\(\\.[0-9]+\\)?\\'" display)
- (error "Invalid display, not HOST:SERVER or HOST:SERVER.SCREEN"))
- (when (and (boundp 'x-initialized) (not x-initialized))
- (setq x-display-name display)
- (x-initialize-window-system))
- (make-frame `((window-system . x) (display . ,display) . ,parameters)))
-
-(defun make-frame-on-tty (tty type &optional parameters)
- "Make a frame on terminal device TTY.
-TTY should be the file name of the tty device to use. TYPE
-should be the terminal type string of TTY, for example \"xterm\"
-or \"vt100\". The optional third argument PARAMETERS specifies
-additional frame parameters."
- (interactive "fOpen frame on tty device: \nsTerminal type of %s: ")
- (unless tty
- (error "Invalid terminal device"))
- (unless type
- (error "Invalid terminal type"))
- (make-frame `((window-system . nil) (tty . ,tty) (tty-type . ,type) . ,parameters)))
+ (cond ((featurep 'ns)
+ (when (and (boundp 'ns-initialized) (not ns-initialized))
+ (setq x-display-name display)
+ (ns-initialize-window-system))
+ (make-frame `((window-system . ns)
+ (display . ,display) . ,parameters)))
+ ((eq system-type 'windows-nt)
+ ;; On Windows, ignore DISPLAY.
+ (make-frame parameters))
+ (t
+ (unless (string-match-p "\\`[^:]*:[0-9]+\\(\\.[0-9]+\\)?\\'" display)
+ (error "Invalid display, not HOST:SERVER or HOST:SERVER.SCREEN"))
+ (when (and (boundp 'x-initialized) (not x-initialized))
+ (setq x-display-name display)
+ (x-initialize-window-system))
+ (make-frame `((window-system . x)
+ (display . ,display) . ,parameters)))))
+
+(declare-function x-close-connection "xfns.c" (terminal))