diff lisp/frame.el @ 91048:d38543a1c0f9

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 880-885) - Remove RCS keywords from doc/misc/cc-mode.texi - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-264
author Miles Bader <miles@gnu.org>
date Sat, 13 Oct 2007 05:53:03 +0000
parents 14c4a6aac623 f1dea8c68d8d
children a0e466c4d599
line wrap: on
line diff
--- a/lisp/frame.el	Fri Oct 12 21:57:45 2007 +0000
+++ b/lisp/frame.el	Sat Oct 13 05:53:03 2007 +0000
@@ -673,6 +673,10 @@
 ;; Alias, kept temporarily.
 (define-obsolete-function-alias 'new-frame 'make-frame "22.1")
 
+(defvar frame-inherited-parameters '()
+  ;; FIXME: Shouldn't we add `font' here as well?
+  "Parameters `make-frame' copies from the `selected-frame' to the new frame.")
+
 (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.
@@ -723,15 +727,11 @@
     (run-hooks 'before-make-frame-hook)
     (setq frame (funcall frame-creation-function (append parameters (cdr (assq w window-system-default-frame-alist)))))
     (normal-erase-is-backspace-setup-frame frame)
-    ;; Inherit the 'environment and 'client parameters.
-    (let ((env (frame-parameter oldframe 'environment))
-	  (client (frame-parameter oldframe 'client)))
-      (if (not (framep env))
-	  (setq env oldframe))
-      (if (and env (not (assq 'environment parameters)))
-	  (set-frame-parameter frame 'environment env))
-      (if (and client (not (assq 'client parameters)))
-	  (set-frame-parameter frame 'client client)))
+    ;; Inherit the original frame's parameters.
+    (dolist (param frame-inherited-parameters)
+      (unless (assq param parameters)   ;Overridden by explicit parameters.
+        (let ((val (frame-parameter oldframe param)))
+          (when val (set-frame-parameter frame param val)))))
     (run-hook-with-args 'after-make-frame-functions frame)
     frame))