diff options
| author | Simon Marshall | 1997-03-15 13:23:49 +0000 |
|---|---|---|
| committer | Simon Marshall | 1997-03-15 13:23:49 +0000 |
| commit | 45c4fdeb98018e266b88068f95e76d770ce16e06 (patch) | |
| tree | 62ca343bc5bdf0a996796e207ab966ca2d0e6ba5 | |
| parent | 28ceec49f1ef93b03113bae54fccea3c21d779a6 (diff) | |
| download | emacs-45c4fdeb98018e266b88068f95e76d770ce16e06.tar.gz emacs-45c4fdeb98018e266b88068f95e76d770ce16e06.zip | |
defvar before- and after- make frame vars; use properly in make-frame.
| -rw-r--r-- | lisp/frame.el | 48 |
1 files changed, 26 insertions, 22 deletions
diff --git a/lisp/frame.el b/lisp/frame.el index 80c903b5795..8bb59a9d3b2 100644 --- a/lisp/frame.el +++ b/lisp/frame.el | |||
| @@ -425,37 +425,41 @@ The optional second argument PARAMETERS specifies additional frame parameters." | |||
| 425 | (make-frame) | 425 | (make-frame) |
| 426 | (select-frame (make-frame)))) | 426 | (select-frame (make-frame)))) |
| 427 | 427 | ||
| 428 | (defvar before-make-frame-hook nil | ||
| 429 | "Functions to run before a frame is created.") | ||
| 430 | |||
| 431 | (defvar after-make-frame-functions nil | ||
| 432 | "Functions to run after a frame is created. | ||
| 433 | The functions are run with one arg, the newly created frame.") | ||
| 434 | |||
| 428 | ;; Alias, kept temporarily. | 435 | ;; Alias, kept temporarily. |
| 429 | (defalias 'new-frame 'make-frame) | 436 | (defalias 'new-frame 'make-frame) |
| 430 | (defun make-frame (&optional parameters) | ||
| 431 | "Create a new frame, displaying the current buffer. | ||
| 432 | 437 | ||
| 433 | Optional argument PARAMETERS is an alist of parameters for the new | 438 | (defun make-frame (&optional parameters) |
| 434 | frame. Specifically, PARAMETERS is a list of pairs, each having | 439 | "Return a newly created frame displaying the current buffer. |
| 435 | the form (NAME . VALUE). | 440 | Optional argument PARAMETERS is an alist of parameters for the new frame. |
| 441 | Each element of PARAMETERS should have the form (NAME . VALUE), for example: | ||
| 436 | 442 | ||
| 437 | Here are some of the parameters allowed (not a complete list): | 443 | (name . STRING) The frame should be named STRING. |
| 438 | 444 | ||
| 439 | \(name . STRING) - The frame should be named STRING. | 445 | (width . NUMBER) The frame should be NUMBER characters in width. |
| 446 | (height . NUMBER) The frame should be NUMBER text lines high. | ||
| 440 | 447 | ||
| 441 | \(height . NUMBER) - The frame should be NUMBER text lines high. If | 448 | You cannot specify either `width' or `height', you must use neither or both. |
| 442 | this parameter is present, the width parameter must also be | ||
| 443 | given. | ||
| 444 | 449 | ||
| 445 | \(width . NUMBER) - The frame should be NUMBER characters in width. | 450 | (minibuffer . t) The frame should have a minibuffer. |
| 446 | If this parameter is present, the height parameter must also | 451 | (minibuffer . nil) The frame should have no minibuffer. |
| 447 | be given. | 452 | (minibuffer . only) The frame should contain only a minibuffer. |
| 453 | (minibuffer . WINDOW) The frame should use WINDOW as its minibuffer window. | ||
| 448 | 454 | ||
| 449 | \(minibuffer . t) - the frame should have a minibuffer | 455 | Before the frame is created (via `frame-creation-function'), functions on the |
| 450 | \(minibuffer . nil) - the frame should have no minibuffer | 456 | hook `before-make-frame-hook' are run. After the frame is created, functions |
| 451 | \(minibuffer . only) - the frame should contain only a minibuffer | 457 | on `after-make-frame-functions' are run with one arg, the newly created frame." |
| 452 | \(minibuffer . WINDOW) - the frame should use WINDOW as its minibuffer window." | ||
| 453 | (interactive) | 458 | (interactive) |
| 454 | (let ((nframe)) | 459 | (run-hooks 'before-make-frame-hook) |
| 455 | (run-hooks 'before-make-frame-hook) | 460 | (let ((frame (funcall frame-creation-function parameters))) |
| 456 | (setq nframe (funcall frame-creation-function parameters)) | 461 | (run-hook-with-args 'after-make-frame-functions frame) |
| 457 | (run-hooks 'after-make-frame-hook) | 462 | frame)) |
| 458 | nframe)) | ||
| 459 | 463 | ||
| 460 | (defun filtered-frame-list (predicate) | 464 | (defun filtered-frame-list (predicate) |
| 461 | "Return a list of all live frames which satisfy PREDICATE." | 465 | "Return a list of all live frames which satisfy PREDICATE." |