diff options
| author | Eli Zaretskii | 2014-10-14 21:10:37 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2014-10-14 21:10:37 +0300 |
| commit | e3060a0c4d2f418ac786775109d71e5843ccf42e (patch) | |
| tree | 347b37fc39d0db9cd23b3e9f79ee81b4bbc40f08 /doc/lispref | |
| parent | 1a3eca0656bdb764200e10a4f264138e94b1f3ce (diff) | |
| parent | 980d78b3587560c13a46aef352ed8d5ed744acf6 (diff) | |
| download | emacs-e3060a0c4d2f418ac786775109d71e5843ccf42e.tar.gz emacs-e3060a0c4d2f418ac786775109d71e5843ccf42e.zip | |
Merge from trunk and resolve conflicts.
Diffstat (limited to 'doc/lispref')
| -rw-r--r-- | doc/lispref/ChangeLog | 123 | ||||
| -rw-r--r-- | doc/lispref/Makefile.in | 15 | ||||
| -rw-r--r-- | doc/lispref/buffers.texi | 2 | ||||
| -rw-r--r-- | doc/lispref/commands.texi | 35 | ||||
| -rw-r--r-- | doc/lispref/control.texi | 18 | ||||
| -rw-r--r-- | doc/lispref/display.texi | 200 | ||||
| -rw-r--r-- | doc/lispref/elisp.texi | 4 | ||||
| -rw-r--r-- | doc/lispref/eval.texi | 7 | ||||
| -rw-r--r-- | doc/lispref/frames.texi | 171 | ||||
| -rw-r--r-- | doc/lispref/functions.texi | 26 | ||||
| -rw-r--r-- | doc/lispref/internals.texi | 43 | ||||
| -rw-r--r-- | doc/lispref/lists.texi | 68 | ||||
| -rw-r--r-- | doc/lispref/modes.texi | 9 | ||||
| -rw-r--r-- | doc/lispref/sequences.texi | 92 | ||||
| -rw-r--r-- | doc/lispref/streams.texi | 9 | ||||
| -rw-r--r-- | doc/lispref/strings.texi | 97 | ||||
| -rw-r--r-- | doc/lispref/text.texi | 5 | ||||
| -rw-r--r-- | doc/lispref/windows.texi | 122 |
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 @@ | |||
| 1 | 2014-10-13 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * Makefile.in (dist): Update for new output variables. | ||
| 4 | |||
| 5 | 2014-10-12 Glenn Morris <rgm@gnu.org> | ||
| 6 | |||
| 7 | * elisp.texi (DATE): Bump to October 2014. | ||
| 8 | |||
| 9 | 2014-10-09 Glenn Morris <rgm@gnu.org> | ||
| 10 | |||
| 11 | * frames.texi (Multiple Terminals): Copyedits. | ||
| 12 | |||
| 13 | 2014-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 | |||
| 26 | 2014-10-08 Leo Liu <sdl.web@gmail.com> | ||
| 27 | |||
| 28 | * streams.texi (Output Functions): Document new argument ENSURE to | ||
| 29 | terpri. (Bug#18652) | ||
| 30 | |||
| 31 | 2014-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 | |||
| 42 | 2014-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 | |||
| 57 | 2014-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 | |||
| 63 | 2014-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 | |||
| 74 | 2014-09-30 Paul Eggert <eggert@cs.ucla.edu> | ||
| 75 | |||
| 76 | * internals.texi (Stack-allocated Objects): Further improvements. | ||
| 77 | Give an example of misuse. | ||
| 78 | |||
| 79 | 2014-09-30 Eli Zaretskii <eliz@gnu.org> | ||
| 80 | |||
| 81 | * internals.texi (Stack-allocated Objects): Minor improvements of | ||
| 82 | the wording and the indexing. | ||
| 83 | |||
| 84 | 2014-09-30 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 85 | |||
| 86 | * internals.texi (Stack-allocated Objects): Describe this feature. | ||
| 87 | |||
| 88 | 2014-09-15 Daniel Colascione <dancol@dancol.org> | ||
| 89 | |||
| 90 | * text.texi (Registers): Make `insert-register' documentation | ||
| 91 | reflect interface change. | ||
| 92 | |||
| 93 | 2014-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 | |||
| 98 | 2014-09-07 Michael Albinus <michael.albinus@gmx.de> | ||
| 99 | |||
| 100 | * strings.texi (Text Comparison): Describe `string-collate-equalp' | ||
| 101 | and `string-collate-lessp'. | ||
| 102 | |||
| 103 | 2014-09-06 Leo Liu <sdl.web@gmail.com> | ||
| 104 | |||
| 105 | * control.texi (Pattern matching case statement): Document vector | ||
| 106 | qpattern. (Bug#18327) | ||
| 107 | |||
| 108 | 2014-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 | |||
| 115 | 2014-08-28 Eli Zaretskii <eliz@gnu.org> | ||
| 116 | |||
| 117 | * display.texi (Bidirectional Display): Update the Emacs's class | ||
| 118 | of bidirectional conformance. | ||
| 119 | |||
| 120 | 2014-08-27 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 121 | |||
| 122 | * eval.texi (Eval): Mention possible recovery from stack overflow. | ||
| 123 | |||
| 1 | 2014-10-13 Eli Zaretskii <eliz@gnu.org> | 124 | 2014-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 |
| 865 | This function returns the last buffer in @var{frame}'s buffer list other | 865 | This function returns the last buffer in @var{frame}'s buffer list other |
| 866 | than @var{BUFFER}. If @var{frame} is omitted or @code{nil}, it uses the | 866 | than @var{buffer}. If @var{frame} is omitted or @code{nil}, it uses the |
| 867 | selected frame's buffer list. | 867 | selected frame's buffer list. |
| 868 | 868 | ||
| 869 | The argument @var{visible-ok} is handled as with @code{other-buffer}, | 869 | The 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 | ||
| 591 | The macro @code{define-alternatives} can be used to define | 591 | The 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 |
| 593 | whose implementation can be selected among several alternatives, as a | 593 | implementation can be selected from several alternatives, as a matter |
| 594 | matter of user preference. | 594 | of user preference. |
| 595 | 595 | ||
| 596 | @defmac define-alternatives command &rest customizations | 596 | @defmac define-alternatives command &rest customizations |
| 597 | Define the new command `COMMAND'. | 597 | Define the new command @var{command}, a symbol. |
| 598 | 598 | ||
| 599 | The argument `COMMAND' should be a symbol. | 599 | When a user runs @kbd{M-x @var{command} @key{RET}} for the first time, |
| 600 | Emacs prompts for which real form of the command to use, and records | ||
| 601 | the selection by way of a custom variable. Using a prefix argument | ||
| 602 | repeats this process of choosing an alternative. | ||
| 600 | 603 | ||
| 601 | When a user runs @kbd{M-x COMMAND @key{RET}} for the first time, Emacs | 604 | The variable @code{@var{command}-alternatives} should contain an alist |
| 602 | will prompt for which alternative to use and record the selected | 605 | with alternative implementations of @var{command}. |
| 603 | command as a custom variable. | 606 | Until this variable is set, @code{define-alternatives} has no effect. |
| 604 | 607 | ||
| 605 | Running @kbd{C-u M-x COMMAND @key{RET}} prompts again for an | 608 | If @var{customizations} is non-@code{nil}, it should consist of |
| 606 | alternative and overwrites the previous choice. | 609 | alternating @code{defcustom} keywords (typically @code{:group} and |
| 607 | 610 | @code{:version}) and values to add to the declaration of | |
| 608 | The 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 | ||
| 611 | this variable is set. | ||
| 612 | |||
| 613 | If @var{customizations} is non-@var{nil}, it should be composed of | ||
| 614 | alternating @code{defcustom} keywords and values to add to the | ||
| 615 | declaration 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 | ||
| 340 | Where @code{`(add ,x ,y)} is a pattern that checks that @code{exp} is a three | 340 | Where @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}) |
| 371 | This pattern matches any cons cell whose @code{car} matches @var{QPATTERN1} and | 371 | This pattern matches any cons cell whose @code{car} matches @var{QPATTERN1} and |
| 372 | whose @code{cdr} matches @var{PATTERN2}. | 372 | whose @code{cdr} matches @var{PATTERN2}. |
| 373 | @item [@var{qpattern1 qpattern2..qpatternm}] | ||
| 374 | This pattern matches a vector of length @code{M} whose 0..(M-1)th | ||
| 375 | elements match @var{QPATTERN1}, @var{QPATTERN2}..@var{QPATTERNm}, | ||
| 376 | respectively. | ||
| 373 | @item @var{atom} | 377 | @item @var{atom} |
| 374 | This pattern matches any atom @code{equal} to @var{atom}. | 378 | This 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 |
| 3867 | is used. | 3867 | is 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 | ||
| 3873 | Normally the frame parameter @code{vertical-scroll-bars} controls | 3874 | Normally the frame parameter @code{vertical-scroll-bars} controls |
| 3874 | whether the windows in the frame have vertical scroll bars, and | 3875 | whether the windows in the frame have vertical scroll bars, and whether |
| 3875 | whether they are on the left or right. The frame parameter | 3876 | they 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 |
| 3877 | meaning the default). @xref{Layout Parameters}. | 3878 | the default). |
| 3879 | |||
| 3880 | The frame parameter @code{horizontal-scroll-bars} controls whether | ||
| 3881 | the windows in the frame have horizontal scroll bars. The frame | ||
| 3882 | parameter @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 | ||
| 3887 | function @code{horizontal-scroll-bars-available-p} which takes no | ||
| 3888 | argument returns non-@code{nil} if they are available on your system. | ||
| 3889 | |||
| 3890 | The following three functions take as argument a live frame which | ||
| 3891 | defaults to the selected one. | ||
| 3878 | 3892 | ||
| 3879 | @defun frame-current-scroll-bars &optional frame | 3893 | @defun frame-current-scroll-bars &optional frame |
| 3880 | This function reports the scroll bar type settings for frame | 3894 | This function reports the scroll bar types for frame @var{frame}. The |
| 3881 | @var{frame}. The value is a cons cell | 3895 | value 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 | 3898 | bar.) @var{horizontal-type} is either @code{bottom} or @code{nil} |
| 3885 | specify the horizontal scroll bar type, but since they are not | 3899 | (which means no horizontal scroll bar). |
| 3886 | implemented, 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, | ||
| 3891 | by setting the variable @code{vertical-scroll-bar}. This variable | ||
| 3892 | automatically becomes buffer-local when set. The possible values are | ||
| 3893 | @code{left}, @code{right}, @code{t}, which means to use the | ||
| 3894 | frame'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: | 3903 | This function returns the width of vertical scroll bars of @var{frame} |
| 3904 | in 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 |
| 3900 | This function sets the width and type of scroll bars for window | 3908 | This 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 | 3912 | You can override the frame specific settings for individual windows by |
| 3904 | use the width specified for the frame). @var{vertical-type} specifies | 3913 | using the following function: |
| 3905 | whether to have a vertical scroll bar and, if so, where. The possible | ||
| 3906 | values are @code{left}, @code{right} and @code{nil}, just like the | ||
| 3907 | values of the @code{vertical-scroll-bars} frame parameter. | ||
| 3908 | 3914 | ||
| 3909 | The argument @var{horizontal-type} is meant to specify whether and | 3915 | @defun set-window-scroll-bars window &optional width vertical-type height horizontal-type |
| 3910 | where to have horizontal scroll bars, but since they are not | 3916 | This function sets the width and/or height and the types of scroll bars |
| 3911 | implemented, it has no effect. If @var{window} is @code{nil}, the | 3917 | for window @var{window}. |
| 3912 | selected 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, | ||
| 3922 | if 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 | ||
| 3924 | vertical 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. | ||
| 3929 | The possible values are @code{bottom}, @code{t}, which means to use the | ||
| 3930 | frame's default, and @code{nil} for no horizontal scroll bar. | ||
| 3931 | |||
| 3932 | If @var{window} is @code{nil}, the selected window is used. | ||
| 3913 | @end defun | 3933 | @end defun |
| 3914 | 3934 | ||
| 3935 | The following four functions take as argument a live window which | ||
| 3936 | defaults to the selected one. | ||
| 3937 | |||
| 3915 | @defun window-scroll-bars &optional window | 3938 | @defun window-scroll-bars &optional window |
| 3916 | Report the width and type of scroll bars specified for @var{window}. | 3939 | This function returns a list of the form @code{(@var{width} |
| 3917 | If @var{window} is omitted or @code{nil}, the selected window is used. | 3940 | @var{columns} @var{vertical-type} @var{height} @var{lines} |
| 3918 | The 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 | ||
| 3921 | be @code{nil}); @var{cols} is the number of columns that the scroll | ||
| 3922 | bar actually occupies. | ||
| 3923 | 3942 | ||
| 3924 | @var{horizontal-type} is not actually meaningful. | 3943 | The value @var{width} is the value that was specified for the width of |
| 3944 | the vertical scroll bar (which may be @code{nil}); @var{columns} is the | ||
| 3945 | (possibly rounded) number of columns that the vertical scroll bar | ||
| 3946 | actually occupies. | ||
| 3947 | |||
| 3948 | The value @var{height} is the value that was specified for the height of | ||
| 3949 | the horizontal scroll bar (which may be @code{nil}); @var{lines} is the | ||
| 3950 | (possibly rounded) number of lines that the horizontally scroll bar | ||
| 3951 | actually occupies. | ||
| 3952 | @end defun | ||
| 3953 | |||
| 3954 | @defun window-current-scroll-bars &optional window | ||
| 3955 | This function reports the scroll bar type for window @var{window}. The | ||
| 3956 | value is a cons cell @code{(@var{vertical-type} .@: | ||
| 3957 | @var{horizontal-type})}. Unlike @code{window-scroll-bars}, this reports | ||
| 3958 | the 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 |
| 3928 | This function returns the width of @var{window}'s vertical scrollbar, | 3963 | This function returns the width in pixels of @var{window}'s vertical |
| 3929 | in pixels. @var{window} must be a live window. If @var{window} is | 3964 | scrollbar. |
| 3930 | @code{nil} or omitted, it will be the selected window. | 3965 | @end defun |
| 3966 | |||
| 3967 | @defun window-scroll-bar-height &optional window | ||
| 3968 | This function returns the height in pixels of @var{window}'s horizontal | ||
| 3969 | scrollbar. | ||
| 3931 | @end defun | 3970 | @end defun |
| 3932 | 3971 | ||
| 3933 | If you don't specify these values for a window with | 3972 | If 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}, |
| 3936 | displayed control the window's vertical scroll bars. The function | 3975 | @code{scroll-bar-width} and @code{scroll-bar-height} in the buffer being |
| 3976 | displayed 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 |
| 3938 | in a buffer that is already visible in a window, you can make the | 3978 | in a buffer that is already visible in a window, you can make the window |
| 3939 | window take note of the new values by calling @code{set-window-buffer} | 3979 | take note of the new values by calling @code{set-window-buffer} |
| 3940 | specifying the same buffer that is already displayed. | 3980 | specifying the same buffer that is already displayed. |
| 3941 | 3981 | ||
| 3942 | @defopt scroll-bar-mode | 3982 | You can control the appearance of scroll bars for a particular buffer by |
| 3943 | This variable, always local in all buffers, controls whether and where | 3983 | setting the following variables which automatically become buffer-local |
| 3944 | to put scroll bars in windows displaying the buffer. The possible values | 3984 | when set. |
| 3945 | are @code{nil} for no scroll bar, @code{left} to put a scroll bar on | ||
| 3946 | the 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 |
| 3950 | This function reports the scroll bar type for window @var{window}. | 3987 | This variable specifies the location of the vertical scroll bar. The |
| 3951 | If @var{window} is omitted or @code{nil}, the selected window is used. | 3988 | possible values are @code{left}, @code{right}, @code{t}, which means to |
| 3952 | The value is a cons cell | 3989 | use 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 | |
| 3955 | used, once frame defaults and @code{scroll-bar-mode} are taken into | 3992 | @defvar horizontal-scroll-bar |
| 3956 | account. | 3993 | This variable specifies the location of the horizontal scroll bar. The |
| 3957 | @end defun | 3994 | possible values are @code{bottom}, @code{t}, which means to use the |
| 3995 | frame's default, and @code{nil} for no scroll bar. | ||
| 3996 | @end defvar | ||
| 3958 | 3997 | ||
| 3959 | @defvar scroll-bar-width | 3998 | @defvar scroll-bar-width |
| 3960 | This variable, always local in all buffers, specifies the width of the | 3999 | This variable specifies the width of the buffer's vertical scroll bars, |
| 3961 | buffer's scroll bars, measured in pixels. A value of @code{nil} means | 4000 | measured in pixels. A value of @code{nil} means to use the value |
| 3962 | to use the value specified by the frame. | 4001 | specified by the frame. |
| 3963 | @end defvar | 4002 | @end defvar |
| 3964 | 4003 | ||
| 4004 | @defvar scroll-bar-height | ||
| 4005 | This variable specifies the height of the buffer's horizontal scroll | ||
| 4006 | bar, measured in pixels. A value of @code{nil} means to use the value | ||
| 4007 | specified by the frame. | ||
| 4008 | @end defvar | ||
| 4009 | |||
| 4010 | Finally you can toggle the display of scroll bars on all frames by | ||
| 4011 | customizing the variables @code{scroll-bar-mode} and | ||
| 4012 | @code{horizontal-scroll-bar-mode}. | ||
| 4013 | |||
| 4014 | @defopt scroll-bar-mode | ||
| 4015 | This variable controls whether and where to put vertical scroll bars in | ||
| 4016 | all 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 | ||
| 4018 | scroll bars on the right. | ||
| 4019 | @end defopt | ||
| 4020 | |||
| 4021 | @defopt horizontal-scroll-bar-mode | ||
| 4022 | This variable controls whether to display horizontal scroll bars on all | ||
| 4023 | frames. | ||
| 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})}, |
| 4505 | where @var{props} is a property list of alternating keyword symbols | 4567 | where @var{props} is a property list of alternating keyword symbols |
| 4506 | and values, including at least the pair @code{:type @var{TYPE}} which | 4568 | and values, including at least the pair @code{:type @var{type}} that |
| 4507 | specifies the image type. | 4569 | specifies 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}. | |||
| 4995 | Each specification in @var{specs} is a property list with contents | 5057 | Each specification in @var{specs} is a property list with contents |
| 4996 | depending on image type. All specifications must at least contain the | 5058 | depending on image type. All specifications must at least contain the |
| 4997 | properties @code{:type @var{type}} and either @w{@code{:file @var{file}}} | 5059 | properties @code{:type @var{type}} and either @w{@code{:file @var{file}}} |
| 4998 | or @w{@code{:data @var{DATA}}}, where @var{type} is a symbol specifying | 5060 | or @w{@code{:data @var{data}}}, where @var{type} is a symbol specifying |
| 4999 | the image type, e.g., @code{xbm}, @var{file} is the file to load the | 5061 | the image type, e.g., @code{xbm}, @var{file} is the file to load the |
| 5000 | image from, and @var{data} is a string containing the actual image data. | 5062 | image from, and @var{data} is a string containing the actual image data. |
| 5001 | The first specification in the list whose @var{type} is supported, and | 5063 | The 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"}). | |||
| 805 | This limit, with the associated error when it is exceeded, is one way | 805 | This limit, with the associated error when it is exceeded, is one way |
| 806 | Emacs Lisp avoids infinite recursion on an ill-defined function. If | 806 | Emacs Lisp avoids infinite recursion on an ill-defined function. If |
| 807 | you increase the value of @code{max-lisp-eval-depth} too much, such | 807 | you increase the value of @code{max-lisp-eval-depth} too much, such |
| 808 | code can cause stack overflow instead. | 808 | code can cause stack overflow instead. On some systems, this overflow |
| 809 | can be handled. In that case, normal Lisp evaluation is interrupted | ||
| 810 | and control is transferred back to the top level command loop | ||
| 811 | (@code{top-level}). Note that there is no way to enter Emacs Lisp | ||
| 812 | debugger in this situation. @xref{Error Debugging}. | ||
| 813 | |||
| 809 | @cindex Lisp nesting error | 814 | @cindex Lisp nesting error |
| 810 | 815 | ||
| 811 | The depth limit counts internal uses of @code{eval}, @code{apply}, and | 816 | The 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 |
| 132 | the frame that was selected when @code{make-frame} was called. | 132 | the frame that was selected when @code{make-frame} was called. |
| 133 | 133 | ||
| 134 | Note that on multi-monitor displays (@pxref{Multiple Terminals}), the | ||
| 135 | window manager might position the frame differently than specified by | ||
| 136 | the positional parameters in @var{alist} (@pxref{Position | ||
| 137 | Parameters}). For example, some window managers have a policy of | ||
| 138 | displaying the frame on the monitor that contains the largest part of | ||
| 139 | the window (a.k.a.@: the @dfn{dominating} monitor). | ||
| 140 | |||
| 134 | This function itself does not make the new frame the selected frame. | 141 | This 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. |
| 136 | On graphical terminals, however, the windowing system may select the | 143 | On 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 | |||
| 258 | terminals, by interacting with the @command{emacsclient} program. | 265 | terminals, 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 |
| 262 | has a three-part name, @samp{@var{host}:@var{server}.@var{screen}}. | 271 | has a three-part name, |
| 263 | The first two parts, @var{host} and @var{server}, identify the X | 272 | @samp{@var{hostname}:@var{displaynumber}.@var{screennumber}}. The |
| 264 | server; the third part, @var{screen}, identifies a screen number on | 273 | first part, @var{hostname}, specifies the name of the machine to which |
| 265 | that X server. When you use two or more screens belonging to one | 274 | the display is physically connected. The second part, |
| 266 | server, Emacs knows by the similarity in their names that they share a | 275 | @var{displaynumber}, is a zero-based number that identifies one or |
| 267 | single keyboard. | 276 | more monitors connected to that machine that share a common keyboard |
| 277 | and pointing device (mouse, tablet, etc.). The third part, | ||
| 278 | @var{screennumber}, identifies a zero-based screen number (a separate | ||
| 279 | monitor) that is part of a single monitor collection on that X server. | ||
| 280 | When you use two or more screens belonging to one server, Emacs knows | ||
| 281 | by 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, | ||
| 284 | don't support the notion of X displays, and have only one display on | ||
| 285 | each host. The display name on these systems doesn't follow the above | ||
| 286 | 3-part format; for example, the display name on MS-Windows systems is | ||
| 287 | a constant string @samp{w32}, and exists for compatibility, so that | ||
| 288 | you 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 |
| 270 | This function creates and returns a new frame on @var{display}, taking | 291 | This 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 |
| 317 | than one physical monitor. @code{display-monitor-attributes-list} and | 338 | than 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} |
| 319 | about each physical monitor on multi-monitor setups. | 340 | to obtain information about such setups. |
| 320 | 341 | ||
| 321 | @defun display-monitor-attributes-list &optional display | 342 | @defun display-monitor-attributes-list &optional display |
| 322 | This function returns a list of physical monitor attributes on | 343 | This 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 |
| 324 | representing the attributes of each physical monitor. The first | 345 | a frame; if omitted or @code{nil}, it defaults to the selected frame's |
| 325 | element corresponds to the primary monitor. | 346 | display. Each element of the list is an association list, |
| 326 | 347 | representing the attributes of a physical monitor. The first element | |
| 327 | Attributes for a physical monitor are: | 348 | corresponds to the primary monitor. The attribute keys and values |
| 349 | are: | ||
| 328 | 350 | ||
| 329 | @table @samp | 351 | @table @samp |
| 330 | @item geometry | 352 | @item geometry |
| 331 | Position and size in pixels in the form of @samp{(X Y WIDTH HEIGHT)} | 353 | Position of the top-left corner of the monitor's screen and its size, |
| 354 | in pixels, as @samp{(@var{x} @var{y} @var{width} @var{height})}. Note | ||
| 355 | that, if the monitor is not the primary monitor, some of the | ||
| 356 | coordinates might be negative. | ||
| 332 | 357 | ||
| 333 | @item workarea | 358 | @item workarea |
| 334 | Position and size of the workarea in pixels in the form of @samp{(X Y | 359 | Position of the top-left corner and size of the work area (``usable'' |
| 335 | WIDTH HEIGHT)} | 360 | space) in pixels as @samp{(@var{x} @var{y} @var{width} @var{height})}. |
| 361 | This may be different from @samp{geometry} in that space occupied by | ||
| 362 | various window manager features (docks, taskbars, etc.) may be | ||
| 363 | excluded from the work area. Whether or not such features actually | ||
| 364 | subtract from the work area depends on the platform and environment. | ||
| 365 | Again, if the monitor is not the primary monitor, some of the | ||
| 366 | coordinates might be negative. | ||
| 336 | 367 | ||
| 337 | @item mm-size | 368 | @item mm-size |
| 338 | Width and height in millimeters in the form of @samp{(WIDTH HEIGHT)} | 369 | Width and height in millimeters as @samp{(@var{width} @var{height})} |
| 339 | 370 | ||
| 340 | @item frames | 371 | @item frames |
| 341 | List of frames dominated by the physical monitor | 372 | List of frames that this physical monitor dominates (see below). |
| 342 | 373 | ||
| 343 | @item name | 374 | @item name |
| 344 | Name of the physical monitor as a string | 375 | Name of the physical monitor as @var{string}. |
| 345 | @end table | ||
| 346 | 376 | ||
| 347 | where X, Y, WIDTH, and HEIGHT are integers. @samp{name} is optional. | 377 | @item source |
| 378 | Source of the multi-monitor information as @var{string}; | ||
| 379 | e.g., @samp{XRandr} or @samp{Xinerama}. | ||
| 380 | @end table | ||
| 348 | 381 | ||
| 349 | A frame is dominated by a physical monitor when either the | 382 | @var{x}, @var{y}, @var{width}, and @var{height} are integers. |
| 350 | largest area of the frame resides in the monitor, or the monitor | 383 | @samp{name} and @samp{source} may be absent. |
| 351 | is the closest to the frame if the frame does not intersect any | 384 | |
| 352 | physical monitors. Every non-tip frame (including invisible one) | 385 | A frame is @dfn{dominated} by a physical monitor when either the |
| 353 | in a graphical display is dominated by exactly one physical | 386 | largest area of the frame resides in that monitor, or (if the frame |
| 354 | monitor at a time, though it can span multiple (or no) physical | 387 | does not intersect any physical monitors) that monitor is the closest |
| 355 | monitors. | 388 | to the frame. Every (non-tooltip) frame (whether visible or not) in a |
| 389 | graphical display is dominated by exactly one physical monitor at a | ||
| 390 | time, though the frame can span multiple (or no) physical monitors. | ||
| 391 | |||
| 392 | Here's an example of the data produced by this function on a 2-monitor | ||
| 393 | display: | ||
| 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 |
| 361 | This function returns the attributes of the physical monitor | 414 | This function returns the attributes of the physical monitor |
| 362 | dominating @var{frame}, which defaults to the selected frame. | 415 | dominating (see above) @var{frame}, which defaults to the selected frame. |
| 363 | |||
| 364 | A frame is dominated by a physical monitor when either the | ||
| 365 | largest area of the frame resides in the monitor, or the monitor | ||
| 366 | is the closest to the frame if the frame does not intersect any | ||
| 367 | physical 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 |
| 538 | The display on which to open this frame. It should be a string of the | 586 | The display on which to open this frame. It should be a string of the |
| 539 | form @code{"@var{host}:@var{dpy}.@var{screen}"}, just like the | 587 | form @samp{@var{host}:@var{dpy}.@var{screen}}, just like the |
| 540 | @env{DISPLAY} environment variable. | 588 | @env{DISPLAY} environment variable. @xref{Multiple Terminals}, for |
| 589 | more 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})} |
| 594 | This specifies the position of the left frame edge relative to the left | 643 | This specifies the position of the left frame edge relative to the left |
| 595 | screen edge. The integer @var{pos} may be positive or negative; a | 644 | screen edge. The integer @var{pos} may be positive or negative; a |
| 596 | negative value specifies a position outside the screen. | 645 | negative value specifies a position outside the screen or on a monitor |
| 646 | other than the primary one (for multi-monitor displays). | ||
| 597 | 647 | ||
| 598 | @item @code{(- @var{pos})} | 648 | @item @code{(- @var{pos})} |
| 599 | This specifies the position of the right frame edge relative to the right | 649 | This specifies the position of the right frame edge relative to the right |
| 600 | screen edge. The integer @var{pos} may be positive or negative; a | 650 | screen edge. The integer @var{pos} may be positive or negative; a |
| 601 | negative value specifies a position outside the screen. | 651 | negative value specifies a position outside the screen or on a monitor |
| 652 | other than the primary one (for multi-monitor displays). | ||
| 602 | @end table | 653 | @end table |
| 603 | 654 | ||
| 604 | Some window managers ignore program-specified positions. If you want to | 655 | Some window managers ignore program-specified positions. If you want to |
| @@ -686,6 +737,11 @@ difference between @code{maximized} and @code{fullboth} is that the | |||
| 686 | former can still be resized by dragging window manager decorations | 737 | former can still be resized by dragging window manager decorations |
| 687 | with the mouse, while the latter really covers the whole screen and | 738 | with the mouse, while the latter really covers the whole screen and |
| 688 | does not allow resizing by mouse dragging. | 739 | does not allow resizing by mouse dragging. |
| 740 | |||
| 741 | With 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 | ||
| 743 | a 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 | |||
| 711 | of the frame they should be on. The possible values are @code{left}, | 767 | of 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 |
| 717 | Whether the frame has scroll bars for horizontal scrolling | 772 | Whether 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). |
| 719 | implemented. | ||
| 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 |
| 724 | The width of vertical scroll bars, in pixels, or @code{nil} meaning to | 777 | The width of vertical scroll bars, in pixels, or @code{nil} meaning to |
| 725 | use the default width. | 778 | use the default width. |
| 726 | 779 | ||
| 780 | @vindex scroll-bar-height, a frame parameter | ||
| 781 | @item scroll-bar-height | ||
| 782 | The height of horizontal scroll bars, in pixels, or @code{nil} meaning | ||
| 783 | to 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. | |||
| 737 | When using @code{set-frame-parameter}, passing a @code{nil} value | 795 | When using @code{set-frame-parameter}, passing a @code{nil} value |
| 738 | imposes an actual default value of 8 pixels. | 796 | imposes an actual default value of 8 pixels. |
| 739 | 797 | ||
| 740 | The combined fringe widths must add up to an integral number of | ||
| 741 | columns, so the actual default fringe widths for the frame, as | ||
| 742 | reported by @code{frame-parameter}, may be larger than what you | ||
| 743 | specify. Any extra width is distributed evenly between the left and | ||
| 744 | right fringe. However, you can force one fringe or the other to a | ||
| 745 | precise width by specifying that width as a negative integer. If both | ||
| 746 | widths 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 |
| 750 | The width (thickness) reserved for the right divider (@pxref{Window | 800 | The width (thickness) reserved for the right divider (@pxref{Window |
| @@ -966,7 +1016,7 @@ variable do not take effect immediately, only when you specify the | |||
| 966 | A list of symbols, specifying the @dfn{font backends} to use for | 1016 | A list of symbols, specifying the @dfn{font backends} to use for |
| 967 | drawing fonts in the frame, in order of priority. On X, there are | 1017 | drawing fonts in the frame, in order of priority. On X, there are |
| 968 | currently two available font backends: @code{x} (the X core font | 1018 | currently two available font backends: @code{x} (the X core font |
| 969 | driver) and @code{xft} (the Xft font driver). On Windows, there are | 1019 | driver) and @code{xft} (the Xft font driver). On MS-Windows, there are |
| 970 | currently two available font backends: @code{gdi} and | 1020 | currently 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 |
| 972 | Manual}). On other systems, there is only one available font backend, | 1022 | Manual}). 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 | |||
| 1158 | be set only in a user's initial file; applications should never bind it | 1208 | be set only in a user's initial file; applications should never bind it |
| 1159 | temporarily. | 1209 | temporarily. |
| 1160 | 1210 | ||
| 1161 | The precise semantics of a value of @code{nil} for this option depends | 1211 | The precise meaning of a value of @code{nil} for this option depends |
| 1162 | on the toolkit used: Dragging the frame border with the mouse is usually | 1212 | on the toolkit used. Dragging the frame border with the mouse is usually |
| 1163 | always done character-wise. Calling @code{set-frame-size} (see below) | 1213 | done character-wise. Calling @code{set-frame-size} (see below) |
| 1164 | with arguments that do not specify the frame size as an integer multiple | 1214 | with arguments that do not specify the frame size as an integer multiple |
| 1165 | of its character size may be, however, either ignored or cause a | 1215 | of its character size, however, may: be ignored, cause a |
| 1166 | rounding (GTK+, Windows) or get accepted (Lucid, Motif). | 1216 | rounding (GTK+), or be accepted (Lucid, Motif, MS-Windows). |
| 1217 | |||
| 1218 | With some window managers you may have to set this to non-@code{nil} in | ||
| 1219 | order 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}. | |||
| 1220 | This macro is the handy way to add the advice @var{function} to the function | 1220 | This macro is the handy way to add the advice @var{function} to the function |
| 1221 | stored in @var{place} (@pxref{Generalized Variables}). | 1221 | stored in @var{place} (@pxref{Generalized Variables}). |
| 1222 | 1222 | ||
| 1223 | If @var{function} is not interactive, then the combined function will inherit | ||
| 1224 | the interactive spec, if any, of the original function. Else, the combined | ||
| 1225 | function will be interactive and will use the interactive spec of | ||
| 1226 | @var{function}. One exception: if the interactive spec of @var{function} | ||
| 1227 | is a function (rather than an expression or a string), then the interactive | ||
| 1228 | spec of the combined function will be a call to that function with as sole | ||
| 1229 | argument the interactive spec of the original function. To interpret the spec | ||
| 1230 | received 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 |
| 1233 | existing function, e.g. whether @var{function} should be called before, or | 1224 | existing function, e.g. whether @var{function} should be called before, or |
| 1234 | after the original function. @xref{Advice combinators}, for the list of | 1225 | after 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 |
| 1242 | the variable name, then @var{function} will only be added in the | 1233 | the variable name, then @var{function} will only be added in the |
| 1243 | current buffer. Finally, if you want to modify a lexical variable, you will | 1234 | current buffer. Finally, if you want to modify a lexical variable, you will |
| 1244 | have to use @code{(var @var{VARIABLE})}. | 1235 | have to use @code{(var @var{variable})}. |
| 1245 | 1236 | ||
| 1246 | Every function added with @code{add-function} can be accompanied by an | 1237 | Every function added with @code{add-function} can be accompanied by an |
| 1247 | association list of properties @var{props}. Currently only two of those | 1238 | association 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 |
| 1272 | other advices applied to it as well. | 1263 | other advices applied to it as well. |
| 1273 | @end table | 1264 | @end table |
| 1265 | |||
| 1266 | If @var{function} is not interactive, then the combined function will inherit | ||
| 1267 | the interactive spec, if any, of the original function. Else, the combined | ||
| 1268 | function will be interactive and will use the interactive spec of | ||
| 1269 | @var{function}. One exception: if the interactive spec of @var{function} | ||
| 1270 | is a function (rather than an expression or a string), then the interactive | ||
| 1271 | spec of the combined function will be a call to that function with as sole | ||
| 1272 | argument the interactive spec of the original function. To interpret the spec | ||
| 1273 | received as argument, use @code{advice-eval-interactive-spec}. | ||
| 1274 | |||
| 1275 | Note: The interactive spec of @var{function} will apply to the combined | ||
| 1276 | function and should hence obey the calling convention of the combined function | ||
| 1277 | rather than that of @var{function}. In many cases, it makes no difference | ||
| 1278 | since 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 | |||
| 529 | floating-point number. | 530 | floating-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 | ||
| 539 | from Lisp programs, as well as most of the data internally used by the | ||
| 540 | Lisp interpreter. Sometimes it may be useful to allocate temporary | ||
| 541 | internal objects using the C stack of the interpreter. This can help | ||
| 542 | performance, as stack allocation is typically faster than using heap | ||
| 543 | memory to allocate and the garbage collector to free. The downside is | ||
| 544 | that using such objects after they are freed results in undefined | ||
| 545 | behavior, so uses should be well thought out and carefully debugged by | ||
| 546 | using the @code{GC_CHECK_MARKED_OBJECTS} feature (see | ||
| 547 | @file{src/alloc.c}). In particular, stack-allocated objects should | ||
| 548 | never be made visible to user Lisp code. | ||
| 549 | |||
| 550 | Currently, cons cells and strings can be allocated this way. This | ||
| 551 | is implemented by C macros like @code{AUTO_CONS} and | ||
| 552 | @code{AUTO_STRING} that define a named @code{Lisp_Object} with block | ||
| 553 | lifetime. These objects are not freed by the garbage collector; | ||
| 554 | instead, they have automatic storage duration, i.e., they are | ||
| 555 | allocated like local variables and are automatically freed at the end | ||
| 556 | of 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, | ||
| 560 | i.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 |
| 1597 | Prefer @code{int} for Emacs character codes, in the range 0 ..@: 0x3FFFFF. | 1627 | Prefer @code{int} for Emacs character codes, in the range 0 ..@: 0x3FFFFF. |
| 1628 | More 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 |
| 1600 | Prefer @code{ptrdiff_t} for sizes, i.e., for integers bounded by the | 1632 | Prefer @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 | |||
| 1606 | impose an arbitrary limit. | 1638 | impose an arbitrary limit. |
| 1607 | 1639 | ||
| 1608 | @item | 1640 | @item |
| 1641 | Avoid @code{ssize_t} except when communicating to low-level APIs that | ||
| 1642 | have @code{ssize_t}-related limitations. Although it's equivalent to | ||
| 1643 | @code{ptrdiff_t} on typical platforms, @code{ssize_t} is occasionally | ||
| 1644 | narrower, so using it for size-related calculations could overflow. | ||
| 1645 | Also, @code{ptrdiff_t} is more ubiquitous and better-standardized, has | ||
| 1646 | standard @code{printf} formats, and is the basis for Emacs's internal | ||
| 1647 | size-overflow checking. When using @code{ssize_t}, please note that | ||
| 1648 | POSIX requires support only for values in the range @minus{}1 ..@: | ||
| 1649 | @code{SSIZE_MAX}. | ||
| 1650 | |||
| 1651 | @item | ||
| 1609 | Prefer @code{intptr_t} for internal representations of pointers, or | 1652 | Prefer @code{intptr_t} for internal representations of pointers, or |
| 1610 | for integers bounded only by the number of objects that can exist at | 1653 | for integers bounded only by the number of objects that can exist at |
| 1611 | any given time or by the total number of bytes that can be allocated. | 1654 | any 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 | ||
| 1130 | This function sorts @var{list} stably, though destructively, and | ||
| 1131 | returns the sorted list. It compares elements using @var{predicate}. A | ||
| 1132 | stable sort is one in which elements with equal sort keys maintain their | ||
| 1133 | relative order before and after the sort. Stability is important when | ||
| 1134 | successive sorts are used to order elements according to different | ||
| 1135 | criteria. | ||
| 1136 | |||
| 1137 | The argument @var{predicate} must be a function that accepts two | ||
| 1138 | arguments. It is called with two elements of @var{list}. To get an | ||
| 1139 | increasing order sort, the @var{predicate} should return non-@code{nil} if the | ||
| 1140 | first element is ``less than'' the second, or @code{nil} if not. | ||
| 1141 | |||
| 1142 | The comparison function @var{predicate} must give reliable results for | ||
| 1143 | any 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 | ||
| 1145 | less 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} | ||
| 1147 | is less than @var{c}, then @var{a} must be less than @var{c}. If you | ||
| 1148 | use a comparison function which does not meet these requirements, the | ||
| 1149 | result of @code{sort} is unpredictable. | ||
| 1150 | |||
| 1151 | The destructive aspect of @code{sort} is that it rearranges the cons | ||
| 1152 | cells forming @var{list} by changing @sc{cdr}s. A nondestructive sort | ||
| 1153 | function would create new cons cells to store the elements in their | ||
| 1154 | sorted order. If you wish to make a sorted copy without destroying the | ||
| 1155 | original, copy it first with @code{copy-sequence} and then sort. | ||
| 1156 | |||
| 1157 | Sorting does not change the @sc{car}s of the cons cells in @var{list}; | ||
| 1158 | the 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 | ||
| 1160 | appears 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 | ||
| 1173 | nums | ||
| 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 | ||
| 1180 | 0; this is the same cons cell that it was before, but it is no longer | ||
| 1181 | the first one in the list. Don't assume a variable that formerly held | ||
| 1182 | the argument now holds the entire sorted list! Instead, save the result | ||
| 1183 | of @code{sort} and use that. Most often we store the result back into | ||
| 1184 | the 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. | ||
| 1191 | See @code{documentation} in @ref{Accessing Documentation}, for a | ||
| 1192 | useful 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}). | |||
| 2221 | It is normally @code{nil}, so that ordinary buffers have no header line. | 2221 | It is normally @code{nil}, so that ordinary buffers have no header line. |
| 2222 | @end defvar | 2222 | @end defvar |
| 2223 | 2223 | ||
| 2224 | The function @code{window-header-line-height} returns the height of | ||
| 2225 | the header line: | ||
| 2226 | |||
| 2227 | @defun window-header-line-height &optional window | 2224 | @defun window-header-line-height &optional window |
| 2228 | Return the height of @var{window}'s header line, in pixels. | 2225 | This 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 | 2226 | line. @var{window} must be a live window, and defaults to the |
| 2230 | omitted, it will be the selected window. | 2227 | selected 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 | ||
| 334 | This function sorts @var{sequence} stably. Note that this function doesn't work | ||
| 335 | for all sequences; it may be used only for lists and vectors. If @var{sequence} | ||
| 336 | is a list, it is modified destructively. This functions returns the sorted | ||
| 337 | @var{sequence} and compares elements using @var{predicate}. A stable sort is | ||
| 338 | one in which elements with equal sort keys maintain their relative order before | ||
| 339 | and after the sort. Stability is important when successive sorts are used to | ||
| 340 | order elements according to different criteria. | ||
| 341 | |||
| 342 | The argument @var{predicate} must be a function that accepts two | ||
| 343 | arguments. It is called with two elements of @var{sequence}. To get an | ||
| 344 | increasing order sort, the @var{predicate} should return non-@code{nil} if the | ||
| 345 | first element is ``less than'' the second, or @code{nil} if not. | ||
| 346 | |||
| 347 | The comparison function @var{predicate} must give reliable results for | ||
| 348 | any 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 | ||
| 350 | less 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} | ||
| 352 | is less than @var{c}, then @var{a} must be less than @var{c}. If you | ||
| 353 | use a comparison function which does not meet these requirements, the | ||
| 354 | result of @code{sort} is unpredictable. | ||
| 355 | |||
| 356 | The destructive aspect of @code{sort} for lists is that it rearranges the | ||
| 357 | cons cells forming @var{sequence} by changing @sc{cdr}s. A nondestructive | ||
| 358 | sort function would create new cons cells to store the elements in their | ||
| 359 | sorted order. If you wish to make a sorted copy without destroying the | ||
| 360 | original, copy it first with @code{copy-sequence} and then sort. | ||
| 361 | |||
| 362 | Sorting does not change the @sc{car}s of the cons cells in @var{sequence}; | ||
| 363 | the 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 | ||
| 365 | appears 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 | ||
| 378 | nums | ||
| 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 | ||
| 385 | 0; this is the same cons cell that it was before, but it is no longer | ||
| 386 | the first one in the list. Don't assume a variable that formerly held | ||
| 387 | the argument now holds the entire sorted list! Instead, save the result | ||
| 388 | of @code{sort} and use that. Most often we store the result back into | ||
| 389 | the variable that held the original list: | ||
| 390 | |||
| 391 | @example | ||
| 392 | (setq nums (sort nums '<)) | ||
| 393 | @end example | ||
| 394 | |||
| 395 | For the better understanding of what stable sort is, consider the following | ||
| 396 | vector example. After sorting, all items whose @code{car} is 8 are grouped | ||
| 397 | at the beginning of @code{vector}, but their relative order is preserved. | ||
| 398 | All items whose @code{car} is 9 are grouped at the end of @code{vector}, | ||
| 399 | but 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. | ||
| 418 | See @code{documentation} in @ref{Accessing Documentation}, for a | ||
| 419 | useful 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 |
| 620 | This function outputs a newline to @var{stream}. The name stands | 620 | This function outputs a newline to @var{stream}. The name stands for |
| 621 | for ``terminate print''. | 621 | ``terminate print''. If @var{ensure} is non-nil no newline is printed |
| 622 | if @var{stream} is already at the beginning of a line. Note in this | ||
| 623 | case @var{stream} can not be a function and an error is signalled if | ||
| 624 | it 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 | ||
| 462 | This function returns @code{t} if @var{string1} and @var{string2} are | ||
| 463 | equal with respect to collation rules. A collation rule is not only | ||
| 464 | determined by the lexicographic order of the characters contained in | ||
| 465 | @var{string1} and @var{string2}, but also further rules about | ||
| 466 | relations between these characters. Usually, it is defined by the | ||
| 467 | @var{locale} environment Emacs is running with. | ||
| 468 | |||
| 469 | For example, characters with different coding points but | ||
| 470 | the same meaning might be considered as equal, like different grave | ||
| 471 | accent 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 | |||
| 480 | The optional argument @var{locale}, a string, overrides the setting of | ||
| 481 | your current locale identifier for collation. The value is system | ||
| 482 | dependent; a @var{locale} "en_US.UTF-8" is applicable on POSIX | ||
| 483 | systems, while it would be, e.g., "enu_USA.1252" on MS-Windows | ||
| 484 | systems. | ||
| 485 | |||
| 486 | If @var{IGNORE-CASE} is non-nil, characters are converted to lower-case | ||
| 487 | before comparing them. | ||
| 488 | |||
| 489 | To emulate Unicode-compliant collation on MS-Windows systems, | ||
| 490 | bind @code{w32-collate-ignore-punctuation} to a non-nil value, since | ||
| 491 | the codeset part of the locale cannot be "UTF-8" on MS-Windows. | ||
| 492 | |||
| 493 | If your system does not support a locale environment, this function | ||
| 494 | behaves like @code{string-equal}. | ||
| 495 | |||
| 496 | Do NOT use this function to compare file names for equality, only | ||
| 497 | for sorting them. | ||
| 498 | @end defun | ||
| 499 | |||
| 500 | @defun string-prefix-p string1 string2 &optional ignore-case | ||
| 501 | This 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 | ||
| 503 | the optional argument @var{ignore-case} is non-@code{nil}, the | ||
| 504 | comparison ignores case differences. | ||
| 505 | @end defun | ||
| 506 | |||
| 507 | @defun string-suffix-p suffix string &optional ignore-case | ||
| 508 | This 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 | ||
| 510 | optional argument @var{ignore-case} is non-@code{nil}, the comparison | ||
| 511 | ignores 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 | ||
| 573 | This function returns @code{t} if @var{string1} is less than | ||
| 574 | @var{string2} in collation order. A collation order is not only | ||
| 575 | determined by the lexicographic order of the characters contained in | ||
| 576 | @var{string1} and @var{string2}, but also further rules about | ||
| 577 | relations between these characters. Usually, it is defined by the | ||
| 578 | @var{locale} environment Emacs is running with. | ||
| 579 | |||
| 580 | For example, punctuation and whitespace characters might be considered | ||
| 581 | less 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 | |||
| 590 | The optional argument @var{locale}, a string, overrides the setting of | ||
| 591 | your current locale identifier for collation. The value is system | ||
| 592 | dependent; a @var{locale} "en_US.UTF-8" is applicable on POSIX | ||
| 593 | systems, while it would be, e.g., "enu_USA.1252" on MS-Windows | ||
| 594 | systems. The @var{locale} "POSIX" lets @code{string-collate-lessp} | ||
| 595 | behave 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 | |||
| 605 | If @var{IGNORE-CASE} is non-nil, characters are converted to lower-case | ||
| 606 | before comparing them. | ||
| 607 | |||
| 608 | To emulate Unicode-compliant collation on MS-Windows systems, | ||
| 609 | bind @code{w32-collate-ignore-punctuation} to a non-nil value, since | ||
| 610 | the codeset part of the locale cannot be "UTF-8" on MS-Windows. | ||
| 611 | |||
| 612 | If your system does not support a locale environment, this function | ||
| 613 | behaves 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 |
| 520 | This function returns non-@code{nil} if @var{string1} is a prefix of | 617 | This 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. | |||
| 4114 | Normally, this command puts point before the inserted text, and the | 4114 | Normally, this command puts point before the inserted text, and the |
| 4115 | mark after it. However, if the optional second argument @var{beforep} | 4115 | mark after it. However, if the optional second argument @var{beforep} |
| 4116 | is non-@code{nil}, it puts the mark before and point after. | 4116 | is non-@code{nil}, it puts the mark before and point after. |
| 4117 | You can pass a non-@code{nil} second argument @var{beforep} to this | 4117 | |
| 4118 | function interactively by supplying any prefix argument. | 4118 | When called interactively, the command defaults to putting point after |
| 4119 | text, and a prefix argument inverts this behavior. | ||
| 4119 | 4120 | ||
| 4120 | If the register contains a rectangle, then the rectangle is inserted | 4121 | If the register contains a rectangle, then the rectangle is inserted |
| 4121 | with its upper left corner at point. This means that text is inserted | 4122 | with 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 | | | | | | | | | | | | |
| 399 | Window | | | | Text Area | | | | | Window | 399 | Window | | | | Text Area | | | | | Window |
| 400 | Body | | | | | (Window Body) | | | | | Total | 400 | Body | | | | | (Window Body) | | | | | Total |
| 401 | Height | | | | | | | | | Height | 401 | Height | | | | | | | | | 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}, |
| 415 | where the buffer text is displayed. The text area can be surrounded by | 416 | where the buffer text is displayed. The text area can be surrounded by |
| 416 | a series of optional areas. On the left and right, from innermost to | 417 | a series of optional areas. On the left and right, from innermost to |
| 417 | outermost, these are the left and right margins, denoted by LM and RM in | 418 | outermost, these are the left and right fringes, denoted by LF and RF |
| 418 | the schematic (@pxref{Display Margins}); the left and right fringes, | 419 | (@pxref{Fringes}); the left and right margins, denoted by LM and RM in |
| 419 | denoted by LF and RF (@pxref{Fringes}); the left or right scroll bar, | 420 | the schematic (@pxref{Display Margins}); the left or right vertical |
| 420 | only one of which is present at any time, denoted by LS and RS | 421 | scroll 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 | 422 | RS (@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 | 425 | scroll bar (@pxref{Scroll Bars}); the mode line (@pxref{Mode Line |
| 425 | Dividers}). | 426 | Format}); 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 |
| 428 | width of a window. The return value of many of these functions can be | 429 | width 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 |
| 442 | the window's body, the header line, the mode line and the bottom divider | 443 | the 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 | 444 | line and the bottom divider (if any). |
| 444 | of its root window (@pxref{Windows and Frames}), since a frame may also | ||
| 445 | contain an echo area, a menu bar, and a tool bar (@pxref{Size and | ||
| 446 | Position}). | ||
| 447 | 445 | ||
| 448 | @defun window-total-height &optional window round | 446 | @defun window-total-height &optional window round |
| 449 | This function returns the total height, in lines, of the window | 447 | This 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 | |||
| 451 | the selected window. If @var{window} is an internal window, the return | 449 | the selected window. If @var{window} is an internal window, the return |
| 452 | value is the total height occupied by its descendant windows. | 450 | value 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 |
| 455 | default character height, the number of lines occupied by the window is | 453 | default character height, the number of lines occupied by the window is |
| 456 | rounded internally. This is done in a way such that, if the window is a | 454 | rounded internally. This is done in a way such that, if the window is a |
| 457 | parent window, the sum of the total heights of all its child windows | 455 | parent window, the sum of the total heights of all its child windows |
| 458 | internally equals the total height of their parent. This means that | 456 | internally equals the total height of their parent. This means that |
| 459 | although two windows have the same pixel height, their internal total | 457 | although two windows have the same pixel height, their internal total |
| 460 | heights may differ by one line. This means also, that if this window is | 458 | heights may differ by one line. This means also, that if window is |
| 461 | vertically combined and has a right sibling, the topmost row of that | 459 | vertically combined and has a next sibling, the topmost row of that |
| 462 | sibling can be calculated as the sum of this window's topmost row and | 460 | sibling can be calculated as the sum of this window's topmost row and |
| 463 | total height (@pxref{Coordinates and Windows}) | 461 | total 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 |
| 466 | function returns the smallest integer larger than @var{window}'s pixel | 464 | function returns the smallest integer larger than @var{window}'s pixel |
| 467 | height divided by the character height of @var{window}'s frame; if it is | 465 | height 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; |
| 469 | pixel height divided by the character height of @var{window}'s frame. | 467 | with any other @var{round} it returns the internal value of |
| 470 | Any other value of @var{round} means to return the internal value of the | 468 | @var{windows}'s total height. |
| 471 | total 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 | |||
| 484 | the selected window. If @var{window} is internal, the return value is | 481 | the selected window. If @var{window} is internal, the return value is |
| 485 | the total width occupied by its descendant windows. | 482 | the 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 |
| 488 | character width, the number of lines occupied by the window is rounded | 485 | character width, the number of lines occupied by the window is rounded |
| 489 | internally. This is done in a way such that, if the window is a parent | 486 | internally. This is done in a way such that, if the window is a parent |
| 490 | window, the sum of the total widths of all its children internally | 487 | window, the sum of the total widths of all its children internally |
| 491 | equals the total width of their parent. This means that although two | 488 | equals the total width of their parent. This means that although two |
| 492 | windows have the same pixel width, their internal total widths may | 489 | windows have the same pixel width, their internal total widths may |
| 493 | differ by one column. This means also, that if this window is | 490 | differ by one column. This means also, that if this window is |
| 494 | horizontally combined and has a right sibling, the leftmost column of | 491 | horizontally combined and has a next sibling, the leftmost column of |
| 495 | that sibling can be calculated as the sum of this window's leftmost | 492 | that sibling can be calculated as the sum of this window's leftmost |
| 496 | column and total width (@pxref{Coordinates and Windows}). | 493 | column and total width (@pxref{Coordinates and Windows}). The optional |
| 497 | 494 | argument @var{round} behaves as it does for @code{window-total-height}. | |
| 498 | If the optional argument @var{round} is @code{ceiling}, this function | ||
| 499 | will return the smallest integer larger than @var{window}'s pixel width | ||
| 500 | divided 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 | ||
| 502 | pixel width divided by the character width of @var{window}'s frame. Any | ||
| 503 | other 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 | |||
| 510 | omitted or @code{nil}, this is equivalent to calling | 500 | omitted 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 |
| 512 | to calling @code{window-total-width} for @var{window}. The optional | 502 | to calling @code{window-total-width} for @var{window}. The optional |
| 513 | argument @code{ROUND} is handled as for @code{window-total-height} and | 503 | argument @var{round} behaves as it does for @code{window-total-height}. |
| 514 | @code{window-total-width}. | ||
| 515 | @end defun | 504 | @end defun |
| 516 | 505 | ||
| 517 | The following two functions can be used to return the total size of a | 506 | The following two functions can be used to return the total size of a |
| @@ -525,9 +514,10 @@ window in units of pixels. | |||
| 525 | This function returns the total height of window @var{window} in pixels. | 514 | This 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 | ||
| 528 | The return value includes mode and header line and a bottom divider, if | 517 | The return value includes mode and header line, a horizontal scroll bar |
| 529 | any. If @var{window} is an internal window, its pixel height is the | 518 | and a bottom divider, if any. If @var{window} is an internal window, |
| 530 | pixel height of the screen areas spanned by its children. | 519 | its pixel height is the pixel height of the screen areas spanned by its |
| 520 | children. | ||
| 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. | |||
| 550 | window has any adjacent windows. | 540 | window has any adjacent windows. |
| 551 | 541 | ||
| 552 | @defun window-full-height-p &optional window | 542 | @defun window-full-height-p &optional window |
| 553 | This function returns non-@code{nil} if @var{window} has no other | 543 | This function returns non-@code{nil} if @var{window} has no other window |
| 554 | window above or below it in its frame, i.e., its total height equals | 544 | above or below it in its frame. More precisely, this means that the |
| 555 | the total height of the root window on that frame. If @var{window} is | 545 | total height of @var{window} equals the total height of the root window |
| 556 | omitted or @code{nil}, it defaults to the selected window. | 546 | on 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 | ||
| 548 | window. | ||
| 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 |
| 569 | The @dfn{body height} of a window is the height of its text area, which | 561 | The @dfn{body height} of a window is the height of its text area, which |
| 570 | does not include a mode or header line or a bottom divider. | 562 | does not include a mode or header line, a horizontal scroll bar, or a |
| 563 | bottom divider. | ||
| 571 | 564 | ||
| 572 | @defun window-body-height &optional window pixelwise | 565 | @defun window-body-height &optional window pixelwise |
| 573 | This function returns the height, in lines, of the body of window | 566 | This 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 |
| 655 | This option specifies the minimum total height, in lines, of any window. | 648 | This option specifies the minimum total height, in lines, of any window. |
| 656 | Its value has to accommodate at least one text line as well as a mode | 649 | Its value has to accommodate at least one text line as well as a mode |
| 657 | and header line and a bottom divider, if present. | 650 | and header line, a horizontal scroll bar and a bottom divider, if |
| 651 | present. | ||
| 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 | ||
| 694 | The return value makes sure that all components of @var{window} remain | 688 | The return value makes sure that all components of @var{window} remain |
| 695 | fully visible if @var{window}'s size were actually set to it. With | 689 | fully 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 |
| 697 | bottom divider. With @var{horizontal} non-@code{nil} it includes the | 691 | horizontal scroll bar and the bottom divider. With @var{horizontal} |
| 698 | fringes, a scroll bar, and a right divider, if present. It does not, | 692 | non-@code{nil} it includes the fringes, a scroll bar, and a right |
| 699 | however, include the space reserved for the margins. | 693 | divider, if present. It does not, however, include the space reserved |
| 694 | for the margins. | ||
| 700 | 695 | ||
| 701 | The optional argument @var{ignore}, if non-@code{nil}, means ignore | 696 | The optional argument @var{ignore}, if non-@code{nil}, means ignore |
| 702 | restrictions imposed by fixed size windows, @code{window-min-height} or | 697 | restrictions 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} |
| 749 | is non-@code{nil}, this function ignores @code{window-min-height} and | 744 | is 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, |
| 751 | it considers the minimum-height window to be one consisting of a header, | 746 | it considers the minimum-height window to be one consisting of a header |
| 752 | a mode line and a bottom divider (if any), plus a text area one line | 747 | and a mode line, a horizontal scrollbar and a bottom divider (if any), |
| 753 | tall; and a minimum-width window as one consisting of fringes, margins, | 748 | plus a text area one line tall; and a minimum-width window as one |
| 754 | a scroll bar and a right divider (if any), plus a text area two columns | 749 | consisting of fringes, margins, a scroll bar and a right divider (if |
| 755 | wide. | 750 | any), plus a text area two columns wide. |
| 756 | 751 | ||
| 757 | If the optional argument @code{pixelwise} is non-@code{nil}, | 752 | If 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 | |||
| 779 | combination limits of the involved windows; in some cases, it may alter | 774 | combination limits of the involved windows; in some cases, it may alter |
| 780 | both edges. @xref{Recombining Windows}. To resize by moving only the | 775 | both edges. @xref{Recombining Windows}. To resize by moving only the |
| 781 | bottom or right edge of a window, use the function | 776 | bottom 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 | |||
| 792 | moves the right edge by @var{delta} columns. If @var{window} is | 787 | moves 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 | ||
| 795 | If the optional argument @code{pixelwise} is non-@code{nil}, | 790 | If 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 | ||
| 798 | A positive @var{delta} moves the edge downwards or to the right; a | 793 | A positive @var{delta} moves the edge downwards or to the right; a |
| 799 | negative @var{delta} moves it upwards or to the left. If the edge | 794 | negative @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 |
| 810 | If the value of this option is non-@code{nil}, windows are resized in | 805 | If the value of this option is non-@code{nil}, Emacs resizes windows in |
| 811 | units of pixels. This currently affects functions like | 806 | units 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 | ||
| 817 | Note that when a frame's pixel size is not a multiple of the frame's | 812 | Note that when a frame's pixel size is not a multiple of its character |
| 818 | character size, at least one window may get resized pixelwise even if | 813 | size, at least one window may get resized pixelwise even if this |
| 819 | this option is @code{nil}. The default value of this option is | 814 | option 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 |