aboutsummaryrefslogtreecommitdiffstats
path: root/doc/lispref
diff options
context:
space:
mode:
authorEli Zaretskii2014-10-14 21:10:37 +0300
committerEli Zaretskii2014-10-14 21:10:37 +0300
commite3060a0c4d2f418ac786775109d71e5843ccf42e (patch)
tree347b37fc39d0db9cd23b3e9f79ee81b4bbc40f08 /doc/lispref
parent1a3eca0656bdb764200e10a4f264138e94b1f3ce (diff)
parent980d78b3587560c13a46aef352ed8d5ed744acf6 (diff)
downloademacs-e3060a0c4d2f418ac786775109d71e5843ccf42e.tar.gz
emacs-e3060a0c4d2f418ac786775109d71e5843ccf42e.zip
Merge from trunk and resolve conflicts.
Diffstat (limited to 'doc/lispref')
-rw-r--r--doc/lispref/ChangeLog123
-rw-r--r--doc/lispref/Makefile.in15
-rw-r--r--doc/lispref/buffers.texi2
-rw-r--r--doc/lispref/commands.texi35
-rw-r--r--doc/lispref/control.texi18
-rw-r--r--doc/lispref/display.texi200
-rw-r--r--doc/lispref/elisp.texi4
-rw-r--r--doc/lispref/eval.texi7
-rw-r--r--doc/lispref/frames.texi171
-rw-r--r--doc/lispref/functions.texi26
-rw-r--r--doc/lispref/internals.texi43
-rw-r--r--doc/lispref/lists.texi68
-rw-r--r--doc/lispref/modes.texi9
-rw-r--r--doc/lispref/sequences.texi92
-rw-r--r--doc/lispref/streams.texi9
-rw-r--r--doc/lispref/strings.texi97
-rw-r--r--doc/lispref/text.texi5
-rw-r--r--doc/lispref/windows.texi122
18 files changed, 734 insertions, 312 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 151fb0005a0..b8f17c0fae5 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,126 @@
12014-10-13 Glenn Morris <rgm@gnu.org>
2
3 * Makefile.in (dist): Update for new output variables.
4
52014-10-12 Glenn Morris <rgm@gnu.org>
6
7 * elisp.texi (DATE): Bump to October 2014.
8
92014-10-09 Glenn Morris <rgm@gnu.org>
10
11 * frames.texi (Multiple Terminals): Copyedits.
12
132014-10-09 Eli Zaretskii <eliz@gnu.org>
14
15 * frames.texi (Multiple Terminals): Improve the description of X
16 display names. Add index entries.
17 (Basic Parameters): Add a cross-reference to where X display names
18 are described.
19 (Position Parameters): Mention that positional parameters of the
20 form (+ POS) can be negative if they are on a non-primary monitor
21 of a multi-monitor display. (Bug#18636)
22 (Creating Frames): Mention that on multi-monitor displays the
23 frame might be positioned differently than specified by the frame
24 parameters alist.
25
262014-10-08 Leo Liu <sdl.web@gmail.com>
27
28 * streams.texi (Output Functions): Document new argument ENSURE to
29 terpri. (Bug#18652)
30
312014-10-04 Martin Rudalics <rudalics@gmx.at>
32
33 * display.texi (Scroll Bars): Add description of horizontal scroll
34 bars and associated functions.
35 * frames.texi (Layout Parameters): Add horizontal scroll bar
36 entries. Remove paragraph on "combined fringe widths".
37 * windows.texi (Window Sizes): Describe affects of horizontal
38 scroll bars on window layout and sizes. Fix description of
39 window-full-height-p.
40 (Resizing Windows): Mention horizontal scroll bar.
41
422014-10-04 Glenn Morris <rgm@gnu.org>
43
44 * commands.texi (Generic Commands): Copyedits.
45
46 * display.texi (Scroll Bars):
47 * modes.texi (Header Lines): Copyedits.
48
49 * buffers.texi (Buffer List):
50 * display.texi (Image Descriptors, Defining Images):
51 * functions.texi (Core Advising Primitives): Small fixes re @var usage.
52
53 * windows.texi (Window Sizes, Resizing Windows): Copyedits.
54
55 * frames.texi (Multiple Terminals): Copyedits re multiple monitors.
56
572014-10-03 Martin Rudalics <rudalics@gmx.at>
58
59 * frames.texi (Size Parameters, Size and Position): Mention that
60 with some window managers you have to set `frame-resize-pixelwise'
61 in order make a frame truly fullscreen or maximized.
62
632014-10-01 Paul Eggert <eggert@cs.ucla.edu>
64
65 Improve doc for use of 'int', and discuss 'ssize_t'.
66 * internals.texi (C Integer Types): Mention 'int' for other
67 randomish values that lie in 'int' range. Mention 'ssize_t'. See:
68 http://lists.gnu.org/archive/html/emacs-devel/2014-10/msg00019.html
69
70 Use AUTO_CONS instead of SCOPED_CONS, etc.
71 * internals.texi (Stack-allocated Objects):
72 Adjust to match the revised, less error-prone macros.
73
742014-09-30 Paul Eggert <eggert@cs.ucla.edu>
75
76 * internals.texi (Stack-allocated Objects): Further improvements.
77 Give an example of misuse.
78
792014-09-30 Eli Zaretskii <eliz@gnu.org>
80
81 * internals.texi (Stack-allocated Objects): Minor improvements of
82 the wording and the indexing.
83
842014-09-30 Dmitry Antipov <dmantipov@yandex.ru>
85
86 * internals.texi (Stack-allocated Objects): Describe this feature.
87
882014-09-15 Daniel Colascione <dancol@dancol.org>
89
90 * text.texi (Registers): Make `insert-register' documentation
91 reflect interface change.
92
932014-09-08 Stefan Monnier <monnier@iro.umontreal.ca>
94
95 * functions.texi (Core Advising Primitives): Add a note about the
96 confusing treatment of `interactive' for :filter-args (bug#18399).
97
982014-09-07 Michael Albinus <michael.albinus@gmx.de>
99
100 * strings.texi (Text Comparison): Describe `string-collate-equalp'
101 and `string-collate-lessp'.
102
1032014-09-06 Leo Liu <sdl.web@gmail.com>
104
105 * control.texi (Pattern matching case statement): Document vector
106 qpattern. (Bug#18327)
107
1082014-08-29 Dmitry Antipov <dmantipov@yandex.ru>
109
110 * lists.texi (Functions that Rearrange Lists): Remove
111 description of sort ...
112 * sequences.texi (Sequence Functions): ... and generalize
113 it for sequences. Add an example.
114
1152014-08-28 Eli Zaretskii <eliz@gnu.org>
116
117 * display.texi (Bidirectional Display): Update the Emacs's class
118 of bidirectional conformance.
119
1202014-08-27 Dmitry Antipov <dmantipov@yandex.ru>
121
122 * eval.texi (Eval): Mention possible recovery from stack overflow.
123
12014-10-13 Eli Zaretskii <eliz@gnu.org> 1242014-10-13 Eli Zaretskii <eliz@gnu.org>
2 125
3 * display.texi (Bidirectional Display): Update the version of the 126 * display.texi (Bidirectional Display): Update the version of the
diff --git a/doc/lispref/Makefile.in b/doc/lispref/Makefile.in
index 2919d97b3a3..22955fb9bae 100644
--- a/doc/lispref/Makefile.in
+++ b/doc/lispref/Makefile.in
@@ -192,6 +192,21 @@ dist:
192 -e 's/^\(clean:.*\)/\1 infoclean/' \ 192 -e 's/^\(clean:.*\)/\1 infoclean/' \
193 -e "s/@ver[s]ion@/${version}/" \ 193 -e "s/@ver[s]ion@/${version}/" \
194 -e 's/@MAKE[I]NFO@/makeinfo/' -e 's/@MK[D]IR_P@/mkdir -p/' \ 194 -e 's/@MAKE[I]NFO@/makeinfo/' -e 's/@MK[D]IR_P@/mkdir -p/' \
195 -e 's/@IN[F]O_EXT@/.info/' -e 's/@IN[F]O_OPTS@//' \
196 -e 's|@SH[E]LL@|/bin/bash|' \
197 -e 's|@[p]refix@|/usr/local|' \
198 -e 's|@[d]atarootdir@|$${prefix}/share|' \
199 -e 's|@[d]atadir@|$${datarootdir}|' \
200 -e 's|@[P]ACKAGE_TARNAME@|emacs|' \
201 -e 's|@[d]ocdir@|$${datarootdir}/doc/$${PACKAGE_TARNAME}|' \
202 -e 's|@[d]vidir@|$${docdir}|' \
203 -e 's|@[h]tmldir@|$${docdir}|' \
204 -e 's|@[p]dfdir@|$${docdir}|' \
205 -e 's|@[p]sdir@|$${docdir}|' \
206 -e 's|@[G]ZIP_PROG@|gzip|' \
207 -e 's|@IN[S]TALL@|install -c|' \
208 -e 's|@IN[S]TALL_DATA@|$${INSTALL} -m 644|' \
209 -e '/@[c]onfigure_input@/d' \
195 ${srcdir}/Makefile.in > emacs-lispref-${version}/Makefile 210 ${srcdir}/Makefile.in > emacs-lispref-${version}/Makefile
196 @if grep '@[a-zA-Z_]*@' emacs-lispref-${version}/Makefile; then \ 211 @if grep '@[a-zA-Z_]*@' emacs-lispref-${version}/Makefile; then \
197 echo "Unexpanded configure variables in Makefile?" 1>&2; exit 1; \ 212 echo "Unexpanded configure variables in Makefile?" 1>&2; exit 1; \
diff --git a/doc/lispref/buffers.texi b/doc/lispref/buffers.texi
index 1293a03082c..5ac2d6786e8 100644
--- a/doc/lispref/buffers.texi
+++ b/doc/lispref/buffers.texi
@@ -863,7 +863,7 @@ If no suitable buffer exists, the buffer @file{*scratch*} is returned
863 863
864@defun last-buffer &optional buffer visible-ok frame 864@defun last-buffer &optional buffer visible-ok frame
865This function returns the last buffer in @var{frame}'s buffer list other 865This function returns the last buffer in @var{frame}'s buffer list other
866than @var{BUFFER}. If @var{frame} is omitted or @code{nil}, it uses the 866than @var{buffer}. If @var{frame} is omitted or @code{nil}, it uses the
867selected frame's buffer list. 867selected frame's buffer list.
868 868
869The argument @var{visible-ok} is handled as with @code{other-buffer}, 869The argument @var{visible-ok} is handled as with @code{other-buffer},
diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi
index 58e903918bf..e5db4d87539 100644
--- a/doc/lispref/commands.texi
+++ b/doc/lispref/commands.texi
@@ -589,31 +589,26 @@ Put them into three windows, selecting the last one."
589@cindex alternatives, defining 589@cindex alternatives, defining
590 590
591The macro @code{define-alternatives} can be used to define 591The macro @code{define-alternatives} can be used to define
592@dfn{generic commands}. Generic commands are interactive functions 592@dfn{generic commands}. These are interactive functions whose
593whose implementation can be selected among several alternatives, as a 593implementation can be selected from several alternatives, as a matter
594matter of user preference. 594of user preference.
595 595
596@defmac define-alternatives command &rest customizations 596@defmac define-alternatives command &rest customizations
597Define the new command `COMMAND'. 597Define the new command @var{command}, a symbol.
598 598
599The argument `COMMAND' should be a symbol. 599When a user runs @kbd{M-x @var{command} @key{RET}} for the first time,
600Emacs prompts for which real form of the command to use, and records
601the selection by way of a custom variable. Using a prefix argument
602repeats this process of choosing an alternative.
600 603
601When a user runs @kbd{M-x COMMAND @key{RET}} for the first time, Emacs 604The variable @code{@var{command}-alternatives} should contain an alist
602will prompt for which alternative to use and record the selected 605with alternative implementations of @var{command}.
603command as a custom variable. 606Until this variable is set, @code{define-alternatives} has no effect.
604 607
605Running @kbd{C-u M-x COMMAND @key{RET}} prompts again for an 608If @var{customizations} is non-@code{nil}, it should consist of
606alternative and overwrites the previous choice. 609alternating @code{defcustom} keywords (typically @code{:group} and
607 610@code{:version}) and values to add to the declaration of
608The variable @code{COMMAND-alternatives} contains an alist 611@code{@var{command}-alternatives}.
609(@pxref{Association Lists}) with alternative implementations of
610`COMMAND'. @code{define-alternatives} does not have any effect until
611this variable is set.
612
613If @var{customizations} is non-@var{nil}, it should be composed of
614alternating @code{defcustom} keywords and values to add to the
615declaration of @code{COMMAND-alternatives} (typically :group and
616:version).
617@end defmac 612@end defmac
618 613
619@node Interactive Call 614@node Interactive Call
diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi
index edf60dd5cc8..5cf6368db52 100644
--- a/doc/lispref/control.texi
+++ b/doc/lispref/control.texi
@@ -328,13 +328,13 @@ lexical binding):
328@example 328@example
329(defun evaluate (exp env) 329(defun evaluate (exp env)
330 (pcase exp 330 (pcase exp
331 (`(add ,x ,y) (+ (evaluate x env) (evaluate y env))) 331 (`(add ,x ,y) (+ (evaluate x env) (evaluate y env)))
332 (`(call ,fun ,arg) (funcall (evaluate fun env) (evaluate arg env))) 332 (`(call ,fun ,arg) (funcall (evaluate fun env) (evaluate arg env)))
333 (`(fn ,arg ,body) (lambda (val) 333 (`(fn ,arg ,body) (lambda (val)
334 (evaluate body (cons (cons arg val) env)))) 334 (evaluate body (cons (cons arg val) env))))
335 ((pred numberp) exp) 335 ((pred numberp) exp)
336 ((pred symbolp) (cdr (assq exp env))) 336 ((pred symbolp) (cdr (assq exp env)))
337 (_ (error "Unknown expression %S" exp)))) 337 (_ (error "Unknown expression %S" exp))))
338@end example 338@end example
339 339
340Where @code{`(add ,x ,y)} is a pattern that checks that @code{exp} is a three 340Where @code{`(add ,x ,y)} is a pattern that checks that @code{exp} is a three
@@ -370,6 +370,10 @@ More specifically, a Q-pattern can take the following forms:
370@item (@var{qpattern1} . @var{qpattern2}) 370@item (@var{qpattern1} . @var{qpattern2})
371This pattern matches any cons cell whose @code{car} matches @var{QPATTERN1} and 371This pattern matches any cons cell whose @code{car} matches @var{QPATTERN1} and
372whose @code{cdr} matches @var{PATTERN2}. 372whose @code{cdr} matches @var{PATTERN2}.
373@item [@var{qpattern1 qpattern2..qpatternm}]
374This pattern matches a vector of length @code{M} whose 0..(M-1)th
375elements match @var{QPATTERN1}, @var{QPATTERN2}..@var{QPATTERNm},
376respectively.
373@item @var{atom} 377@item @var{atom}
374This pattern matches any atom @code{equal} to @var{atom}. 378This pattern matches any atom @code{equal} to @var{atom}.
375@item ,@var{upattern} 379@item ,@var{upattern}
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index fd4a7d7058e..4cb06dd188f 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -23,7 +23,7 @@ that Emacs presents to the user.
23* Faces:: A face defines a graphics style for text characters: 23* Faces:: A face defines a graphics style for text characters:
24 font, colors, etc. 24 font, colors, etc.
25* Fringes:: Controlling window fringes. 25* Fringes:: Controlling window fringes.
26* Scroll Bars:: Controlling vertical scroll bars. 26* Scroll Bars:: Controlling scroll bars.
27* Window Dividers:: Separating windows visually. 27* Window Dividers:: Separating windows visually.
28* Display Property:: Enabling special display features. 28* Display Property:: Enabling special display features.
29* Images:: Displaying images in Emacs buffers. 29* Images:: Displaying images in Emacs buffers.
@@ -3866,102 +3866,164 @@ arrow position. If either property is not set, the default
3866@code{overlay-arrow-string} or @code{overlay-arrow} fringe indicator 3866@code{overlay-arrow-string} or @code{overlay-arrow} fringe indicator
3867is used. 3867is used.
3868 3868
3869
3869@node Scroll Bars 3870@node Scroll Bars
3870@section Scroll Bars 3871@section Scroll Bars
3871@cindex scroll bars 3872@cindex scroll bars
3872 3873
3873Normally the frame parameter @code{vertical-scroll-bars} controls 3874Normally the frame parameter @code{vertical-scroll-bars} controls
3874whether the windows in the frame have vertical scroll bars, and 3875whether the windows in the frame have vertical scroll bars, and whether
3875whether they are on the left or right. The frame parameter 3876they are on the left or right. The frame parameter
3876@code{scroll-bar-width} specifies how wide they are (@code{nil} 3877@code{scroll-bar-width} specifies how wide they are (@code{nil} meaning
3877meaning the default). @xref{Layout Parameters}. 3878the default).
3879
3880 The frame parameter @code{horizontal-scroll-bars} controls whether
3881the windows in the frame have horizontal scroll bars. The frame
3882parameter @code{scroll-bar-height} specifies how high they are
3883(@code{nil} meaning the default). @xref{Layout Parameters}.
3884
3885@vindex horizontal-scroll-bars-available-p
3886 Horizontal scroll bars are not available on all platforms. The
3887function @code{horizontal-scroll-bars-available-p} which takes no
3888argument returns non-@code{nil} if they are available on your system.
3889
3890 The following three functions take as argument a live frame which
3891defaults to the selected one.
3878 3892
3879@defun frame-current-scroll-bars &optional frame 3893@defun frame-current-scroll-bars &optional frame
3880This function reports the scroll bar type settings for frame 3894This function reports the scroll bar types for frame @var{frame}. The
3881@var{frame}. The value is a cons cell 3895value is a cons cell @code{(@var{vertical-type} .@:
3882@code{(@var{vertical-type} .@: @var{horizontal-type})}, where 3896@var{horizontal-type})}, where @var{vertical-type} is either
3883@var{vertical-type} is either @code{left}, @code{right}, or @code{nil} 3897@code{left}, @code{right}, or @code{nil} (which means no vertical scroll
3884(which means no scroll bar.) @var{horizontal-type} is meant to 3898bar.) @var{horizontal-type} is either @code{bottom} or @code{nil}
3885specify the horizontal scroll bar type, but since they are not 3899(which means no horizontal scroll bar).
3886implemented, it is always @code{nil}. 3900@end defun
3887@end defun
3888
3889@vindex vertical-scroll-bar
3890 You can enable or disable scroll bars for a particular buffer,
3891by setting the variable @code{vertical-scroll-bar}. This variable
3892automatically becomes buffer-local when set. The possible values are
3893@code{left}, @code{right}, @code{t}, which means to use the
3894frame's default, and @code{nil} for no scroll bar.
3895 3901
3896 You can also control this for individual windows. Call the function 3902@defun frame-scroll-bar-width &optional Lisp_Object &optional frame
3897@code{set-window-scroll-bars} to specify what to do for a specific window: 3903This function returns the width of vertical scroll bars of @var{frame}
3904in pixels.
3905@end defun
3898 3906
3899@defun set-window-scroll-bars window width &optional vertical-type horizontal-type 3907@defun frame-scroll-bar-height &optional Lisp_Object &optional frame
3900This function sets the width and type of scroll bars for window 3908This function returns the height of horizontal scroll bars of
3901@var{window}. 3909@var{frame} in pixels.
3910@end defun
3902 3911
3903@var{width} specifies the scroll bar width in pixels (@code{nil} means 3912You can override the frame specific settings for individual windows by
3904use the width specified for the frame). @var{vertical-type} specifies 3913using the following function:
3905whether to have a vertical scroll bar and, if so, where. The possible
3906values are @code{left}, @code{right} and @code{nil}, just like the
3907values of the @code{vertical-scroll-bars} frame parameter.
3908 3914
3909The argument @var{horizontal-type} is meant to specify whether and 3915@defun set-window-scroll-bars window &optional width vertical-type height horizontal-type
3910where to have horizontal scroll bars, but since they are not 3916This function sets the width and/or height and the types of scroll bars
3911implemented, it has no effect. If @var{window} is @code{nil}, the 3917for window @var{window}.
3912selected window is used. 3918
3919@var{width} specifies the width of the vertical scroll bar in pixels
3920(@code{nil} means use the width specified for the frame).
3921@var{vertical-type} specifies whether to have a vertical scroll bar and,
3922if so, where. The possible values are @code{left}, @code{right},
3923@code{t}, which means to use the frame's default, and @code{nil} for no
3924vertical scroll bar.
3925
3926@var{height} specifies the height of the horizontal scroll bar in pixels
3927(@code{nil} means use the height specified for the frame).
3928@var{horizontal-type} specifies whether to have a horizontal scroll bar.
3929The possible values are @code{bottom}, @code{t}, which means to use the
3930frame's default, and @code{nil} for no horizontal scroll bar.
3931
3932If @var{window} is @code{nil}, the selected window is used.
3913@end defun 3933@end defun
3914 3934
3935The following four functions take as argument a live window which
3936defaults to the selected one.
3937
3915@defun window-scroll-bars &optional window 3938@defun window-scroll-bars &optional window
3916Report the width and type of scroll bars specified for @var{window}. 3939This function returns a list of the form @code{(@var{width}
3917If @var{window} is omitted or @code{nil}, the selected window is used. 3940@var{columns} @var{vertical-type} @var{height} @var{lines}
3918The value is a list of the form @code{(@var{width} 3941@var{horizontal-type})}.
3919@var{cols} @var{vertical-type} @var{horizontal-type})}. The value
3920@var{width} is the value that was specified for the width (which may
3921be @code{nil}); @var{cols} is the number of columns that the scroll
3922bar actually occupies.
3923 3942
3924@var{horizontal-type} is not actually meaningful. 3943The value @var{width} is the value that was specified for the width of
3944the vertical scroll bar (which may be @code{nil}); @var{columns} is the
3945(possibly rounded) number of columns that the vertical scroll bar
3946actually occupies.
3947
3948The value @var{height} is the value that was specified for the height of
3949the horizontal scroll bar (which may be @code{nil}); @var{lines} is the
3950(possibly rounded) number of lines that the horizontally scroll bar
3951actually occupies.
3952@end defun
3953
3954@defun window-current-scroll-bars &optional window
3955This function reports the scroll bar type for window @var{window}. The
3956value is a cons cell @code{(@var{vertical-type} .@:
3957@var{horizontal-type})}. Unlike @code{window-scroll-bars}, this reports
3958the scroll bar type actually used, once frame defaults and
3959@code{scroll-bar-mode} are taken into account.
3925@end defun 3960@end defun
3926 3961
3927@defun window-scroll-bar-width &optional window 3962@defun window-scroll-bar-width &optional window
3928This function returns the width of @var{window}'s vertical scrollbar, 3963This function returns the width in pixels of @var{window}'s vertical
3929in pixels. @var{window} must be a live window. If @var{window} is 3964scrollbar.
3930@code{nil} or omitted, it will be the selected window. 3965@end defun
3966
3967@defun window-scroll-bar-height &optional window
3968This function returns the height in pixels of @var{window}'s horizontal
3969scrollbar.
3931@end defun 3970@end defun
3932 3971
3933If you don't specify these values for a window with 3972If you don't specify these values for a window with
3934@code{set-window-scroll-bars}, the buffer-local variables 3973@code{set-window-scroll-bars}, the buffer-local variables
3935@code{scroll-bar-mode} and @code{scroll-bar-width} in the buffer being 3974@code{vertical-scroll-bar}, @code{horizontal-scroll-bar},
3936displayed control the window's vertical scroll bars. The function 3975@code{scroll-bar-width} and @code{scroll-bar-height} in the buffer being
3976displayed control the window's scroll bars. The function
3937@code{set-window-buffer} examines these variables. If you change them 3977@code{set-window-buffer} examines these variables. If you change them
3938in a buffer that is already visible in a window, you can make the 3978in a buffer that is already visible in a window, you can make the window
3939window take note of the new values by calling @code{set-window-buffer} 3979take note of the new values by calling @code{set-window-buffer}
3940specifying the same buffer that is already displayed. 3980specifying the same buffer that is already displayed.
3941 3981
3942@defopt scroll-bar-mode 3982You can control the appearance of scroll bars for a particular buffer by
3943This variable, always local in all buffers, controls whether and where 3983setting the following variables which automatically become buffer-local
3944to put scroll bars in windows displaying the buffer. The possible values 3984when set.
3945are @code{nil} for no scroll bar, @code{left} to put a scroll bar on
3946the left, and @code{right} to put a scroll bar on the right.
3947@end defopt
3948 3985
3949@defun window-current-scroll-bars &optional window 3986@defvar vertical-scroll-bar
3950This function reports the scroll bar type for window @var{window}. 3987This variable specifies the location of the vertical scroll bar. The
3951If @var{window} is omitted or @code{nil}, the selected window is used. 3988possible values are @code{left}, @code{right}, @code{t}, which means to
3952The value is a cons cell 3989use the frame's default, and @code{nil} for no scroll bar.
3953@code{(@var{vertical-type} .@: @var{horizontal-type})}. Unlike 3990@end defvar
3954@code{window-scroll-bars}, this reports the scroll bar type actually 3991
3955used, once frame defaults and @code{scroll-bar-mode} are taken into 3992@defvar horizontal-scroll-bar
3956account. 3993This variable specifies the location of the horizontal scroll bar. The
3957@end defun 3994possible values are @code{bottom}, @code{t}, which means to use the
3995frame's default, and @code{nil} for no scroll bar.
3996@end defvar
3958 3997
3959@defvar scroll-bar-width 3998@defvar scroll-bar-width
3960This variable, always local in all buffers, specifies the width of the 3999This variable specifies the width of the buffer's vertical scroll bars,
3961buffer's scroll bars, measured in pixels. A value of @code{nil} means 4000measured in pixels. A value of @code{nil} means to use the value
3962to use the value specified by the frame. 4001specified by the frame.
3963@end defvar 4002@end defvar
3964 4003
4004@defvar scroll-bar-height
4005This variable specifies the height of the buffer's horizontal scroll
4006bar, measured in pixels. A value of @code{nil} means to use the value
4007specified by the frame.
4008@end defvar
4009
4010Finally you can toggle the display of scroll bars on all frames by
4011customizing the variables @code{scroll-bar-mode} and
4012@code{horizontal-scroll-bar-mode}.
4013
4014@defopt scroll-bar-mode
4015This variable controls whether and where to put vertical scroll bars in
4016all frames. The possible values are @code{nil} for no scroll bars,
4017@code{left} to put scroll bars on the left and @code{right} to put
4018scroll bars on the right.
4019@end defopt
4020
4021@defopt horizontal-scroll-bar-mode
4022This variable controls whether to display horizontal scroll bars on all
4023frames.
4024@end defopt
4025
4026
3965@node Window Dividers 4027@node Window Dividers
3966@section Window Dividers 4028@section Window Dividers
3967@cindex window dividers 4029@cindex window dividers
@@ -4503,7 +4565,7 @@ functions to insert images into buffers.
4503 4565
4504 Each image descriptor has the form @code{(image . @var{props})}, 4566 Each image descriptor has the form @code{(image . @var{props})},
4505where @var{props} is a property list of alternating keyword symbols 4567where @var{props} is a property list of alternating keyword symbols
4506and values, including at least the pair @code{:type @var{TYPE}} which 4568and values, including at least the pair @code{:type @var{type}} that
4507specifies the image type. 4569specifies the image type.
4508 4570
4509 The following is a list of properties that are meaningful for all 4571 The following is a list of properties that are meaningful for all
@@ -4995,7 +5057,7 @@ of a list of image specifications @var{specs}.
4995Each specification in @var{specs} is a property list with contents 5057Each specification in @var{specs} is a property list with contents
4996depending on image type. All specifications must at least contain the 5058depending on image type. All specifications must at least contain the
4997properties @code{:type @var{type}} and either @w{@code{:file @var{file}}} 5059properties @code{:type @var{type}} and either @w{@code{:file @var{file}}}
4998or @w{@code{:data @var{DATA}}}, where @var{type} is a symbol specifying 5060or @w{@code{:data @var{data}}}, where @var{type} is a symbol specifying
4999the image type, e.g., @code{xbm}, @var{file} is the file to load the 5061the image type, e.g., @code{xbm}, @var{file} is the file to load the
5000image from, and @var{data} is a string containing the actual image data. 5062image from, and @var{data} is a string containing the actual image data.
5001The first specification in the list whose @var{type} is supported, and 5063The first specification in the list whose @var{type} is supported, and
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi
index bb2e4638396..fa665da34a4 100644
--- a/doc/lispref/elisp.texi
+++ b/doc/lispref/elisp.texi
@@ -56,7 +56,7 @@
56@c (See comments for EDITION in emacs.texi) 56@c (See comments for EDITION in emacs.texi)
57@set VERSION 3.1 57@set VERSION 3.1
58@include emacsver.texi 58@include emacsver.texi
59@set DATE January 2013 59@set DATE October 2014
60 60
61@c in general, keep the following line commented out, unless doing a 61@c in general, keep the following line commented out, unless doing a
62@c copy of this manual that will be published. The manual should go 62@c copy of this manual that will be published. The manual should go
@@ -1343,7 +1343,7 @@ Emacs Display
1343* Faces:: A face defines a graphics style 1343* Faces:: A face defines a graphics style
1344 for text characters: font, colors, etc. 1344 for text characters: font, colors, etc.
1345* Fringes:: Controlling window fringes. 1345* Fringes:: Controlling window fringes.
1346* Scroll Bars:: Controlling vertical scroll bars. 1346* Scroll Bars:: Controlling scroll bars.
1347* Window Dividers:: Separating windows visually. 1347* Window Dividers:: Separating windows visually.
1348* Display Property:: Enabling special display features. 1348* Display Property:: Enabling special display features.
1349* Images:: Displaying images in Emacs buffers. 1349* Images:: Displaying images in Emacs buffers.
diff --git a/doc/lispref/eval.texi b/doc/lispref/eval.texi
index 05250233b00..6ffc7db8abf 100644
--- a/doc/lispref/eval.texi
+++ b/doc/lispref/eval.texi
@@ -805,7 +805,12 @@ message @code{"Lisp nesting exceeds max-lisp-eval-depth"}).
805This limit, with the associated error when it is exceeded, is one way 805This limit, with the associated error when it is exceeded, is one way
806Emacs Lisp avoids infinite recursion on an ill-defined function. If 806Emacs Lisp avoids infinite recursion on an ill-defined function. If
807you increase the value of @code{max-lisp-eval-depth} too much, such 807you increase the value of @code{max-lisp-eval-depth} too much, such
808code can cause stack overflow instead. 808code can cause stack overflow instead. On some systems, this overflow
809can be handled. In that case, normal Lisp evaluation is interrupted
810and control is transferred back to the top level command loop
811(@code{top-level}). Note that there is no way to enter Emacs Lisp
812debugger in this situation. @xref{Error Debugging}.
813
809@cindex Lisp nesting error 814@cindex Lisp nesting error
810 815
811The depth limit counts internal uses of @code{eval}, @code{apply}, and 816The depth limit counts internal uses of @code{eval}, @code{apply}, and
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi
index b95a5ccdb92..a14702a7ce1 100644
--- a/doc/lispref/frames.texi
+++ b/doc/lispref/frames.texi
@@ -131,6 +131,13 @@ applies any parameters listed in @code{frame-inherited-parameters}
131(see below) and not present in the argument, taking the values from 131(see below) and not present in the argument, taking the values from
132the frame that was selected when @code{make-frame} was called. 132the frame that was selected when @code{make-frame} was called.
133 133
134Note that on multi-monitor displays (@pxref{Multiple Terminals}), the
135window manager might position the frame differently than specified by
136the positional parameters in @var{alist} (@pxref{Position
137Parameters}). For example, some window managers have a policy of
138displaying the frame on the monitor that contains the largest part of
139the window (a.k.a.@: the @dfn{dominating} monitor).
140
134This function itself does not make the new frame the selected frame. 141This function itself does not make the new frame the selected frame.
135@xref{Input Focus}. The previously selected frame remains selected. 142@xref{Input Focus}. The previously selected frame remains selected.
136On graphical terminals, however, the windowing system may select the 143On graphical terminals, however, the windowing system may select the
@@ -258,13 +265,27 @@ of those frames is ``@emph{the} selected frame'' at any given moment
258terminals, by interacting with the @command{emacsclient} program. 265terminals, by interacting with the @command{emacsclient} program.
259@xref{Emacs Server,,, emacs, The GNU Emacs Manual}. 266@xref{Emacs Server,,, emacs, The GNU Emacs Manual}.
260 267
268@cindex X display names
269@cindex display name on X
261 A single X server can handle more than one display. Each X display 270 A single X server can handle more than one display. Each X display
262has a three-part name, @samp{@var{host}:@var{server}.@var{screen}}. 271has a three-part name,
263The first two parts, @var{host} and @var{server}, identify the X 272@samp{@var{hostname}:@var{displaynumber}.@var{screennumber}}. The
264server; the third part, @var{screen}, identifies a screen number on 273first part, @var{hostname}, specifies the name of the machine to which
265that X server. When you use two or more screens belonging to one 274the display is physically connected. The second part,
266server, Emacs knows by the similarity in their names that they share a 275@var{displaynumber}, is a zero-based number that identifies one or
267single keyboard. 276more monitors connected to that machine that share a common keyboard
277and pointing device (mouse, tablet, etc.). The third part,
278@var{screennumber}, identifies a zero-based screen number (a separate
279monitor) that is part of a single monitor collection on that X server.
280When you use two or more screens belonging to one server, Emacs knows
281by the similarity in their names that they share a single keyboard.
282
283 Systems that don't use the X window system, such as MS-Windows,
284don't support the notion of X displays, and have only one display on
285each host. The display name on these systems doesn't follow the above
2863-part format; for example, the display name on MS-Windows systems is
287a constant string @samp{w32}, and exists for compatibility, so that
288you could pass it to functions that expect a display name.
268 289
269@deffn Command make-frame-on-display display &optional parameters 290@deffn Command make-frame-on-display display &optional parameters
270This function creates and returns a new frame on @var{display}, taking 291This function creates and returns a new frame on @var{display}, taking
@@ -314,57 +335,84 @@ on that display (@pxref{Deleting Frames}).
314 335
315@cindex multi-monitor 336@cindex multi-monitor
316 On some ``multi-monitor'' setups, a single X display outputs to more 337 On some ``multi-monitor'' setups, a single X display outputs to more
317than one physical monitor. @code{display-monitor-attributes-list} and 338than one physical monitor. You can use the functions
318@code{frame-monitor-attributes} can be used to obtain information 339@code{display-monitor-attributes-list} and @code{frame-monitor-attributes}
319about each physical monitor on multi-monitor setups. 340to obtain information about such setups.
320 341
321@defun display-monitor-attributes-list &optional display 342@defun display-monitor-attributes-list &optional display
322This function returns a list of physical monitor attributes on 343This function returns a list of physical monitor attributes on
323@var{display}. Each element of the list is an association list, 344@var{display}, which can be a display name (a string), a terminal, or
324representing the attributes of each physical monitor. The first 345a frame; if omitted or @code{nil}, it defaults to the selected frame's
325element corresponds to the primary monitor. 346display. Each element of the list is an association list,
326 347representing the attributes of a physical monitor. The first element
327Attributes for a physical monitor are: 348corresponds to the primary monitor. The attribute keys and values
349are:
328 350
329@table @samp 351@table @samp
330@item geometry 352@item geometry
331Position and size in pixels in the form of @samp{(X Y WIDTH HEIGHT)} 353Position of the top-left corner of the monitor's screen and its size,
354in pixels, as @samp{(@var{x} @var{y} @var{width} @var{height})}. Note
355that, if the monitor is not the primary monitor, some of the
356coordinates might be negative.
332 357
333@item workarea 358@item workarea
334Position and size of the workarea in pixels in the form of @samp{(X Y 359Position of the top-left corner and size of the work area (``usable''
335WIDTH HEIGHT)} 360space) in pixels as @samp{(@var{x} @var{y} @var{width} @var{height})}.
361This may be different from @samp{geometry} in that space occupied by
362various window manager features (docks, taskbars, etc.) may be
363excluded from the work area. Whether or not such features actually
364subtract from the work area depends on the platform and environment.
365Again, if the monitor is not the primary monitor, some of the
366coordinates might be negative.
336 367
337@item mm-size 368@item mm-size
338Width and height in millimeters in the form of @samp{(WIDTH HEIGHT)} 369Width and height in millimeters as @samp{(@var{width} @var{height})}
339 370
340@item frames 371@item frames
341List of frames dominated by the physical monitor 372List of frames that this physical monitor dominates (see below).
342 373
343@item name 374@item name
344Name of the physical monitor as a string 375Name of the physical monitor as @var{string}.
345@end table
346 376
347where X, Y, WIDTH, and HEIGHT are integers. @samp{name} is optional. 377@item source
378Source of the multi-monitor information as @var{string};
379e.g., @samp{XRandr} or @samp{Xinerama}.
380@end table
348 381
349A frame is dominated by a physical monitor when either the 382@var{x}, @var{y}, @var{width}, and @var{height} are integers.
350largest area of the frame resides in the monitor, or the monitor 383@samp{name} and @samp{source} may be absent.
351is the closest to the frame if the frame does not intersect any 384
352physical monitors. Every non-tip frame (including invisible one) 385A frame is @dfn{dominated} by a physical monitor when either the
353in a graphical display is dominated by exactly one physical 386largest area of the frame resides in that monitor, or (if the frame
354monitor at a time, though it can span multiple (or no) physical 387does not intersect any physical monitors) that monitor is the closest
355monitors. 388to the frame. Every (non-tooltip) frame (whether visible or not) in a
389graphical display is dominated by exactly one physical monitor at a
390time, though the frame can span multiple (or no) physical monitors.
391
392Here's an example of the data produced by this function on a 2-monitor
393display:
394
395@lisp
396 (display-monitor-attributes-list)
397 @result{}
398 (((geometry 0 0 1920 1080) ;; @r{Left-hand, primary monitor}
399 (workarea 0 0 1920 1050) ;; @r{A taskbar occupies some of the height}
400 (mm-size 677 381)
401 (name . "DISPLAY1")
402 (frames #<frame emacs@@host *Messages* 0x11578c0>
403 #<frame emacs@@host *scratch* 0x114b838>))
404 ((geometry 1920 0 1680 1050) ;; @r{Right-hand monitor}
405 (workarea 1920 0 1680 1050) ;; @r{Whole screen can be used}
406 (mm-size 593 370)
407 (name . "DISPLAY2")
408 (frames)))
409@end lisp
356 410
357@var{display} defaults to the selected frame's display.
358@end defun 411@end defun
359 412
360@defun frame-monitor-attributes &optional frame 413@defun frame-monitor-attributes &optional frame
361This function returns the attributes of the physical monitor 414This function returns the attributes of the physical monitor
362dominating @var{frame}, which defaults to the selected frame. 415dominating (see above) @var{frame}, which defaults to the selected frame.
363
364A frame is dominated by a physical monitor when either the
365largest area of the frame resides in the monitor, or the monitor
366is the closest to the frame if the frame does not intersect any
367physical monitors.
368@end defun 416@end defun
369 417
370@node Frame Parameters 418@node Frame Parameters
@@ -536,8 +584,9 @@ frame. @code{title} and @code{name} are meaningful on all terminals.
536@vindex display, a frame parameter 584@vindex display, a frame parameter
537@item display 585@item display
538The display on which to open this frame. It should be a string of the 586The display on which to open this frame. It should be a string of the
539form @code{"@var{host}:@var{dpy}.@var{screen}"}, just like the 587form @samp{@var{host}:@var{dpy}.@var{screen}}, just like the
540@env{DISPLAY} environment variable. 588@env{DISPLAY} environment variable. @xref{Multiple Terminals}, for
589more details about display names.
541 590
542@vindex display-type, a frame parameter 591@vindex display-type, a frame parameter
543@item display-type 592@item display-type
@@ -593,12 +642,14 @@ right screen edge.
593@item @code{(+ @var{pos})} 642@item @code{(+ @var{pos})}
594This specifies the position of the left frame edge relative to the left 643This specifies the position of the left frame edge relative to the left
595screen edge. The integer @var{pos} may be positive or negative; a 644screen edge. The integer @var{pos} may be positive or negative; a
596negative value specifies a position outside the screen. 645negative value specifies a position outside the screen or on a monitor
646other than the primary one (for multi-monitor displays).
597 647
598@item @code{(- @var{pos})} 648@item @code{(- @var{pos})}
599This specifies the position of the right frame edge relative to the right 649This specifies the position of the right frame edge relative to the right
600screen edge. The integer @var{pos} may be positive or negative; a 650screen edge. The integer @var{pos} may be positive or negative; a
601negative value specifies a position outside the screen. 651negative value specifies a position outside the screen or on a monitor
652other than the primary one (for multi-monitor displays).
602@end table 653@end table
603 654
604Some window managers ignore program-specified positions. If you want to 655Some window managers ignore program-specified positions. If you want to
@@ -686,6 +737,11 @@ difference between @code{maximized} and @code{fullboth} is that the
686former can still be resized by dragging window manager decorations 737former can still be resized by dragging window manager decorations
687with the mouse, while the latter really covers the whole screen and 738with the mouse, while the latter really covers the whole screen and
688does not allow resizing by mouse dragging. 739does not allow resizing by mouse dragging.
740
741With some window managers you may have to customize the variable
742@code{frame-resize-pixelwise} to a non-@code{nil} value in order to make
743a frame appear ``maximized'' or ``fullscreen''.
744
689@end table 745@end table
690 746
691@node Layout Parameters 747@node Layout Parameters
@@ -711,19 +767,21 @@ Whether the frame has scroll bars for vertical scrolling, and which side
711of the frame they should be on. The possible values are @code{left}, 767of the frame they should be on. The possible values are @code{left},
712@code{right}, and @code{nil} for no scroll bars. 768@code{right}, and @code{nil} for no scroll bars.
713 769
714@ignore
715@vindex horizontal-scroll-bars, a frame parameter 770@vindex horizontal-scroll-bars, a frame parameter
716@item horizontal-scroll-bars 771@item horizontal-scroll-bars
717Whether the frame has scroll bars for horizontal scrolling 772Whether the frame has scroll bars for horizontal scrolling (@code{t} and
718(non-@code{nil} means yes). Horizontal scroll bars are not currently 773@code{bottom} mean yes, @code{nil} means no).
719implemented.
720@end ignore
721 774
722@vindex scroll-bar-width, a frame parameter 775@vindex scroll-bar-width, a frame parameter
723@item scroll-bar-width 776@item scroll-bar-width
724The width of vertical scroll bars, in pixels, or @code{nil} meaning to 777The width of vertical scroll bars, in pixels, or @code{nil} meaning to
725use the default width. 778use the default width.
726 779
780@vindex scroll-bar-height, a frame parameter
781@item scroll-bar-height
782The height of horizontal scroll bars, in pixels, or @code{nil} meaning
783to use the default height.
784
727@vindex left-fringe, a frame parameter 785@vindex left-fringe, a frame parameter
728@vindex right-fringe, a frame parameter 786@vindex right-fringe, a frame parameter
729@item left-fringe 787@item left-fringe
@@ -737,14 +795,6 @@ these two frame parameters, the return value is always an integer.
737When using @code{set-frame-parameter}, passing a @code{nil} value 795When using @code{set-frame-parameter}, passing a @code{nil} value
738imposes an actual default value of 8 pixels. 796imposes an actual default value of 8 pixels.
739 797
740The combined fringe widths must add up to an integral number of
741columns, so the actual default fringe widths for the frame, as
742reported by @code{frame-parameter}, may be larger than what you
743specify. Any extra width is distributed evenly between the left and
744right fringe. However, you can force one fringe or the other to a
745precise width by specifying that width as a negative integer. If both
746widths are negative, only the left fringe gets the specified width.
747
748@vindex right-divider-width, a frame parameter 798@vindex right-divider-width, a frame parameter
749@item right-divider-width 799@item right-divider-width
750The width (thickness) reserved for the right divider (@pxref{Window 800The width (thickness) reserved for the right divider (@pxref{Window
@@ -966,7 +1016,7 @@ variable do not take effect immediately, only when you specify the
966A list of symbols, specifying the @dfn{font backends} to use for 1016A list of symbols, specifying the @dfn{font backends} to use for
967drawing fonts in the frame, in order of priority. On X, there are 1017drawing fonts in the frame, in order of priority. On X, there are
968currently two available font backends: @code{x} (the X core font 1018currently two available font backends: @code{x} (the X core font
969driver) and @code{xft} (the Xft font driver). On Windows, there are 1019driver) and @code{xft} (the Xft font driver). On MS-Windows, there are
970currently two available font backends: @code{gdi} and 1020currently two available font backends: @code{gdi} and
971@code{uniscribe} (@pxref{Windows Fonts,,, emacs, The GNU Emacs 1021@code{uniscribe} (@pxref{Windows Fonts,,, emacs, The GNU Emacs
972Manual}). On other systems, there is only one available font backend, 1022Manual}). On other systems, there is only one available font backend,
@@ -1158,12 +1208,15 @@ size hints to the window manager. This means that this variable should
1158be set only in a user's initial file; applications should never bind it 1208be set only in a user's initial file; applications should never bind it
1159temporarily. 1209temporarily.
1160 1210
1161The precise semantics of a value of @code{nil} for this option depends 1211The precise meaning of a value of @code{nil} for this option depends
1162on the toolkit used: Dragging the frame border with the mouse is usually 1212on the toolkit used. Dragging the frame border with the mouse is usually
1163always done character-wise. Calling @code{set-frame-size} (see below) 1213done character-wise. Calling @code{set-frame-size} (see below)
1164with arguments that do not specify the frame size as an integer multiple 1214with arguments that do not specify the frame size as an integer multiple
1165of its character size may be, however, either ignored or cause a 1215of its character size, however, may: be ignored, cause a
1166rounding (GTK+, Windows) or get accepted (Lucid, Motif). 1216rounding (GTK+), or be accepted (Lucid, Motif, MS-Windows).
1217
1218With some window managers you may have to set this to non-@code{nil} in
1219order to make a frame appear truly ``maximized'' or ``fullscreen''.
1167@end defopt 1220@end defopt
1168 1221
1169@defun set-frame-size frame width height pixelwise 1222@defun set-frame-size frame width height pixelwise
diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi
index 91fdcc63cbe..023175e3632 100644
--- a/doc/lispref/functions.texi
+++ b/doc/lispref/functions.texi
@@ -1220,15 +1220,6 @@ ways to do it. The added function is also called an @emph{advice}.
1220This macro is the handy way to add the advice @var{function} to the function 1220This macro is the handy way to add the advice @var{function} to the function
1221stored in @var{place} (@pxref{Generalized Variables}). 1221stored in @var{place} (@pxref{Generalized Variables}).
1222 1222
1223If @var{function} is not interactive, then the combined function will inherit
1224the interactive spec, if any, of the original function. Else, the combined
1225function will be interactive and will use the interactive spec of
1226@var{function}. One exception: if the interactive spec of @var{function}
1227is a function (rather than an expression or a string), then the interactive
1228spec of the combined function will be a call to that function with as sole
1229argument the interactive spec of the original function. To interpret the spec
1230received as argument, use @code{advice-eval-interactive-spec}.
1231
1232@var{where} determines how @var{function} is composed with the 1223@var{where} determines how @var{function} is composed with the
1233existing function, e.g. whether @var{function} should be called before, or 1224existing function, e.g. whether @var{function} should be called before, or
1234after the original function. @xref{Advice combinators}, for the list of 1225after the original function. @xref{Advice combinators}, for the list of
@@ -1241,7 +1232,7 @@ global value of @var{place}. Whereas if @var{place} is of the form
1241@code{(local @var{symbol})}, where @var{symbol} is an expression which returns 1232@code{(local @var{symbol})}, where @var{symbol} is an expression which returns
1242the variable name, then @var{function} will only be added in the 1233the variable name, then @var{function} will only be added in the
1243current buffer. Finally, if you want to modify a lexical variable, you will 1234current buffer. Finally, if you want to modify a lexical variable, you will
1244have to use @code{(var @var{VARIABLE})}. 1235have to use @code{(var @var{variable})}.
1245 1236
1246Every function added with @code{add-function} can be accompanied by an 1237Every function added with @code{add-function} can be accompanied by an
1247association list of properties @var{props}. Currently only two of those 1238association list of properties @var{props}. Currently only two of those
@@ -1271,6 +1262,21 @@ original function and other advices will apply to it, whereas an outermost
1271@code{:override} advice will override not only the original function but all 1262@code{:override} advice will override not only the original function but all
1272other advices applied to it as well. 1263other advices applied to it as well.
1273@end table 1264@end table
1265
1266If @var{function} is not interactive, then the combined function will inherit
1267the interactive spec, if any, of the original function. Else, the combined
1268function will be interactive and will use the interactive spec of
1269@var{function}. One exception: if the interactive spec of @var{function}
1270is a function (rather than an expression or a string), then the interactive
1271spec of the combined function will be a call to that function with as sole
1272argument the interactive spec of the original function. To interpret the spec
1273received as argument, use @code{advice-eval-interactive-spec}.
1274
1275Note: The interactive spec of @var{function} will apply to the combined
1276function and should hence obey the calling convention of the combined function
1277rather than that of @var{function}. In many cases, it makes no difference
1278since they are identical, but it does matter for @code{:around},
1279@code{:filter-args}, and @code{filter-return}, where @var{function}.
1274@end defmac 1280@end defmac
1275 1281
1276@defmac remove-function place function 1282@defmac remove-function place function
diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi
index 3d85b474d4b..db6ed41268c 100644
--- a/doc/lispref/internals.texi
+++ b/doc/lispref/internals.texi
@@ -14,6 +14,7 @@ internal aspects of GNU Emacs that may be of interest to C programmers.
14* Building Emacs:: How the dumped Emacs is made. 14* Building Emacs:: How the dumped Emacs is made.
15* Pure Storage:: Kludge to make preloaded Lisp functions shareable. 15* Pure Storage:: Kludge to make preloaded Lisp functions shareable.
16* Garbage Collection:: Reclaiming space for Lisp objects no longer used. 16* Garbage Collection:: Reclaiming space for Lisp objects no longer used.
17* Stack-allocated Objects:: Temporary conses and strings on C stack.
17* Memory Usage:: Info about total size of Lisp objects made so far. 18* Memory Usage:: Info about total size of Lisp objects made so far.
18* C Dialect:: What C variant Emacs is written in. 19* C Dialect:: What C variant Emacs is written in.
19* Writing Emacs Primitives:: Writing C code for Emacs. 20* Writing Emacs Primitives:: Writing C code for Emacs.
@@ -529,6 +530,35 @@ during garbage collection so far in this Emacs session, as a
529floating-point number. 530floating-point number.
530@end defvar 531@end defvar
531 532
533@node Stack-allocated Objects
534@section Stack-allocated Objects
535
536@cindex stack allocated Lisp objects
537@cindex Lisp objects, stack-allocated
538 The garbage collector described above is used to manage data visible
539from Lisp programs, as well as most of the data internally used by the
540Lisp interpreter. Sometimes it may be useful to allocate temporary
541internal objects using the C stack of the interpreter. This can help
542performance, as stack allocation is typically faster than using heap
543memory to allocate and the garbage collector to free. The downside is
544that using such objects after they are freed results in undefined
545behavior, so uses should be well thought out and carefully debugged by
546using the @code{GC_CHECK_MARKED_OBJECTS} feature (see
547@file{src/alloc.c}). In particular, stack-allocated objects should
548never be made visible to user Lisp code.
549
550 Currently, cons cells and strings can be allocated this way. This
551is implemented by C macros like @code{AUTO_CONS} and
552@code{AUTO_STRING} that define a named @code{Lisp_Object} with block
553lifetime. These objects are not freed by the garbage collector;
554instead, they have automatic storage duration, i.e., they are
555allocated like local variables and are automatically freed at the end
556of execution of the C block that defined the object.
557
558 For performance reasons, stack-allocated strings are limited to
559@acronym{ASCII} characters, and many of these strings are immutable,
560i.e., calling @code{ASET} on them produces undefined behavior.
561
532@node Memory Usage 562@node Memory Usage
533@section Memory Usage 563@section Memory Usage
534@cindex memory usage 564@cindex memory usage
@@ -1595,6 +1625,8 @@ of @code{intptr_t}).
1595 1625
1596@item 1626@item
1597Prefer @code{int} for Emacs character codes, in the range 0 ..@: 0x3FFFFF. 1627Prefer @code{int} for Emacs character codes, in the range 0 ..@: 0x3FFFFF.
1628More generally, prefer @code{int} for integers known to be in
1629@code{int} range, e.g., screen column counts.
1598 1630
1599@item 1631@item
1600Prefer @code{ptrdiff_t} for sizes, i.e., for integers bounded by the 1632Prefer @code{ptrdiff_t} for sizes, i.e., for integers bounded by the
@@ -1606,6 +1638,17 @@ anyway since they would break pointer subtraction, so this does not
1606impose an arbitrary limit. 1638impose an arbitrary limit.
1607 1639
1608@item 1640@item
1641Avoid @code{ssize_t} except when communicating to low-level APIs that
1642have @code{ssize_t}-related limitations. Although it's equivalent to
1643@code{ptrdiff_t} on typical platforms, @code{ssize_t} is occasionally
1644narrower, so using it for size-related calculations could overflow.
1645Also, @code{ptrdiff_t} is more ubiquitous and better-standardized, has
1646standard @code{printf} formats, and is the basis for Emacs's internal
1647size-overflow checking. When using @code{ssize_t}, please note that
1648POSIX requires support only for values in the range @minus{}1 ..@:
1649@code{SSIZE_MAX}.
1650
1651@item
1609Prefer @code{intptr_t} for internal representations of pointers, or 1652Prefer @code{intptr_t} for internal representations of pointers, or
1610for integers bounded only by the number of objects that can exist at 1653for integers bounded only by the number of objects that can exist at
1611any given time or by the total number of bytes that can be allocated. 1654any given time or by the total number of bytes that can be allocated.
diff --git a/doc/lispref/lists.texi b/doc/lispref/lists.texi
index f724d5bd902..21be5cca4fc 100644
--- a/doc/lispref/lists.texi
+++ b/doc/lispref/lists.texi
@@ -1124,74 +1124,6 @@ each time you run it! Here is what happens:
1124@end smallexample 1124@end smallexample
1125@end defun 1125@end defun
1126 1126
1127@defun sort list predicate
1128@cindex stable sort
1129@cindex sorting lists
1130This function sorts @var{list} stably, though destructively, and
1131returns the sorted list. It compares elements using @var{predicate}. A
1132stable sort is one in which elements with equal sort keys maintain their
1133relative order before and after the sort. Stability is important when
1134successive sorts are used to order elements according to different
1135criteria.
1136
1137The argument @var{predicate} must be a function that accepts two
1138arguments. It is called with two elements of @var{list}. To get an
1139increasing order sort, the @var{predicate} should return non-@code{nil} if the
1140first element is ``less than'' the second, or @code{nil} if not.
1141
1142The comparison function @var{predicate} must give reliable results for
1143any given pair of arguments, at least within a single call to
1144@code{sort}. It must be @dfn{antisymmetric}; that is, if @var{a} is
1145less than @var{b}, @var{b} must not be less than @var{a}. It must be
1146@dfn{transitive}---that is, if @var{a} is less than @var{b}, and @var{b}
1147is less than @var{c}, then @var{a} must be less than @var{c}. If you
1148use a comparison function which does not meet these requirements, the
1149result of @code{sort} is unpredictable.
1150
1151The destructive aspect of @code{sort} is that it rearranges the cons
1152cells forming @var{list} by changing @sc{cdr}s. A nondestructive sort
1153function would create new cons cells to store the elements in their
1154sorted order. If you wish to make a sorted copy without destroying the
1155original, copy it first with @code{copy-sequence} and then sort.
1156
1157Sorting does not change the @sc{car}s of the cons cells in @var{list};
1158the cons cell that originally contained the element @code{a} in
1159@var{list} still has @code{a} in its @sc{car} after sorting, but it now
1160appears in a different position in the list due to the change of
1161@sc{cdr}s. For example:
1162
1163@example
1164@group
1165(setq nums '(1 3 2 6 5 4 0))
1166 @result{} (1 3 2 6 5 4 0)
1167@end group
1168@group
1169(sort nums '<)
1170 @result{} (0 1 2 3 4 5 6)
1171@end group
1172@group
1173nums
1174 @result{} (1 2 3 4 5 6)
1175@end group
1176@end example
1177
1178@noindent
1179@strong{Warning}: Note that the list in @code{nums} no longer contains
11800; this is the same cons cell that it was before, but it is no longer
1181the first one in the list. Don't assume a variable that formerly held
1182the argument now holds the entire sorted list! Instead, save the result
1183of @code{sort} and use that. Most often we store the result back into
1184the variable that held the original list:
1185
1186@example
1187(setq nums (sort nums '<))
1188@end example
1189
1190@xref{Sorting}, for more functions that perform sorting.
1191See @code{documentation} in @ref{Accessing Documentation}, for a
1192useful example of @code{sort}.
1193@end defun
1194
1195@node Sets And Lists 1127@node Sets And Lists
1196@section Using Lists as Sets 1128@section Using Lists as Sets
1197@cindex lists as sets 1129@cindex lists as sets
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index e23e2685a7c..d67bac63b15 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -2221,13 +2221,10 @@ is the same as for @code{mode-line-format} (@pxref{Mode Line Data}).
2221It is normally @code{nil}, so that ordinary buffers have no header line. 2221It is normally @code{nil}, so that ordinary buffers have no header line.
2222@end defvar 2222@end defvar
2223 2223
2224The function @code{window-header-line-height} returns the height of
2225the header line:
2226
2227@defun window-header-line-height &optional window 2224@defun window-header-line-height &optional window
2228Return the height of @var{window}'s header line, in pixels. 2225This function returns the height in pixels of @var{window}'s header
2229@var{window} must be a live window. If @var{window} is @code{nil} or 2226line. @var{window} must be a live window, and defaults to the
2230omitted, it will be the selected window. 2227selected window.
2231@end defun 2228@end defun
2232 2229
2233 A window that is just one line tall never displays a header line. A 2230 A window that is just one line tall never displays a header line. A
diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi
index 8f17862d427..d3a6792c1ba 100644
--- a/doc/lispref/sequences.texi
+++ b/doc/lispref/sequences.texi
@@ -327,6 +327,98 @@ encouraged to treat strings as immutable.
327 327
328@end defun 328@end defun
329 329
330@defun sort sequence predicate
331@cindex stable sort
332@cindex sorting lists
333@cindex sorting vectors
334This function sorts @var{sequence} stably. Note that this function doesn't work
335for all sequences; it may be used only for lists and vectors. If @var{sequence}
336is a list, it is modified destructively. This functions returns the sorted
337@var{sequence} and compares elements using @var{predicate}. A stable sort is
338one in which elements with equal sort keys maintain their relative order before
339and after the sort. Stability is important when successive sorts are used to
340order elements according to different criteria.
341
342The argument @var{predicate} must be a function that accepts two
343arguments. It is called with two elements of @var{sequence}. To get an
344increasing order sort, the @var{predicate} should return non-@code{nil} if the
345first element is ``less than'' the second, or @code{nil} if not.
346
347The comparison function @var{predicate} must give reliable results for
348any given pair of arguments, at least within a single call to
349@code{sort}. It must be @dfn{antisymmetric}; that is, if @var{a} is
350less than @var{b}, @var{b} must not be less than @var{a}. It must be
351@dfn{transitive}---that is, if @var{a} is less than @var{b}, and @var{b}
352is less than @var{c}, then @var{a} must be less than @var{c}. If you
353use a comparison function which does not meet these requirements, the
354result of @code{sort} is unpredictable.
355
356The destructive aspect of @code{sort} for lists is that it rearranges the
357cons cells forming @var{sequence} by changing @sc{cdr}s. A nondestructive
358sort function would create new cons cells to store the elements in their
359sorted order. If you wish to make a sorted copy without destroying the
360original, copy it first with @code{copy-sequence} and then sort.
361
362Sorting does not change the @sc{car}s of the cons cells in @var{sequence};
363the cons cell that originally contained the element @code{a} in
364@var{sequence} still has @code{a} in its @sc{car} after sorting, but it now
365appears in a different position in the list due to the change of
366@sc{cdr}s. For example:
367
368@example
369@group
370(setq nums '(1 3 2 6 5 4 0))
371 @result{} (1 3 2 6 5 4 0)
372@end group
373@group
374(sort nums '<)
375 @result{} (0 1 2 3 4 5 6)
376@end group
377@group
378nums
379 @result{} (1 2 3 4 5 6)
380@end group
381@end example
382
383@noindent
384@strong{Warning}: Note that the list in @code{nums} no longer contains
3850; this is the same cons cell that it was before, but it is no longer
386the first one in the list. Don't assume a variable that formerly held
387the argument now holds the entire sorted list! Instead, save the result
388of @code{sort} and use that. Most often we store the result back into
389the variable that held the original list:
390
391@example
392(setq nums (sort nums '<))
393@end example
394
395For the better understanding of what stable sort is, consider the following
396vector example. After sorting, all items whose @code{car} is 8 are grouped
397at the beginning of @code{vector}, but their relative order is preserved.
398All items whose @code{car} is 9 are grouped at the end of @code{vector},
399but their relative order is also preserved:
400
401@example
402@group
403(setq
404 vector
405 (vector '(8 . "xxx") '(9 . "aaa") '(8 . "bbb") '(9 . "zzz")
406 '(9 . "ppp") '(8 . "ttt") '(8 . "eee") '(9 . "fff")))
407 @result{} [(8 . "xxx") (9 . "aaa") (8 . "bbb") (9 . "zzz")
408 (9 . "ppp") (8 . "ttt") (8 . "eee") (9 . "fff")]
409@end group
410@group
411(sort vector (lambda (x y) (< (car x) (car y))))
412 @result{} [(8 . "xxx") (8 . "bbb") (8 . "ttt") (8 . "eee")
413 (9 . "aaa") (9 . "zzz") (9 . "ppp") (9 . "fff")]
414@end group
415@end example
416
417@xref{Sorting}, for more functions that perform sorting.
418See @code{documentation} in @ref{Accessing Documentation}, for a
419useful example of @code{sort}.
420@end defun
421
330@node Arrays 422@node Arrays
331@section Arrays 423@section Arrays
332@cindex array 424@cindex array
diff --git a/doc/lispref/streams.texi b/doc/lispref/streams.texi
index 1d549ae8916..c287b617713 100644
--- a/doc/lispref/streams.texi
+++ b/doc/lispref/streams.texi
@@ -615,10 +615,13 @@ spacing between calls.
615@end example 615@end example
616@end defun 616@end defun
617 617
618@defun terpri &optional stream 618@defun terpri &optional stream ensure
619@cindex newline in print 619@cindex newline in print
620This function outputs a newline to @var{stream}. The name stands 620This function outputs a newline to @var{stream}. The name stands for
621for ``terminate print''. 621``terminate print''. If @var{ensure} is non-nil no newline is printed
622if @var{stream} is already at the beginning of a line. Note in this
623case @var{stream} can not be a function and an error is signalled if
624it is. This function returns @code{t} if a newline is printed.
622@end defun 625@end defun
623 626
624@defun write-char character &optional stream 627@defun write-char character &optional stream
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi
index e6b00f06f79..5e0148b75a9 100644
--- a/doc/lispref/strings.texi
+++ b/doc/lispref/strings.texi
@@ -458,6 +458,59 @@ Representations}.
458@code{string-equal} is another name for @code{string=}. 458@code{string-equal} is another name for @code{string=}.
459@end defun 459@end defun
460 460
461@defun string-collate-equalp string1 string2 &optional locale ignore-case
462This function returns @code{t} if @var{string1} and @var{string2} are
463equal with respect to collation rules. A collation rule is not only
464determined by the lexicographic order of the characters contained in
465@var{string1} and @var{string2}, but also further rules about
466relations between these characters. Usually, it is defined by the
467@var{locale} environment Emacs is running with.
468
469For example, characters with different coding points but
470the same meaning might be considered as equal, like different grave
471accent Unicode characters:
472
473@example
474@group
475(string-collate-equalp (string ?\uFF40) (string ?\u1FEF))
476 @result{} t
477@end group
478@end example
479
480The optional argument @var{locale}, a string, overrides the setting of
481your current locale identifier for collation. The value is system
482dependent; a @var{locale} "en_US.UTF-8" is applicable on POSIX
483systems, while it would be, e.g., "enu_USA.1252" on MS-Windows
484systems.
485
486If @var{IGNORE-CASE} is non-nil, characters are converted to lower-case
487before comparing them.
488
489To emulate Unicode-compliant collation on MS-Windows systems,
490bind @code{w32-collate-ignore-punctuation} to a non-nil value, since
491the codeset part of the locale cannot be "UTF-8" on MS-Windows.
492
493If your system does not support a locale environment, this function
494behaves like @code{string-equal}.
495
496Do NOT use this function to compare file names for equality, only
497for sorting them.
498@end defun
499
500@defun string-prefix-p string1 string2 &optional ignore-case
501This function returns non-@code{nil} if @var{string1} is a prefix of
502@var{string2}; i.e., if @var{string2} starts with @var{string1}. If
503the optional argument @var{ignore-case} is non-@code{nil}, the
504comparison ignores case differences.
505@end defun
506
507@defun string-suffix-p suffix string &optional ignore-case
508This function returns non-@code{nil} if @var{suffix} is a suffix of
509@var{string}; i.e., if @var{string} ends with @var{suffix}. If the
510optional argument @var{ignore-case} is non-@code{nil}, the comparison
511ignores case differences.
512@end defun
513
461@cindex lexical comparison 514@cindex lexical comparison
462@defun string< string1 string2 515@defun string< string1 string2
463@c (findex string< causes problems for permuted index!!) 516@c (findex string< causes problems for permuted index!!)
@@ -516,6 +569,50 @@ are used.
516@code{string-lessp} is another name for @code{string<}. 569@code{string-lessp} is another name for @code{string<}.
517@end defun 570@end defun
518 571
572@defun string-collate-lessp string1 string2 &optional locale ignore-case
573This function returns @code{t} if @var{string1} is less than
574@var{string2} in collation order. A collation order is not only
575determined by the lexicographic order of the characters contained in
576@var{string1} and @var{string2}, but also further rules about
577relations between these characters. Usually, it is defined by the
578@var{locale} environment Emacs is running with.
579
580For example, punctuation and whitespace characters might be considered
581less significant for @ref{Sorting,,sorting}.
582
583@example
584@group
585(sort '("11" "12" "1 1" "1 2" "1.1" "1.2") 'string-collate-lessp)
586 @result{} ("11" "1 1" "1.1" "12" "1 2" "1.2")
587@end group
588@end example
589
590The optional argument @var{locale}, a string, overrides the setting of
591your current locale identifier for collation. The value is system
592dependent; a @var{locale} "en_US.UTF-8" is applicable on POSIX
593systems, while it would be, e.g., "enu_USA.1252" on MS-Windows
594systems. The @var{locale} "POSIX" lets @code{string-collate-lessp}
595behave like @code{string-lessp}:
596
597@example
598@group
599(sort '("11" "12" "1 1" "1 2" "1.1" "1.2")
600 (lambda (s1 s2) (string-collate-lessp s1 s2 "POSIX")))
601 @result{} ("1 1" "1 2" "1.1" "1.2" "11" "12")
602@end group
603@end example
604
605If @var{IGNORE-CASE} is non-nil, characters are converted to lower-case
606before comparing them.
607
608To emulate Unicode-compliant collation on MS-Windows systems,
609bind @code{w32-collate-ignore-punctuation} to a non-nil value, since
610the codeset part of the locale cannot be "UTF-8" on MS-Windows.
611
612If your system does not support a locale environment, this function
613behaves like @code{string-lessp}.
614@end defun
615
519@defun string-prefix-p string1 string2 &optional ignore-case 616@defun string-prefix-p string1 string2 &optional ignore-case
520This function returns non-@code{nil} if @var{string1} is a prefix of 617This function returns non-@code{nil} if @var{string1} is a prefix of
521@var{string2}; i.e., if @var{string2} starts with @var{string1}. If 618@var{string2}; i.e., if @var{string2} starts with @var{string1}. If
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index 6665cc3e673..f21d2b76656 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -4114,8 +4114,9 @@ buffer.
4114Normally, this command puts point before the inserted text, and the 4114Normally, this command puts point before the inserted text, and the
4115mark after it. However, if the optional second argument @var{beforep} 4115mark after it. However, if the optional second argument @var{beforep}
4116is non-@code{nil}, it puts the mark before and point after. 4116is non-@code{nil}, it puts the mark before and point after.
4117You can pass a non-@code{nil} second argument @var{beforep} to this 4117
4118function interactively by supplying any prefix argument. 4118When called interactively, the command defaults to putting point after
4119text, and a prefix argument inverts this behavior.
4119 4120
4120If the register contains a rectangle, then the rectangle is inserted 4121If the register contains a rectangle, then the rectangle is inserted
4121with its upper left corner at point. This means that text is inserted 4122with its upper left corner at point. This means that text is inserted
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index f2fe5c85a93..5060fef804f 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -394,13 +394,14 @@ internal window). The @var{edges} element is a list @code{(@var{left}
394@group 394@group
395 ____________________________________________ 395 ____________________________________________
396 |______________ Header Line ______________|RD| ^ 396 |______________ Header Line ______________|RD| ^
397 ^ |LS|LF|LM| |RM|RF|RS| | | 397 ^ |LS|LM|LF| |RF|RM|RS| | |
398 | | | | | | | | | | | 398 | | | | | | | | | | |
399Window | | | | Text Area | | | | | Window 399Window | | | | Text Area | | | | | Window
400Body | | | | | (Window Body) | | | | | Total 400Body | | | | | (Window Body) | | | | | Total
401Height | | | | | | | | | Height 401Height | | | | | | | | | Height
402 | | | | |<- Window Body Width ->| | | | | | 402 | | | | |<- Window Body Width ->| | | | | |
403 v |__|__|__|_______________________|__|__|__| | | 403 v |__|__|__|_______________________|__|__|__| | |
404 |_________ Horizontal Scroll Bar _________| | |
404 |_______________ Mode Line _______________|__| | 405 |_______________ Mode Line _______________|__| |
405 |_____________ Bottom Divider _______________| v 406 |_____________ Bottom Divider _______________| v
406 <---------- Window Total Width ------------> 407 <---------- Window Total Width ------------>
@@ -414,15 +415,15 @@ Height | | | | | | | | | Height
414 At the center of the window is the @dfn{text area}, or @dfn{body}, 415 At the center of the window is the @dfn{text area}, or @dfn{body},
415where the buffer text is displayed. The text area can be surrounded by 416where the buffer text is displayed. The text area can be surrounded by
416a series of optional areas. On the left and right, from innermost to 417a series of optional areas. On the left and right, from innermost to
417outermost, these are the left and right margins, denoted by LM and RM in 418outermost, these are the left and right fringes, denoted by LF and RF
418the schematic (@pxref{Display Margins}); the left and right fringes, 419(@pxref{Fringes}); the left and right margins, denoted by LM and RM in
419denoted by LF and RF (@pxref{Fringes}); the left or right scroll bar, 420the schematic (@pxref{Display Margins}); the left or right vertical
420only one of which is present at any time, denoted by LS and RS 421scroll bar, only one of which is present at any time, denoted by LS and
421(@pxref{Scroll Bars}); and the right divider, denoted by RD 422RS (@pxref{Scroll Bars}); and the right divider, denoted by RD
422(@pxref{Window Dividers}). At the top of the window is the header line 423(@pxref{Window Dividers}). At the top of the window is the header line
423(@pxref{Header Lines}); at the bottom of the window is the mode line 424(@pxref{Header Lines}). At the bottom of the window are the horizontal
424(@pxref{Mode Line Format}) followed by the bottom divider (@pxref{Window 425scroll bar (@pxref{Scroll Bars}); the mode line (@pxref{Mode Line
425Dividers}). 426Format}); and the bottom divider (@pxref{Window Dividers}).
426 427
427 Emacs provides miscellaneous functions for finding the height and 428 Emacs provides miscellaneous functions for finding the height and
428width of a window. The return value of many of these functions can be 429width of a window. The return value of many of these functions can be
@@ -439,11 +440,8 @@ displayed within it.
439@cindex height of a window 440@cindex height of a window
440@cindex total height of a window 441@cindex total height of a window
441 The @dfn{total height} of a window is the number of lines comprising 442 The @dfn{total height} of a window is the number of lines comprising
442the window's body, the header line, the mode line and the bottom divider 443the window's body, the header line, the horizontal scroll bar, the mode
443(if any). Note that the height of a frame is not the same as the height 444line and the bottom divider (if any).
444of its root window (@pxref{Windows and Frames}), since a frame may also
445contain an echo area, a menu bar, and a tool bar (@pxref{Size and
446Position}).
447 445
448@defun window-total-height &optional window round 446@defun window-total-height &optional window round
449This function returns the total height, in lines, of the window 447This function returns the total height, in lines, of the window
@@ -451,24 +449,23 @@ This function returns the total height, in lines, of the window
451the selected window. If @var{window} is an internal window, the return 449the selected window. If @var{window} is an internal window, the return
452value is the total height occupied by its descendant windows. 450value is the total height occupied by its descendant windows.
453 451
454 If a window's pixel height is not an integral multiple of its frame's 452 If a window's pixel height is not an integral multiple of its frame's
455default character height, the number of lines occupied by the window is 453default character height, the number of lines occupied by the window is
456rounded internally. This is done in a way such that, if the window is a 454rounded internally. This is done in a way such that, if the window is a
457parent window, the sum of the total heights of all its child windows 455parent window, the sum of the total heights of all its child windows
458internally equals the total height of their parent. This means that 456internally equals the total height of their parent. This means that
459although two windows have the same pixel height, their internal total 457although two windows have the same pixel height, their internal total
460heights may differ by one line. This means also, that if this window is 458heights may differ by one line. This means also, that if window is
461vertically combined and has a right sibling, the topmost row of that 459vertically combined and has a next sibling, the topmost row of that
462sibling can be calculated as the sum of this window's topmost row and 460sibling can be calculated as the sum of this window's topmost row and
463total height (@pxref{Coordinates and Windows}) 461total height (@pxref{Coordinates and Windows})
464 462
465 If the optional argument @var{round} equals @code{ceiling}, this 463 If the optional argument @var{round} is @code{ceiling}, this
466function returns the smallest integer larger than @var{window}'s pixel 464function returns the smallest integer larger than @var{window}'s pixel
467height divided by the character height of @var{window}'s frame; if it is 465height divided by the character height of its frame; if it is
468@code{floor}, it returns the largest integer smaller than @var{window}'s 466@code{floor}, it returns the largest integer smaller than said value;
469pixel height divided by the character height of @var{window}'s frame. 467with any other @var{round} it returns the internal value of
470Any other value of @var{round} means to return the internal value of the 468@var{windows}'s total height.
471total height of @var{window}.
472@end defun 469@end defun
473 470
474@cindex window width 471@cindex window width
@@ -484,24 +481,17 @@ This function returns the total width, in columns, of the window
484the selected window. If @var{window} is internal, the return value is 481the selected window. If @var{window} is internal, the return value is
485the total width occupied by its descendant windows. 482the total width occupied by its descendant windows.
486 483
487 If a window's pixel width is not an integral multiple of its frame's 484 If a window's pixel width is not an integral multiple of its frame's
488character width, the number of lines occupied by the window is rounded 485character width, the number of lines occupied by the window is rounded
489internally. This is done in a way such that, if the window is a parent 486internally. This is done in a way such that, if the window is a parent
490window, the sum of the total widths of all its children internally 487window, the sum of the total widths of all its children internally
491equals the total width of their parent. This means that although two 488equals the total width of their parent. This means that although two
492windows have the same pixel width, their internal total widths may 489windows have the same pixel width, their internal total widths may
493differ by one column. This means also, that if this window is 490differ by one column. This means also, that if this window is
494horizontally combined and has a right sibling, the leftmost column of 491horizontally combined and has a next sibling, the leftmost column of
495that sibling can be calculated as the sum of this window's leftmost 492that sibling can be calculated as the sum of this window's leftmost
496column and total width (@pxref{Coordinates and Windows}). 493column and total width (@pxref{Coordinates and Windows}). The optional
497 494argument @var{round} behaves as it does for @code{window-total-height}.
498If the optional argument @var{round} is @code{ceiling}, this function
499will return the smallest integer larger than @var{window}'s pixel width
500divided by the character width of @var{window}'s frame; if it is
501@code{floor}, it returns the largest integer smaller than @var{window}'s
502pixel width divided by the character width of @var{window}'s frame. Any
503other value of @var{round} means to return the internal total width of
504@var{window}.
505@end defun 495@end defun
506 496
507@defun window-total-size &optional window horizontal round 497@defun window-total-size &optional window horizontal round
@@ -510,8 +500,7 @@ width in columns of the window @var{window}. If @var{horizontal} is
510omitted or @code{nil}, this is equivalent to calling 500omitted or @code{nil}, this is equivalent to calling
511@code{window-total-height} for @var{window}; otherwise it is equivalent 501@code{window-total-height} for @var{window}; otherwise it is equivalent
512to calling @code{window-total-width} for @var{window}. The optional 502to calling @code{window-total-width} for @var{window}. The optional
513argument @code{ROUND} is handled as for @code{window-total-height} and 503argument @var{round} behaves as it does for @code{window-total-height}.
514@code{window-total-width}.
515@end defun 504@end defun
516 505
517The following two functions can be used to return the total size of a 506The following two functions can be used to return the total size of a
@@ -525,9 +514,10 @@ window in units of pixels.
525This function returns the total height of window @var{window} in pixels. 514This function returns the total height of window @var{window} in pixels.
526@var{window} must be a valid window and defaults to the selected one. 515@var{window} must be a valid window and defaults to the selected one.
527 516
528The return value includes mode and header line and a bottom divider, if 517The return value includes mode and header line, a horizontal scroll bar
529any. If @var{window} is an internal window, its pixel height is the 518and a bottom divider, if any. If @var{window} is an internal window,
530pixel height of the screen areas spanned by its children. 519its pixel height is the pixel height of the screen areas spanned by its
520children.
531@end defun 521@end defun
532 522
533@cindex window pixel height 523@cindex window pixel height
@@ -550,10 +540,12 @@ the screen areas spanned by its children.
550window has any adjacent windows. 540window has any adjacent windows.
551 541
552@defun window-full-height-p &optional window 542@defun window-full-height-p &optional window
553This function returns non-@code{nil} if @var{window} has no other 543This function returns non-@code{nil} if @var{window} has no other window
554window above or below it in its frame, i.e., its total height equals 544above or below it in its frame. More precisely, this means that the
555the total height of the root window on that frame. If @var{window} is 545total height of @var{window} equals the total height of the root window
556omitted or @code{nil}, it defaults to the selected window. 546on that frame. The minibuffer window does not count in this regard. If
547@var{window} is omitted or @code{nil}, it defaults to the selected
548window.
557@end defun 549@end defun
558 550
559@defun window-full-width-p &optional window 551@defun window-full-width-p &optional window
@@ -567,7 +559,8 @@ that of the root window on that frame. If @var{window} is omitted or
567@cindex body height of a window 559@cindex body height of a window
568@cindex window body width 560@cindex window body width
569The @dfn{body height} of a window is the height of its text area, which 561The @dfn{body height} of a window is the height of its text area, which
570does not include a mode or header line or a bottom divider. 562does not include a mode or header line, a horizontal scroll bar, or a
563bottom divider.
571 564
572@defun window-body-height &optional window pixelwise 565@defun window-body-height &optional window pixelwise
573This function returns the height, in lines, of the body of window 566This function returns the height, in lines, of the body of window
@@ -654,7 +647,8 @@ size:
654@defopt window-min-height 647@defopt window-min-height
655This option specifies the minimum total height, in lines, of any window. 648This option specifies the minimum total height, in lines, of any window.
656Its value has to accommodate at least one text line as well as a mode 649Its value has to accommodate at least one text line as well as a mode
657and header line and a bottom divider, if present. 650and header line, a horizontal scroll bar and a bottom divider, if
651present.
658@end defopt 652@end defopt
659 653
660@defopt window-min-width 654@defopt window-min-width
@@ -693,10 +687,11 @@ of @var{window}'s lines.
693 687
694The return value makes sure that all components of @var{window} remain 688The return value makes sure that all components of @var{window} remain
695fully visible if @var{window}'s size were actually set to it. With 689fully visible if @var{window}'s size were actually set to it. With
696@var{horizontal} @code{nil} it includes the mode and header line and the 690@var{horizontal} @code{nil} it includes the mode and header line, the
697bottom divider. With @var{horizontal} non-@code{nil} it includes the 691horizontal scroll bar and the bottom divider. With @var{horizontal}
698fringes, a scroll bar, and a right divider, if present. It does not, 692non-@code{nil} it includes the fringes, a scroll bar, and a right
699however, include the space reserved for the margins. 693divider, if present. It does not, however, include the space reserved
694for the margins.
700 695
701The optional argument @var{ignore}, if non-@code{nil}, means ignore 696The optional argument @var{ignore}, if non-@code{nil}, means ignore
702restrictions imposed by fixed size windows, @code{window-min-height} or 697restrictions imposed by fixed size windows, @code{window-min-height} or
@@ -748,14 +743,14 @@ Normally, the variables @code{window-min-height} and
748(@pxref{Window Sizes}). However, if the optional argument @var{ignore} 743(@pxref{Window Sizes}). However, if the optional argument @var{ignore}
749is non-@code{nil}, this function ignores @code{window-min-height} and 744is non-@code{nil}, this function ignores @code{window-min-height} and
750@code{window-min-width}, as well as @code{window-size-fixed}. Instead, 745@code{window-min-width}, as well as @code{window-size-fixed}. Instead,
751it considers the minimum-height window to be one consisting of a header, 746it considers the minimum-height window to be one consisting of a header
752a mode line and a bottom divider (if any), plus a text area one line 747and a mode line, a horizontal scrollbar and a bottom divider (if any),
753tall; and a minimum-width window as one consisting of fringes, margins, 748plus a text area one line tall; and a minimum-width window as one
754a scroll bar and a right divider (if any), plus a text area two columns 749consisting of fringes, margins, a scroll bar and a right divider (if
755wide. 750any), plus a text area two columns wide.
756 751
757If the optional argument @code{pixelwise} is non-@code{nil}, 752If the optional argument @var{pixelwise} is non-@code{nil},
758@var{delta} will be interpreted as pixels. 753@var{delta} is interpreted as pixels.
759@end defun 754@end defun
760 755
761@defun window-resize window delta &optional horizontal ignore pixelwise 756@defun window-resize window delta &optional horizontal ignore pixelwise
@@ -779,7 +774,7 @@ values of the option @code{window-combination-resize} and the
779combination limits of the involved windows; in some cases, it may alter 774combination limits of the involved windows; in some cases, it may alter
780both edges. @xref{Recombining Windows}. To resize by moving only the 775both edges. @xref{Recombining Windows}. To resize by moving only the
781bottom or right edge of a window, use the function 776bottom or right edge of a window, use the function
782@code{adjust-window-trailing-edge}, below. 777@code{adjust-window-trailing-edge}.
783@end defun 778@end defun
784 779
785@c The commands enlarge-window, enlarge-window-horizontally, 780@c The commands enlarge-window, enlarge-window-horizontally,
@@ -792,8 +787,8 @@ If optional argument @var{horizontal} is non-@code{nil}, it instead
792moves the right edge by @var{delta} columns. If @var{window} is 787moves the right edge by @var{delta} columns. If @var{window} is
793@code{nil}, it defaults to the selected window. 788@code{nil}, it defaults to the selected window.
794 789
795If the optional argument @code{pixelwise} is non-@code{nil}, 790If the optional argument @var{pixelwise} is non-@code{nil},
796@var{delta} will be interpreted as pixels. 791@var{delta} is interpreted as pixels.
797 792
798A positive @var{delta} moves the edge downwards or to the right; a 793A positive @var{delta} moves the edge downwards or to the right; a
799negative @var{delta} moves it upwards or to the left. If the edge 794negative @var{delta} moves it upwards or to the left. If the edge
@@ -807,17 +802,16 @@ window is fixed-size), it may resize other windows.
807 802
808@cindex pixelwise, resizing windows 803@cindex pixelwise, resizing windows
809@defopt window-resize-pixelwise 804@defopt window-resize-pixelwise
810If the value of this option is non-@code{nil}, windows are resized in 805If the value of this option is non-@code{nil}, Emacs resizes windows in
811units of pixels. This currently affects functions like 806units of pixels. This currently affects functions like
812@code{split-window} (@pxref{Splitting Windows}), @code{maximize-window}, 807@code{split-window} (@pxref{Splitting Windows}), @code{maximize-window},
813@code{minimize-window}, @code{fit-window-to-buffer}, 808@code{minimize-window}, @code{fit-window-to-buffer},
814@code{shrink-window-if-larger-than-buffer} (all listed below) and 809@code{shrink-window-if-larger-than-buffer} (all listed below) and
815@code{fit-frame-to-buffer} (@pxref{Size and Position}). 810@code{fit-frame-to-buffer} (@pxref{Size and Position}).
816 811
817Note that when a frame's pixel size is not a multiple of the frame's 812Note that when a frame's pixel size is not a multiple of its character
818character size, at least one window may get resized pixelwise even if 813size, at least one window may get resized pixelwise even if this
819this option is @code{nil}. The default value of this option is 814option is @code{nil}. The default value is @code{nil}.
820@code{nil}.
821@end defopt 815@end defopt
822 816
823 The following commands resize windows in more specific ways. When 817 The following commands resize windows in more specific ways. When