aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Rudalics2017-09-25 10:09:32 +0200
committerMartin Rudalics2017-09-25 10:09:32 +0200
commitdc6b3560e56c83b3e3191a3d95d31fe288181742 (patch)
tree998a37d181ebc8cca660d0851261a5d404165159
parent3d3778d82a87139ef50a24146f5bad2a57a82094 (diff)
downloademacs-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.texi58
-rw-r--r--lisp/frame.el20
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
119To create a new frame, call the function @code{make-frame}. 120To 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
122This function creates and returns a new frame, displaying the current 123This function creates and returns a new frame, displaying the current
123buffer. 124buffer.
124 125
125The @var{alist} argument is an alist that specifies frame parameters 126The @var{parameters} argument is an alist that specifies frame
126for the new frame. @xref{Frame Parameters}. If you specify the 127parameters for the new frame. @xref{Frame Parameters}. If you specify
127@code{terminal} parameter in @var{alist}, the new frame is created on 128the @code{terminal} parameter in @var{parameters}, the new frame is
128that terminal. Otherwise, if you specify the @code{window-system} 129created on that terminal. Otherwise, if you specify the
129frame parameter in @var{alist}, that determines whether the frame 130@code{window-system} frame parameter in @var{parameters}, that
130should be displayed on a text terminal or a graphical terminal. 131determines whether the frame should be displayed on a text terminal or a
131@xref{Window Systems}. If neither is specified, the new frame is 132graphical terminal. @xref{Window Systems}. If neither is specified,
132created in the same terminal as the selected frame. 133the new frame is created in the same terminal as the selected frame.
133 134
134Any parameters not mentioned in @var{alist} default to the values in 135Any parameters not mentioned in @var{parameters} default to the values
135the alist @code{default-frame-alist} (@pxref{Initial Parameters}); 136in the alist @code{default-frame-alist} (@pxref{Initial Parameters});
136parameters not specified there default from the X resources or its 137parameters not specified there default from the X resources or its
137equivalent on your operating system (@pxref{X Resources,, X Resources, 138equivalent on your operating system (@pxref{X Resources,, X Resources,
138emacs, The GNU Emacs Manual}). After the frame is created, Emacs 139emacs, The GNU Emacs Manual}). After the frame is created, this
139applies any parameters listed in @code{frame-inherited-parameters} 140function 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,
141the frame that was selected when @code{make-frame} was called. 142taking the values from the frame that was selected when
143@code{make-frame} was called.
142 144
143Note that on multi-monitor displays (@pxref{Multiple Terminals}), the 145Note that on multi-monitor displays (@pxref{Multiple Terminals}), the
144window manager might position the frame differently than specified by 146window manager might position the frame differently than specified by
145the positional parameters in @var{alist} (@pxref{Position 147the positional parameters in @var{parameters} (@pxref{Position
146Parameters}). For example, some window managers have a policy of 148Parameters}). For example, some window managers have a policy of
147displaying the frame on the monitor that contains the largest part of 149displaying the frame on the monitor that contains the largest part of
148the window (a.k.a.@: the @dfn{dominating} monitor). 150the 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
161An abnormal hook run by @code{make-frame} after it creates the frame. 163An abnormal hook run by @code{make-frame} after it created the frame.
162Each function in @code{after-make-frame-functions} receives one argument, the 164Each function in @code{after-make-frame-functions} receives one
163frame just created. 165argument, the frame just created.
164@end defvar 166@end defvar
165 167
168Note that any functions added to these hooks by your initial file are
169usually not run for the initial frame, since Emacs reads the initial
170file only after creating that frame. However, if the initial frame is
171specified to use a separate minibuffer frame (@pxref{Minibuffers and
172Frames}), the functions will be run for both, the minibuffer-less and
173the minibuffer frame.
174
166@defvar frame-inherited-parameters 175@defvar frame-inherited-parameters
167This variable specifies the list of frame parameters that a newly 176This variable specifies the list of frame parameters that a newly
168created frame inherits from the currently selected frame. For each 177created frame inherits from the currently selected frame. For each
169parameter (a symbol) that is an element in the list and is not present 178parameter (a symbol) that is an element in this list and has not been
170in the argument to @code{make-frame}, the function sets the value of 179assigned earlier when processing @code{make-frame}, the function sets
171that parameter in the created frame to its value in the selected 180the value of that parameter in the created frame to its value in the
172frame. 181selected 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.
611The functions are run with one arg, the newly created frame.") 611The functions are run with one argument, the newly created
612frame.")
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
635You cannot specify either `width' or `height', you must specify
636neither 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.
650In addition, any parameter specified in `default-frame-alist', 648In addition, any parameter specified in `default-frame-alist',
651but not present in PARAMETERS, is applied. 649but not present in PARAMETERS, is applied.
652 650
653Before creating the frame (via `frame-creation-function-alist'), 651Before creating the frame (via `frame-creation-function'), this
654this function runs the hook `before-make-frame-hook'. After 652function runs the hook `before-make-frame-hook'. After creating
655creating the frame, it runs the hook `after-make-frame-functions' 653the frame, it runs the hook `after-make-frame-functions' with one
656with one arg, the newly created frame. 654argument, the newly created frame.
657 655
658If a display parameter is supplied and a window-system is not, 656If a display parameter is supplied and a window-system is not,
659guess the window-system from the display. 657guess the window-system from the display.