+2013-04-06 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Do not set x-display-name until X connection is established.
+ This is needed to prevent from weird situation described at
+ <http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00212.html>.
+ * frame.el (make-frame): Set x-display-name after call to
+ window system initialization function, not before.
+ * term/x-win.el (x-initialize-window-system): Add optional
+ display argument and use it.
+ * term/w32-win.el (w32-initialize-window-system):
+ * term/ns-win.el (ns-initialize-window-system):
+ * term/pc-win.el (msdos-initialize-window-system):
+ Add compatible optional display argument.
+
2013-04-06 Eli Zaretskii <eliz@gnu.org>
* files.el (normal-backup-enable-predicate): On MS-Windows and
(error "Don't know how to create a frame on window system %s" w))
(unless (get w 'window-system-initialized)
- (unless x-display-name
- (setq x-display-name display))
- (funcall (cdr (assq w window-system-initialization-alist)))
+ (funcall (cdr (assq w window-system-initialization-alist)) display)
+ (setq x-display-name display)
(put w 'window-system-initialized t))
;; Add parameters from `window-system-default-frame-alist'.
;; Do the actual Nextstep Windows setup here; the above code just
;; defines functions and variables that we use now.
-(defun ns-initialize-window-system ()
+(defun ns-initialize-window-system (&optional display)
"Initialize Emacs for Nextstep (Cocoa / GNUstep) windowing."
(cl-assert (not ns-initialized))
(error "terminal-init-internal called for window-system `%s'"
(window-system)))
-(defun msdos-initialize-window-system ()
+(defun msdos-initialize-window-system (&optional display)
"Initialization function for the `pc' \"window system\"."
(or (eq (window-system) 'pc)
(error
(declare-function x-parse-geometry "frame.c" (string))
(defvar x-command-line-resources)
-(defun w32-initialize-window-system ()
+(defun w32-initialize-window-system (&optional display)
"Initialize Emacs for W32 GUI frames."
(cl-assert (not w32-initialized))
(defvar x-display-name)
(defvar x-command-line-resources)
-(defun x-initialize-window-system ()
+(defun x-initialize-window-system (&optional display)
"Initialize Emacs for X frames and open the first connection to an X server."
(cl-assert (not x-initialized))
(while (setq i (string-match "[.*]" x-resource-name))
(aset x-resource-name i ?-))))
- (x-open-connection (or x-display-name
+ (x-open-connection (or display
(setq x-display-name (or (getenv "DISPLAY" (selected-frame))
(getenv "DISPLAY"))))
x-command-line-resources