aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Antipov2013-04-06 18:06:39 +0400
committerDmitry Antipov2013-04-06 18:06:39 +0400
commitebb19708e7c76af8eee5534e25de5fa0949c14b4 (patch)
tree28a573147e83305bf16256fc6bf58af61408432c
parent33bb237a73a4ba97f21e673dac36b1f8c1299289 (diff)
downloademacs-ebb19708e7c76af8eee5534e25de5fa0949c14b4.tar.gz
emacs-ebb19708e7c76af8eee5534e25de5fa0949c14b4.zip
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.
-rw-r--r--lisp/ChangeLog14
-rw-r--r--lisp/frame.el5
-rw-r--r--lisp/term/ns-win.el2
-rw-r--r--lisp/term/pc-win.el2
-rw-r--r--lisp/term/w32-win.el2
-rw-r--r--lisp/term/x-win.el4
6 files changed, 21 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 8b249977e4e..bfbdf089bfa 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,17 @@
12013-04-06 Dmitry Antipov <dmantipov@yandex.ru>
2
3 Do not set x-display-name until X connection is established.
4 This is needed to prevent from weird situation described at
5 <http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00212.html>.
6 * frame.el (make-frame): Set x-display-name after call to
7 window system initialization function, not before.
8 * term/x-win.el (x-initialize-window-system): Add optional
9 display argument and use it.
10 * term/w32-win.el (w32-initialize-window-system):
11 * term/ns-win.el (ns-initialize-window-system):
12 * term/pc-win.el (msdos-initialize-window-system):
13 Add compatible optional display argument.
14
12013-04-06 Eli Zaretskii <eliz@gnu.org> 152013-04-06 Eli Zaretskii <eliz@gnu.org>
2 16
3 * files.el (normal-backup-enable-predicate): On MS-Windows and 17 * files.el (normal-backup-enable-predicate): On MS-Windows and
diff --git a/lisp/frame.el b/lisp/frame.el
index 4bf885b27b2..454b229d59e 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -655,9 +655,8 @@ the new frame according to its own rules."
655 (error "Don't know how to create a frame on window system %s" w)) 655 (error "Don't know how to create a frame on window system %s" w))
656 656
657 (unless (get w 'window-system-initialized) 657 (unless (get w 'window-system-initialized)
658 (unless x-display-name 658 (funcall (cdr (assq w window-system-initialization-alist)) display)
659 (setq x-display-name display)) 659 (setq x-display-name display)
660 (funcall (cdr (assq w window-system-initialization-alist)))
661 (put w 'window-system-initialized t)) 660 (put w 'window-system-initialized t))
662 661
663 ;; Add parameters from `window-system-default-frame-alist'. 662 ;; Add parameters from `window-system-default-frame-alist'.
diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el
index b8baaa077ce..5617c31beff 100644
--- a/lisp/term/ns-win.el
+++ b/lisp/term/ns-win.el
@@ -895,7 +895,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
895 895
896;; Do the actual Nextstep Windows setup here; the above code just 896;; Do the actual Nextstep Windows setup here; the above code just
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 (&optional display)
899 "Initialize Emacs for Nextstep (Cocoa / GNUstep) windowing." 899 "Initialize Emacs for Nextstep (Cocoa / GNUstep) windowing."
900 (cl-assert (not ns-initialized)) 900 (cl-assert (not ns-initialized))
901 901
diff --git a/lisp/term/pc-win.el b/lisp/term/pc-win.el
index cf67aca8343..ab776ea6257 100644
--- a/lisp/term/pc-win.el
+++ b/lisp/term/pc-win.el
@@ -403,7 +403,7 @@ Errors out because it is not supposed to be called, ever."
403 (error "terminal-init-internal called for window-system `%s'" 403 (error "terminal-init-internal called for window-system `%s'"
404 (window-system))) 404 (window-system)))
405 405
406(defun msdos-initialize-window-system () 406(defun msdos-initialize-window-system (&optional display)
407 "Initialization function for the `pc' \"window system\"." 407 "Initialization function for the `pc' \"window system\"."
408 (or (eq (window-system) 'pc) 408 (or (eq (window-system) 'pc)
409 (error 409 (error
diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el
index cbd08e68a39..b0f65812eab 100644
--- a/lisp/term/w32-win.el
+++ b/lisp/term/w32-win.el
@@ -246,7 +246,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
246(declare-function x-parse-geometry "frame.c" (string)) 246(declare-function x-parse-geometry "frame.c" (string))
247(defvar x-command-line-resources) 247(defvar x-command-line-resources)
248 248
249(defun w32-initialize-window-system () 249(defun w32-initialize-window-system (&optional display)
250 "Initialize Emacs for W32 GUI frames." 250 "Initialize Emacs for W32 GUI frames."
251 (cl-assert (not w32-initialized)) 251 (cl-assert (not w32-initialized))
252 252
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el
index 84d6ddbf46c..822df0e37e5 100644
--- a/lisp/term/x-win.el
+++ b/lisp/term/x-win.el
@@ -1343,7 +1343,7 @@ Request data types in the order specified by `x-select-request-type'."
1343(defvar x-display-name) 1343(defvar x-display-name)
1344(defvar x-command-line-resources) 1344(defvar x-command-line-resources)
1345 1345
1346(defun x-initialize-window-system () 1346(defun x-initialize-window-system (&optional display)
1347 "Initialize Emacs for X frames and open the first connection to an X server." 1347 "Initialize Emacs for X frames and open the first connection to an X server."
1348 (cl-assert (not x-initialized)) 1348 (cl-assert (not x-initialized))
1349 1349
@@ -1357,7 +1357,7 @@ Request data types in the order specified by `x-select-request-type'."
1357 (while (setq i (string-match "[.*]" x-resource-name)) 1357 (while (setq i (string-match "[.*]" x-resource-name))
1358 (aset x-resource-name i ?-)))) 1358 (aset x-resource-name i ?-))))
1359 1359
1360 (x-open-connection (or x-display-name 1360 (x-open-connection (or display
1361 (setq x-display-name (or (getenv "DISPLAY" (selected-frame)) 1361 (setq x-display-name (or (getenv "DISPLAY" (selected-frame))
1362 (getenv "DISPLAY")))) 1362 (getenv "DISPLAY"))))
1363 x-command-line-resources 1363 x-command-line-resources