]> code.delx.au - gnu-emacs/blobdiff - lisp/frame.el
Make autoloading commands prompt for autoload file (Bug#7989)
[gnu-emacs] / lisp / frame.el
index 06e2268c6970cd297baf97c6142fdbe2f4d096d9..a95e91c8eebb91e96ad8f147941acbf20d7555a9 100644 (file)
@@ -1,7 +1,6 @@
 ;;; frame.el --- multi-frame management independent of window systems
 
-;; Copyright (C) 1993, 1994, 1996, 1997, 2000, 2001, 2002, 2003,
-;;   2004, 2005, 2006, 2007, 2008, 2009, 2010
+;; Copyright (C) 1993-1994, 1996-1997, 2000-2011
 ;;   Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
@@ -32,7 +31,7 @@
   (list (cons nil
              (if (fboundp 'tty-create-frame-with-faces)
                  'tty-create-frame-with-faces
-                (lambda (parameters)
+                (lambda (_parameters)
                   (error "Can't create multiple frames without a window system")))))
   "Alist of window-system dependent functions to call to create a new frame.
 The window system startup file should add its frame creation
@@ -296,22 +295,19 @@ there (in decreasing order of priority)."
               (null frame-initial-frame))
       ;; This case happens when we don't have a window system, and
       ;; also for MS-DOS frames.
-      (let ((parms (frame-parameters frame-initial-frame)))
+      (let ((parms (frame-parameters)))
        ;; Don't change the frame names.
        (setq parms (delq (assq 'name parms) parms))
        ;; Can't modify the minibuffer parameter, so don't try.
        (setq parms (delq (assq 'minibuffer parms) parms))
-       (modify-frame-parameters nil
-                                (if (null initial-window-system)
-                                    (append initial-frame-alist
-                                            window-system-frame-alist
-                                            default-frame-alist
-                                            parms
-                                            nil)
-                                  ;; initial-frame-alist and
-                                  ;; default-frame-alist were already
-                                  ;; applied in pc-win.el.
-                                  parms))
+       (modify-frame-parameters
+        nil
+        (if initial-window-system
+            parms
+          ;; initial-frame-alist and default-frame-alist were already
+          ;; applied in pc-win.el.
+          (append initial-frame-alist window-system-frame-alist
+                  default-frame-alist parms nil)))
        (if (null initial-window-system) ;; MS-DOS does this differently in pc-win.el
            (let ((newparms (frame-parameters))
                  (frame (selected-frame)))
@@ -512,25 +508,28 @@ there (in decreasing order of priority)."
          ;; it is undesirable to specify the parm again
           ;; once the user has seen the frame and been able to alter it
          ;; manually.
-         (while tail
-           (let (newval oldval)
-             (setq oldval (assq (car (car tail))
-                                frame-initial-frame-alist))
-             (setq newval (cdr (assq (car (car tail)) allparms)))
+         (let (newval oldval)
+           (dolist (entry tail)
+             (setq oldval (assq (car entry) frame-initial-frame-alist))
+             (setq newval (cdr (assq (car entry) allparms)))
              (or (and oldval (eq (cdr oldval) newval))
                  (setq newparms
-                       (cons (cons (car (car tail)) newval) newparms))))
-           (setq tail (cdr tail)))
+                       (cons (cons (car entry) newval) newparms)))))
          (setq newparms (nreverse newparms))
-         (modify-frame-parameters frame-initial-frame
-                                  newparms)
-         ;; If we changed the background color,
-         ;; we need to update the background-mode parameter
-         ;; and maybe some faces too.
-         (when (assq 'background-color newparms)
-           (unless (assq 'background-mode newparms)
-             (frame-set-background-mode frame-initial-frame))
-           (face-set-after-frame-default frame-initial-frame)))))
+
+         (let ((new-bg (assq 'background-color newparms)))
+           ;; If the `background-color' parameter is changed, apply
+           ;; it first, then make sure that the `background-mode'
+           ;; parameter and other faces are updated, before applying
+           ;; the other parameters.
+           (when new-bg
+             (modify-frame-parameters frame-initial-frame
+                                      (list new-bg))
+             (unless (assq 'background-mode newparms)
+               (frame-set-background-mode frame-initial-frame))
+             (face-set-after-frame-default frame-initial-frame)
+             (setq newparms (delq new-bg newparms)))
+           (modify-frame-parameters frame-initial-frame newparms)))))
 
     ;; Restore the original buffer.
     (set-buffer old-buffer)
@@ -1431,7 +1430,7 @@ Examples (measures in pixels) -
 
 In the 3rd, 4th, and 6th examples, the returned value is relative to
 the opposite frame edge from the edge indicated in the input spec."
-  (cons (car spec) (frame-geom-value-cons (car spec) (cdr spec))))
+  (cons (car spec) (frame-geom-value-cons (car spec) (cdr spec) frame)))
 \f
 
 (defun delete-other-frames (&optional frame)
@@ -1545,7 +1544,7 @@ cursor display.  On a text-only terminal, this is not implemented."
   :init-value (not (or noninteractive
                       no-blinking-cursor
                       (eq system-type 'ms-dos)
-                      (not (memq window-system '(x w32)))))
+                      (not (memq window-system '(x w32 ns)))))
   :initialize 'custom-initialize-delay
   :group 'cursor
   :global t