diff options
| author | Martin Rudalics | 2017-09-25 10:09:32 +0200 |
|---|---|---|
| committer | Martin Rudalics | 2017-09-25 10:09:32 +0200 |
| commit | dc6b3560e56c83b3e3191a3d95d31fe288181742 (patch) | |
| tree | 998a37d181ebc8cca660d0851261a5d404165159 | |
| parent | 3d3778d82a87139ef50a24146f5bad2a57a82094 (diff) | |
| download | emacs-dc6b3560e56c83b3e3191a3d95d31fe288181742.tar.gz emacs-dc6b3560e56c83b3e3191a3d95d31fe288181742.zip | |
Fix documentation of `make-frame' and related variables and hooks
* lisp/frame.el (before-make-frame-hook)
(after-make-frame-functions, frame-inherited-parameters)
(make-frame): Fix doc-strings.
* doc/lispref/frames.texi (Creating Frames): Fix description
of `make-frame' and related variables and hooks.
| -rw-r--r-- | doc/lispref/frames.texi | 58 | ||||
| -rw-r--r-- | lisp/frame.el | 20 |
2 files changed, 43 insertions, 35 deletions
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index 6431bbdedb9..f66ecee8e8e 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi | |||
| @@ -112,37 +112,39 @@ window of another Emacs frame. @xref{Child Frames}. | |||
| 112 | * Display Feature Testing:: Determining the features of a terminal. | 112 | * Display Feature Testing:: Determining the features of a terminal. |
| 113 | @end menu | 113 | @end menu |
| 114 | 114 | ||
| 115 | |||
| 115 | @node Creating Frames | 116 | @node Creating Frames |
| 116 | @section Creating Frames | 117 | @section Creating Frames |
| 117 | @cindex frame creation | 118 | @cindex frame creation |
| 118 | 119 | ||
| 119 | To create a new frame, call the function @code{make-frame}. | 120 | To create a new frame, call the function @code{make-frame}. |
| 120 | 121 | ||
| 121 | @deffn Command make-frame &optional alist | 122 | @deffn Command make-frame &optional parameters |
| 122 | This function creates and returns a new frame, displaying the current | 123 | This function creates and returns a new frame, displaying the current |
| 123 | buffer. | 124 | buffer. |
| 124 | 125 | ||
| 125 | The @var{alist} argument is an alist that specifies frame parameters | 126 | The @var{parameters} argument is an alist that specifies frame |
| 126 | for the new frame. @xref{Frame Parameters}. If you specify the | 127 | parameters for the new frame. @xref{Frame Parameters}. If you specify |
| 127 | @code{terminal} parameter in @var{alist}, the new frame is created on | 128 | the @code{terminal} parameter in @var{parameters}, the new frame is |
| 128 | that terminal. Otherwise, if you specify the @code{window-system} | 129 | created on that terminal. Otherwise, if you specify the |
| 129 | frame parameter in @var{alist}, that determines whether the frame | 130 | @code{window-system} frame parameter in @var{parameters}, that |
| 130 | should be displayed on a text terminal or a graphical terminal. | 131 | determines whether the frame should be displayed on a text terminal or a |
| 131 | @xref{Window Systems}. If neither is specified, the new frame is | 132 | graphical terminal. @xref{Window Systems}. If neither is specified, |
| 132 | created in the same terminal as the selected frame. | 133 | the new frame is created in the same terminal as the selected frame. |
| 133 | 134 | ||
| 134 | Any parameters not mentioned in @var{alist} default to the values in | 135 | Any parameters not mentioned in @var{parameters} default to the values |
| 135 | the alist @code{default-frame-alist} (@pxref{Initial Parameters}); | 136 | in the alist @code{default-frame-alist} (@pxref{Initial Parameters}); |
| 136 | parameters not specified there default from the X resources or its | 137 | parameters not specified there default from the X resources or its |
| 137 | equivalent on your operating system (@pxref{X Resources,, X Resources, | 138 | equivalent on your operating system (@pxref{X Resources,, X Resources, |
| 138 | emacs, The GNU Emacs Manual}). After the frame is created, Emacs | 139 | emacs, The GNU Emacs Manual}). After the frame is created, this |
| 139 | applies any parameters listed in @code{frame-inherited-parameters} | 140 | function applies any parameters specified in |
| 140 | (see below) and not present in the argument, taking the values from | 141 | @code{frame-inherited-parameters} (see below) it has no assigned yet, |
| 141 | the frame that was selected when @code{make-frame} was called. | 142 | taking the values from the frame that was selected when |
| 143 | @code{make-frame} was called. | ||
| 142 | 144 | ||
| 143 | Note that on multi-monitor displays (@pxref{Multiple Terminals}), the | 145 | Note that on multi-monitor displays (@pxref{Multiple Terminals}), the |
| 144 | window manager might position the frame differently than specified by | 146 | window manager might position the frame differently than specified by |
| 145 | the positional parameters in @var{alist} (@pxref{Position | 147 | the positional parameters in @var{parameters} (@pxref{Position |
| 146 | Parameters}). For example, some window managers have a policy of | 148 | Parameters}). For example, some window managers have a policy of |
| 147 | displaying the frame on the monitor that contains the largest part of | 149 | displaying the frame on the monitor that contains the largest part of |
| 148 | the window (a.k.a.@: the @dfn{dominating} monitor). | 150 | the window (a.k.a.@: the @dfn{dominating} monitor). |
| @@ -158,20 +160,28 @@ A normal hook run by @code{make-frame} before it creates the frame. | |||
| 158 | @end defvar | 160 | @end defvar |
| 159 | 161 | ||
| 160 | @defvar after-make-frame-functions | 162 | @defvar after-make-frame-functions |
| 161 | An abnormal hook run by @code{make-frame} after it creates the frame. | 163 | An abnormal hook run by @code{make-frame} after it created the frame. |
| 162 | Each function in @code{after-make-frame-functions} receives one argument, the | 164 | Each function in @code{after-make-frame-functions} receives one |
| 163 | frame just created. | 165 | argument, the frame just created. |
| 164 | @end defvar | 166 | @end defvar |
| 165 | 167 | ||
| 168 | Note that any functions added to these hooks by your initial file are | ||
| 169 | usually not run for the initial frame, since Emacs reads the initial | ||
| 170 | file only after creating that frame. However, if the initial frame is | ||
| 171 | specified to use a separate minibuffer frame (@pxref{Minibuffers and | ||
| 172 | Frames}), the functions will be run for both, the minibuffer-less and | ||
| 173 | the minibuffer frame. | ||
| 174 | |||
| 166 | @defvar frame-inherited-parameters | 175 | @defvar frame-inherited-parameters |
| 167 | This variable specifies the list of frame parameters that a newly | 176 | This variable specifies the list of frame parameters that a newly |
| 168 | created frame inherits from the currently selected frame. For each | 177 | created frame inherits from the currently selected frame. For each |
| 169 | parameter (a symbol) that is an element in the list and is not present | 178 | parameter (a symbol) that is an element in this list and has not been |
| 170 | in the argument to @code{make-frame}, the function sets the value of | 179 | assigned earlier when processing @code{make-frame}, the function sets |
| 171 | that parameter in the created frame to its value in the selected | 180 | the value of that parameter in the created frame to its value in the |
| 172 | frame. | 181 | selected frame. |
| 173 | @end defvar | 182 | @end defvar |
| 174 | 183 | ||
| 184 | |||
| 175 | @node Multiple Terminals | 185 | @node Multiple Terminals |
| 176 | @section Multiple Terminals | 186 | @section Multiple Terminals |
| 177 | @cindex multiple terminals | 187 | @cindex multiple terminals |
diff --git a/lisp/frame.el b/lisp/frame.el index 5f0e97d5b07..76c1842455c 100644 --- a/lisp/frame.el +++ b/lisp/frame.el | |||
| @@ -604,11 +604,12 @@ new frame." | |||
| 604 | (select-frame (make-frame)))) | 604 | (select-frame (make-frame)))) |
| 605 | 605 | ||
| 606 | (defvar before-make-frame-hook nil | 606 | (defvar before-make-frame-hook nil |
| 607 | "Functions to run before a frame is created.") | 607 | "Functions to run before `make-frame' creates a new frame.") |
| 608 | 608 | ||
| 609 | (defvar after-make-frame-functions nil | 609 | (defvar after-make-frame-functions nil |
| 610 | "Functions to run after a frame is created. | 610 | "Functions to run after `make-frame' created a new frame. |
| 611 | The functions are run with one arg, the newly created frame.") | 611 | The functions are run with one argument, the newly created |
| 612 | frame.") | ||
| 612 | 613 | ||
| 613 | (defvar after-setting-font-hook nil | 614 | (defvar after-setting-font-hook nil |
| 614 | "Functions to run after a frame's font has been changed.") | 615 | "Functions to run after a frame's font has been changed.") |
| @@ -617,7 +618,7 @@ The functions are run with one arg, the newly created frame.") | |||
| 617 | (define-obsolete-function-alias 'new-frame 'make-frame "22.1") | 618 | (define-obsolete-function-alias 'new-frame 'make-frame "22.1") |
| 618 | 619 | ||
| 619 | (defvar frame-inherited-parameters '() | 620 | (defvar frame-inherited-parameters '() |
| 620 | "Parameters `make-frame' copies from the `selected-frame' to the new frame.") | 621 | "Parameters `make-frame' copies from the selected to the new frame.") |
| 621 | 622 | ||
| 622 | (defvar x-display-name) | 623 | (defvar x-display-name) |
| 623 | 624 | ||
| @@ -632,9 +633,6 @@ form (NAME . VALUE), for example: | |||
| 632 | (width . NUMBER) The frame should be NUMBER characters in width. | 633 | (width . NUMBER) The frame should be NUMBER characters in width. |
| 633 | (height . NUMBER) The frame should be NUMBER text lines high. | 634 | (height . NUMBER) The frame should be NUMBER text lines high. |
| 634 | 635 | ||
| 635 | You cannot specify either `width' or `height', you must specify | ||
| 636 | neither or both. | ||
| 637 | |||
| 638 | (minibuffer . t) The frame should have a minibuffer. | 636 | (minibuffer . t) The frame should have a minibuffer. |
| 639 | (minibuffer . nil) The frame should have no minibuffer. | 637 | (minibuffer . nil) The frame should have no minibuffer. |
| 640 | (minibuffer . only) The frame should contain only a minibuffer. | 638 | (minibuffer . only) The frame should contain only a minibuffer. |
| @@ -650,10 +648,10 @@ neither or both. | |||
| 650 | In addition, any parameter specified in `default-frame-alist', | 648 | In addition, any parameter specified in `default-frame-alist', |
| 651 | but not present in PARAMETERS, is applied. | 649 | but not present in PARAMETERS, is applied. |
| 652 | 650 | ||
| 653 | Before creating the frame (via `frame-creation-function-alist'), | 651 | Before creating the frame (via `frame-creation-function'), this |
| 654 | this function runs the hook `before-make-frame-hook'. After | 652 | function runs the hook `before-make-frame-hook'. After creating |
| 655 | creating the frame, it runs the hook `after-make-frame-functions' | 653 | the frame, it runs the hook `after-make-frame-functions' with one |
| 656 | with one arg, the newly created frame. | 654 | argument, the newly created frame. |
| 657 | 655 | ||
| 658 | If a display parameter is supplied and a window-system is not, | 656 | If a display parameter is supplied and a window-system is not, |
| 659 | guess the window-system from the display. | 657 | guess the window-system from the display. |