diff options
| author | Stefan Monnier | 2007-10-10 20:18:45 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2007-10-10 20:18:45 +0000 |
| commit | ab6198b2a36679b3418b547289b950567bd7d097 (patch) | |
| tree | 09dc204f33892c22ba466d5d3b26f88e15d2aad3 | |
| parent | 01ff458e81a80e037caa33ebdc4330d6923b43f3 (diff) | |
| download | emacs-ab6198b2a36679b3418b547289b950567bd7d097.tar.gz emacs-ab6198b2a36679b3418b547289b950567bd7d097.zip | |
(frame-inherited-parameters): New var.
(make-frame): Use it.
| -rw-r--r-- | etc/NEWS | 2 | ||||
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/frame.el | 18 |
3 files changed, 14 insertions, 9 deletions
| @@ -262,6 +262,8 @@ supported on other platforms, but not on Windows due to using the winsock | |||
| 262 | 262 | ||
| 263 | * Lisp Changes in Emacs 23.1 | 263 | * Lisp Changes in Emacs 23.1 |
| 264 | 264 | ||
| 265 | ** `frame-inherited-parameters' lets new frames inherit parameters from | ||
| 266 | the selected frame. | ||
| 265 | ** New keymap `input-decode-map' overrides like key-translation-map, but | 267 | ** New keymap `input-decode-map' overrides like key-translation-map, but |
| 266 | applies before function-key-map. Also it is terminal-local contrary to | 268 | applies before function-key-map. Also it is terminal-local contrary to |
| 267 | key-translation-map. Terminal-specific key-sequences are generally added to | 269 | key-translation-map. Terminal-specific key-sequences are generally added to |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0cf312e3871..11c8b15107f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2007-10-10 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2007-10-10 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * frame.el (frame-inherited-parameters): New var. | ||
| 4 | (make-frame): Use it. | ||
| 5 | |||
| 3 | * font-lock.el (lisp-font-lock-keywords-2): Remove let-environment. | 6 | * font-lock.el (lisp-font-lock-keywords-2): Remove let-environment. |
| 4 | 7 | ||
| 5 | * env.el (let-environment): Remove. Unused. | 8 | * env.el (let-environment): Remove. Unused. |
diff --git a/lisp/frame.el b/lisp/frame.el index d9688804266..656a462e7c9 100644 --- a/lisp/frame.el +++ b/lisp/frame.el | |||
| @@ -673,6 +673,10 @@ The functions are run with one arg, the newly created frame.") | |||
| 673 | ;; Alias, kept temporarily. | 673 | ;; Alias, kept temporarily. |
| 674 | (define-obsolete-function-alias 'new-frame 'make-frame "22.1") | 674 | (define-obsolete-function-alias 'new-frame 'make-frame "22.1") |
| 675 | 675 | ||
| 676 | (defvar frame-inherited-parameters '(environment client) | ||
| 677 | ;; FIXME: Shouldn't we add `font' here as well? | ||
| 678 | "Parameters `make-frame' copies from the `selected-frame' to the new frame.") | ||
| 679 | |||
| 676 | (defun make-frame (&optional parameters) | 680 | (defun make-frame (&optional parameters) |
| 677 | "Return a newly created frame displaying the current buffer. | 681 | "Return a newly created frame displaying the current buffer. |
| 678 | Optional argument PARAMETERS is an alist of parameters for the new frame. | 682 | Optional argument PARAMETERS is an alist of parameters for the new frame. |
| @@ -723,15 +727,11 @@ setup is for focus to follow the pointer." | |||
| 723 | (run-hooks 'before-make-frame-hook) | 727 | (run-hooks 'before-make-frame-hook) |
| 724 | (setq frame (funcall frame-creation-function (append parameters (cdr (assq w window-system-default-frame-alist))))) | 728 | (setq frame (funcall frame-creation-function (append parameters (cdr (assq w window-system-default-frame-alist))))) |
| 725 | (normal-erase-is-backspace-setup-frame frame) | 729 | (normal-erase-is-backspace-setup-frame frame) |
| 726 | ;; Inherit the 'environment and 'client parameters. | 730 | ;; Inherit the original frame's parameters. |
| 727 | (let ((env (frame-parameter oldframe 'environment)) | 731 | (dolist (param frame-inherited-parameters) |
| 728 | (client (frame-parameter oldframe 'client))) | 732 | (unless (assq param parameters) ;Overridden by explicit parameters. |
| 729 | (if (not (framep env)) | 733 | (let ((val (frame-parameter oldframe param))) |
| 730 | (setq env oldframe)) | 734 | (when val (set-frame-parameter frame param val))))) |
| 731 | (if (and env (not (assq 'environment parameters))) | ||
| 732 | (set-frame-parameter frame 'environment env)) | ||
| 733 | (if (and client (not (assq 'client parameters))) | ||
| 734 | (set-frame-parameter frame 'client client))) | ||
| 735 | (run-hook-with-args 'after-make-frame-functions frame) | 735 | (run-hook-with-args 'after-make-frame-functions frame) |
| 736 | frame)) | 736 | frame)) |
| 737 | 737 | ||