emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r100675: Fix application of default-f


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r100675: Fix application of default-frame-alist (Bug#5378).
Date: Wed, 30 Jun 2010 20:14:17 -0400
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100675
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Wed 2010-06-30 20:14:17 -0400
message:
  Fix application of default-frame-alist (Bug#5378).
  
  * lisp/frame.el (make-frame): Add default-frame-alist to the PARAMETERS
  argument passed to frame-creation-function (Bug#5378).
  
  * lisp/faces.el (x-handle-named-frame-geometry)
  (x-handle-reverse-video, x-create-frame-with-faces)
  (face-set-after-frame-default, tty-create-frame-with-faces): Don't
  separately consult default-frame-alist.  It is now passed as the
  PARAMETER argument.
  
  * src/frame.c (get_future_frame_param, Fmake_terminal_frame): Don't
  check default-frame-alist.
modified:
  lisp/ChangeLog
  lisp/faces.el
  lisp/frame.el
  src/ChangeLog
  src/frame.c
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-07-01 00:08:29 +0000
+++ b/lisp/ChangeLog    2010-07-01 00:14:17 +0000
@@ -1,3 +1,14 @@
+2010-06-30  Chong Yidong  <address@hidden>
+
+       * frame.el (make-frame): Add default-frame-alist to the PARAMETERS
+       argument passed to frame-creation-function (Bug#5378).
+
+       * faces.el (x-handle-named-frame-geometry)
+       (x-handle-reverse-video, x-create-frame-with-faces)
+       (face-set-after-frame-default, tty-create-frame-with-faces): Don't
+       separately consult default-frame-alist.  It is now passed as the
+       PARAMETER argument.
+
 2010-06-30  Andreas Schwab  <address@hidden>
 
        * startup.el (command-line): Don't call tool-bar-setup in a

=== modified file 'lisp/faces.el'
--- a/lisp/faces.el     2010-03-24 00:17:31 +0000
+++ b/lisp/faces.el     2010-07-01 00:14:17 +0000
@@ -1948,8 +1948,7 @@
   "Add geometry parameters for a named frame to parameter list PARAMETERS.
 Value is the new parameter list."
   ;; Note that `x-resource-name' has a global meaning.
-  (let ((x-resource-name (or (cdr (assq 'name parameters))
-                            (cdr (assq 'name default-frame-alist)))))
+  (let ((x-resource-name (cdr (assq 'name parameters))))
     (when x-resource-name
       ;; Before checking X resources, we must have an X connection.
       (or (window-system)
@@ -1960,7 +1959,7 @@
        (and (setq res-geometry (x-get-resource "geometry" "Geometry"))
             (setq parsed (x-parse-geometry res-geometry))
             (setq parameters
-                  (append parameters default-frame-alist parsed
+                  (append parameters parsed
                           ;; If the resource specifies a position,
                           ;; take note of that.
                           (if (or (assq 'top parsed) (assq 'left parsed))
@@ -1972,7 +1971,6 @@
   "Handle the reverse-video frame parameter and X resource.
 `x-create-frame' does not handle this one."
   (when (cdr (or (assq 'reverse parameters)
-                (assq 'reverse default-frame-alist)
                 (let ((resource (x-get-resource "reverseVideo"
                                                 "ReverseVideo")))
                   (if resource
@@ -1998,13 +1996,10 @@
 (declare-function x-setup-function-keys "term/x-win" (frame))
 
 (defun x-create-frame-with-faces (&optional parameters)
-  "Create a frame from optional frame parameters PARAMETERS.
-Parameters not specified by PARAMETERS are taken from
-`default-frame-alist'.  If PARAMETERS specify a frame name,
-handle X geometry resources for that name.  If either PARAMETERS
-or `default-frame-alist' contains a `reverse' parameter, or
-the X resource ``reverseVideo'' is present, handle that.
-Value is the new frame created."
+  "Create and return a frame with frame parameters PARAMETERS.
+If PARAMETERS specify a frame name, handle X geometry resources
+for that name.  If PARAMETERS includes a `reverse' parameter, or
+the X resource ``reverseVideo'' is present, handle that."
   (setq parameters (x-handle-named-frame-geometry parameters))
   (let* ((params (copy-tree parameters))
         (visibility-spec (assq 'visibility parameters))
@@ -2035,7 +2030,7 @@
 Calculate the face definitions using the face specs, custom theme
 settings, X resources, and `face-new-frame-defaults'.
 Finally, apply any relevant face attributes found amongst the
-frame parameters in PARAMETERS and `default-frame-alist'."
+frame parameters in PARAMETERS."
   (dolist (face (nreverse (face-list))) ;Why reverse?  --Stef
     (condition-case ()
        (progn
@@ -2061,16 +2056,14 @@
                       (mouse-color mouse :background))))
     (dolist (param face-params)
       (let* ((param-name (nth 0 param))
-            (value (cdr (or (assq param-name parameters)
-                            (assq param-name default-frame-alist)))))
+            (value (cdr (assq param-name parameters))))
        (if value
            (set-face-attribute (nth 1 param) frame
                                (nth 2 param) value))))))
 
 (defun tty-handle-reverse-video (frame parameters)
   "Handle the reverse-video frame parameter for terminal frames."
-  (when (cdr (or (assq 'reverse parameters)
-                (assq 'reverse default-frame-alist)))
+  (when (cdr (assq 'reverse parameters))
     (let* ((params (frame-parameters frame))
           (bg (cdr (assq 'foreground-color params)))
           (fg (cdr (assq 'background-color params))))
@@ -2086,11 +2079,8 @@
 
 
 (defun tty-create-frame-with-faces (&optional parameters)
-  "Create a frame from optional frame parameters PARAMETERS.
-Parameters not specified by PARAMETERS are taken from
-`default-frame-alist'.  If either PARAMETERS or `default-frame-alist'
-contains a `reverse' parameter, handle that.  Value is the new frame
-created."
+  "Create and return a frame from optional frame parameters PARAMETERS.
+If PARAMETERS contains a `reverse' parameter, handle that."
   (let ((frame (make-terminal-frame parameters))
        success)
     (unwind-protect

=== modified file 'lisp/frame.el'
--- a/lisp/frame.el     2010-06-27 00:30:52 +0000
+++ b/lisp/frame.el     2010-07-01 00:14:17 +0000
@@ -683,15 +683,17 @@
 
 (defun make-frame (&optional parameters)
   "Return a newly created frame displaying the current buffer.
-Optional argument PARAMETERS is an alist of parameters for the new frame.
-Each element of PARAMETERS should have the form (NAME . VALUE), for example:
+Optional argument PARAMETERS is an alist of frame parameters for
+the new frame.  Each element of PARAMETERS should have the
+form (NAME . VALUE), for example:
 
  (name . STRING)       The frame should be named STRING.
 
  (width . NUMBER)      The frame should be NUMBER characters in width.
  (height . NUMBER)     The frame should be NUMBER text lines high.
 
-You cannot specify either `width' or `height', you must use neither or both.
+You cannot specify either `width' or `height', you must specify
+neither or both.
 
  (minibuffer . t)      The frame should have a minibuffer.
  (minibuffer . nil)    The frame should have no minibuffer.
@@ -703,15 +705,17 @@
 
  (terminal . TERMINAL)  The frame should use the terminal object TERMINAL.
 
-Before the frame is created (via `frame-creation-function-alist'), functions 
on the
-hook `before-make-frame-hook' are run.  After the frame is created, functions
-on `after-make-frame-functions' are run with one arg, the newly created frame.
-
-This function itself does not make the new frame the selected frame.
-The previously selected frame remains selected.  However, the
-window system may select the new frame for its own reasons, for
-instance if the frame appears under the mouse pointer and your
-setup is for focus to follow the pointer."
+In addition, any parameter specified in `default-frame-alist',
+but not present in PARAMETERS, is applied.
+
+Before creating the frame (via `frame-creation-function-alist'),
+this function runs the hook `before-make-frame-hook'.  After
+creating the frame, it runs the hook `after-make-frame-functions'
+with one arg, the newly created frame.
+
+On graphical displays, this function does not itself make the new
+frame the selected frame.  However, the window system may select
+the new frame according to its own rules."
   (interactive)
   (let* ((w (cond
             ((assq 'terminal parameters)
@@ -726,14 +730,21 @@
             (t window-system)))
         (frame-creation-function (cdr (assq w frame-creation-function-alist)))
         (oldframe (selected-frame))
+        (params parameters)
         frame)
     (unless frame-creation-function
       (error "Don't know how to create a frame on window system %s" w))
+    ;; Add parameters from `window-system-default-frame-alist'.
+    (dolist (p (cdr (assq w window-system-default-frame-alist)))
+      (unless (memq (car p) params)
+       (push p params)))
+    ;; Add parameters from `default-frame-alist'.
+    (dolist (p default-frame-alist)
+      (unless (memq (car p) params)
+       (push p params)))
+    ;; Now make the frame.
     (run-hooks 'before-make-frame-hook)
-    (setq frame
-          (funcall frame-creation-function
-                   (append parameters
-                           (cdr (assq w window-system-default-frame-alist)))))
+    (setq frame (funcall frame-creation-function params))
     (normal-erase-is-backspace-setup-frame frame)
     ;; Inherit the original frame's parameters.
     (dolist (param frame-inherited-parameters)

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2010-07-01 00:08:29 +0000
+++ b/src/ChangeLog     2010-07-01 00:14:17 +0000
@@ -1,3 +1,8 @@
+2010-06-30  Chong Yidong  <address@hidden>
+
+       * frame.c (get_future_frame_param, Fmake_terminal_frame): Don't
+       check default-frame-alist.
+
 2010-06-30  Andreas Schwab  <address@hidden>
 
        * process.c (create_process): Avoid using invalid file descriptors.

=== modified file 'src/frame.c'
--- a/src/frame.c       2010-06-27 00:30:52 +0000
+++ b/src/frame.c       2010-07-01 00:14:17 +0000
@@ -627,8 +627,7 @@
 
 /* Get a suitable value for frame parameter PARAMETER for a newly
    created frame, based on (1) the user-supplied frame parameter
-   alist SUPPLIED_PARMS, (2) CURRENT_VALUE, and finally, if all else
-   fails, (3) Vdefault_frame_alist.  */
+   alist SUPPLIED_PARMS, and (2) CURRENT_VALUE.  */
 
 static Lisp_Object
 get_future_frame_param (Lisp_Object parameter,
@@ -642,8 +641,6 @@
     result = Fassq (parameter, XFRAME (selected_frame)->param_alist);
   if (NILP (result) && current_value != NULL)
     result = build_string (current_value);
-  if (NILP (result))
-    result = Fassq (parameter, Vdefault_frame_alist);
   if (!NILP (result) && !STRINGP (result))
     result = XCDR (result);
   if (NILP (result) || !STRINGP (result))
@@ -748,7 +745,6 @@
   adjust_glyphs (f);
   calculate_costs (f);
   XSETFRAME (frame, f);
-  Fmodify_frame_parameters (frame, Vdefault_frame_alist);
   Fmodify_frame_parameters (frame, parms);
   Fmodify_frame_parameters (frame, Fcons (Fcons (Qtty_type,
                                                  build_string 
(t->display_info.tty->type)),


reply via email to

[Prev in Thread] Current Thread [Next in Thread]