(eval-defun): Don't change defvar to defconst
[bpt/emacs.git] / lisp / faces.el
index c5ab9b6..990886a 100644 (file)
@@ -938,6 +938,26 @@ selected frame."
 ;; Like x-create-frame but also set up the faces.
 
 (defun x-create-frame-with-faces (&optional parameters)
+  ;; Read this frame's geometry resource, if it has an explicit name,
+  ;; and put the specs into PARAMETERS.
+  (let* ((name (or (cdr (assq 'name parameters))
+                  (cdr (assq 'name default-frame-alist))))
+        (x-resource-name name)
+        (res-geometry (if name (x-get-resource "geometry" "Geometry")))
+        parsed)
+    (if res-geometry
+       (progn
+         (setq parsed (x-parse-geometry res-geometry))
+         ;; If the resource specifies a position,
+         ;; call the position and size "user-specified".
+         (if (or (assq 'top parsed) (assq 'left parsed))
+             (setq parsed (cons '(user-position . t)
+                                (cons '(user-size . t) parsed))))
+         ;; Put the geometry parameters at the end.
+         ;; Copy default-frame-alist so that they go after it.
+         (setq parameters (append parameters
+                                  default-frame-alist
+                                  parsed)))))
   (if (null global-face-data)
       (x-create-frame parameters)
     (let* ((visibility-spec (assq 'visibility parameters))