diff options
| author | Joakim Verona | 2011-12-28 04:12:56 +0100 |
|---|---|---|
| committer | Joakim Verona | 2011-12-28 04:12:56 +0100 |
| commit | bb29f044aa967831cd664c54eba0de0c701436ce (patch) | |
| tree | 1398cc9780bbae0fdad071a3a3765a571c3f6d7b /doc/lispref | |
| parent | 3c935a7e996701244d166f684119f0ff97e25496 (diff) | |
| parent | 5e605a2e528955721fc6f2bd7b9f174c15075fb1 (diff) | |
| download | emacs-bb29f044aa967831cd664c54eba0de0c701436ce.tar.gz emacs-bb29f044aa967831cd664c54eba0de0c701436ce.zip | |
upstream i think
Diffstat (limited to 'doc/lispref')
| -rw-r--r-- | doc/lispref/ChangeLog | 23 | ||||
| -rw-r--r-- | doc/lispref/display.texi | 71 | ||||
| -rw-r--r-- | doc/lispref/spellfile | 5 | ||||
| -rw-r--r-- | doc/lispref/text.texi | 20 | ||||
| -rw-r--r-- | doc/lispref/two-volume-cross-refs.txt | 2 | ||||
| -rw-r--r-- | doc/lispref/windows.texi | 202 |
6 files changed, 200 insertions, 123 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 293f253c545..37de62be976 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,26 @@ | |||
| 1 | 2011-11-26 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * display.texi (Truncation): | ||
| 4 | * text.texi (Special Properties): Describe what a stretch-glyph is | ||
| 5 | instead of using that term without explanation. Make the | ||
| 6 | cross-references more accurate. | ||
| 7 | |||
| 8 | * display.texi (Usual Display): Update the description, | ||
| 9 | cross-references, and indexing related to display of control | ||
| 10 | characters and raw bytes. | ||
| 11 | |||
| 12 | 2011-11-25 Martin Rudalics <rudalics@gmx.at> | ||
| 13 | |||
| 14 | * windows.texi (Splitting Windows): Fix description of | ||
| 15 | window-combination-limit. Suggested by Eli Zaretskii. | ||
| 16 | |||
| 17 | 2011-11-23 Chong Yidong <cyd@gnu.org> | ||
| 18 | |||
| 19 | * windows.texi (Window Sizes): Move window-top-line, | ||
| 20 | window-left-column, and window-*-pixel-edges to Coordinates and | ||
| 21 | Windows node. | ||
| 22 | (Coordinates and Windows): Restore window-edges doc. | ||
| 23 | |||
| 1 | 2011-11-21 Martin Rudalics <rudalics@gmx.at> | 24 | 2011-11-21 Martin Rudalics <rudalics@gmx.at> |
| 2 | 25 | ||
| 3 | * windows.texi (Windows and Frames, Splitting Windows): Fix | 26 | * windows.texi (Windows and Frames, Splitting Windows): Fix |
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 9849420b1f5..a9921d7443d 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi | |||
| @@ -193,10 +193,12 @@ a window, that forces truncation. | |||
| 193 | @defvar wrap-prefix | 193 | @defvar wrap-prefix |
| 194 | If this buffer-local variable is non-@code{nil}, it defines a | 194 | If this buffer-local variable is non-@code{nil}, it defines a |
| 195 | ``prefix'' that is prepended to every continuation line at | 195 | ``prefix'' that is prepended to every continuation line at |
| 196 | display-time. (If lines are truncated, the wrap-prefix is never | 196 | display time. (If lines are truncated, the wrap-prefix is never |
| 197 | used.) It may be a string, an image, or a stretch-glyph; the value is | 197 | used.) It may be a string or an image (@pxref{Other Display Specs}), |
| 198 | interpreted in the same way as a @code{display} text property. | 198 | or a stretch of whitespace such as specified by the @code{:width} or |
| 199 | @xref{Display Property}. | 199 | @code{:align-to} display properties (@pxref{Specified Space}). The |
| 200 | value is interpreted in the same way as a @code{display} text | ||
| 201 | property. @xref{Display Property}. | ||
| 200 | 202 | ||
| 201 | A wrap-prefix may also be specified for regions of text, using the | 203 | A wrap-prefix may also be specified for regions of text, using the |
| 202 | @code{wrap-prefix} text or overlay property. This takes precedence | 204 | @code{wrap-prefix} text or overlay property. This takes precedence |
| @@ -206,9 +208,11 @@ over the @code{wrap-prefix} variable. @xref{Special Properties}. | |||
| 206 | @defvar line-prefix | 208 | @defvar line-prefix |
| 207 | If this buffer-local variable is non-@code{nil}, it defines a | 209 | If this buffer-local variable is non-@code{nil}, it defines a |
| 208 | ``prefix'' that is prepended to every non-continuation line at | 210 | ``prefix'' that is prepended to every non-continuation line at |
| 209 | display-time. It may be a string, an image, or a stretch-glyph; the | 211 | display time. It may be a string or an image (@pxref{Other Display |
| 210 | value is interpreted in the same way as a @code{display} text | 212 | Specs}), or a stretch of whitespace such as specified by the |
| 211 | property. @xref{Display Property}. | 213 | @code{:width} or @code{:align-to} display properties (@pxref{Specified |
| 214 | Space}). The value is interpreted in the same way as a @code{display} | ||
| 215 | text property. @xref{Display Property}. | ||
| 212 | 216 | ||
| 213 | A line-prefix may also be specified for regions of text using the | 217 | A line-prefix may also be specified for regions of text using the |
| 214 | @code{line-prefix} text or overlay property. This takes precedence | 218 | @code{line-prefix} text or overlay property. This takes precedence |
| @@ -5638,39 +5642,45 @@ code. You can override these conventions by setting up a display table | |||
| 5638 | @itemize @bullet | 5642 | @itemize @bullet |
| 5639 | @item | 5643 | @item |
| 5640 | Character codes 32 through 126 map to glyph codes 32 through 126. | 5644 | Character codes 32 through 126 map to glyph codes 32 through 126. |
| 5641 | Normally this means they display as themselves. | 5645 | Normally this means they display as themselves, but a display table |
| 5646 | can change that. | ||
| 5642 | 5647 | ||
| 5643 | @item | 5648 | @item |
| 5644 | Character code 9 is a horizontal tab. It displays as whitespace | 5649 | Character code 9 is a horizontal tab. It displays as whitespace |
| 5645 | up to a position determined by @code{tab-width}. | 5650 | up to a position determined by @code{tab-width}. |
| 5646 | 5651 | ||
| 5647 | @item | 5652 | @item |
| 5648 | Character code 10 is a newline. | 5653 | Character code 10 is a newline. It is normally invisible on display, |
| 5654 | and has the effect of ending the preceding line and starting a new | ||
| 5655 | line. | ||
| 5649 | 5656 | ||
| 5650 | @item | 5657 | @item |
| 5651 | All other codes in the range 0 through 31, and code 127, display in one | 5658 | All other codes in the range 0 through 31 display in one of two ways |
| 5652 | of two ways according to the value of @code{ctl-arrow}. If it is | 5659 | according to the value of @code{ctl-arrow}. If it is non-@code{nil}, |
| 5653 | non-@code{nil}, these codes map to sequences of two glyphs, where the | 5660 | these codes map to sequences of two glyphs, where the first glyph is |
| 5654 | first glyph is the @acronym{ASCII} code for @samp{^}. (A display table can | 5661 | the @acronym{ASCII} code for @samp{^}. (A display table can specify a |
| 5655 | specify a glyph to use instead of @samp{^}.) Otherwise, these codes map | 5662 | glyph to use instead of @samp{^}.) Otherwise, these codes map just |
| 5656 | just like the codes in the range 128 to 255. | 5663 | like the raw bytes in the range 128 to 255 (described below). |
| 5657 | 5664 | ||
| 5658 | On MS-DOS terminals, Emacs arranges by default for the character code | 5665 | @cindex octal escapes |
| 5659 | 127 to be mapped to the glyph code 127, which normally displays as an | ||
| 5660 | empty polygon. This glyph is used to display non-@acronym{ASCII} characters | ||
| 5661 | that the MS-DOS terminal doesn't support. @xref{MS-DOS and MULE,,, | ||
| 5662 | emacs, The GNU Emacs Manual}. | ||
| 5663 | |||
| 5664 | @item | 5666 | @item |
| 5665 | Character codes 128 through 255 map to sequences of four glyphs, where | 5667 | Raw bytes (@pxref{Text Representations}) with codes 128 through 255, |
| 5666 | the first glyph is the @acronym{ASCII} code for @samp{\}, and the others are | 5668 | and the @acronym{ASCII} control character with code 127, display as |
| 5667 | digit characters representing the character code in octal. (A display | 5669 | sequences of four glyphs, where the first glyph is the @acronym{ASCII} |
| 5668 | table can specify a glyph to use instead of @samp{\}.) | 5670 | code for @samp{\}, and the others are digit characters representing |
| 5671 | the character code in octal. (A display table can specify a glyph to | ||
| 5672 | use instead of @samp{\}.) This is known as the @dfn{octal escape} | ||
| 5673 | display. | ||
| 5669 | 5674 | ||
| 5670 | @item | 5675 | @item |
| 5671 | Multibyte character codes above 256 are displayed as themselves, or as | 5676 | Non-@acronym{ASCII} character codes above 127 are displayed as |
| 5672 | a question mark or a hex code or an empty box if the terminal cannot | 5677 | themselves, if the terminal and the available fonts support them. |
| 5673 | display that character. | 5678 | Characters that are not supported by the terminal, or (on window |
| 5679 | systems) have no fonts available for them, are displayed as a question | ||
| 5680 | mark or a hex code or an empty box. @xref{Glyphless Chars}, for how | ||
| 5681 | to control display of the characters not supported by the terminal or | ||
| 5682 | fonts. Display tables can change how a character is displayed, even | ||
| 5683 | if it is supported. | ||
| 5674 | @end itemize | 5684 | @end itemize |
| 5675 | 5685 | ||
| 5676 | The usual display conventions apply even when there is a display | 5686 | The usual display conventions apply even when there is a display |
| @@ -5695,7 +5705,8 @@ mode line using the new values, call the function | |||
| 5695 | This buffer-local variable controls how control characters are | 5705 | This buffer-local variable controls how control characters are |
| 5696 | displayed. If it is non-@code{nil}, they are displayed as a caret | 5706 | displayed. If it is non-@code{nil}, they are displayed as a caret |
| 5697 | followed by the character: @samp{^A}. If it is @code{nil}, they are | 5707 | followed by the character: @samp{^A}. If it is @code{nil}, they are |
| 5698 | displayed as a backslash followed by three octal digits: @samp{\001}. | 5708 | displayed as octal escapes: a backslash followed by three octal |
| 5709 | digits, as in @samp{\001}. | ||
| 5699 | @end defopt | 5710 | @end defopt |
| 5700 | 5711 | ||
| 5701 | @defopt tab-width | 5712 | @defopt tab-width |
diff --git a/doc/lispref/spellfile b/doc/lispref/spellfile index 5c0a6d0f5ea..e0d77ee0541 100644 --- a/doc/lispref/spellfile +++ b/doc/lispref/spellfile | |||
| @@ -253,7 +253,6 @@ deletable | |||
| 253 | deletion' | 253 | deletion' |
| 254 | delq | 254 | delq |
| 255 | depiction | 255 | depiction |
| 256 | descendents | ||
| 257 | deselecting | 256 | deselecting |
| 258 | destructive' | 257 | destructive' |
| 259 | destructively' | 258 | destructively' |
| @@ -299,7 +298,6 @@ excess' | |||
| 299 | exec | 298 | exec |
| 300 | exitcode | 299 | exitcode |
| 301 | expression' | 300 | expression' |
| 302 | extendible | ||
| 303 | extra' | 301 | extra' |
| 304 | fails' | 302 | fails' |
| 305 | fascist | 303 | fascist |
| @@ -660,7 +658,7 @@ the' | |||
| 660 | tildes | 658 | tildes |
| 661 | time's | 659 | time's |
| 662 | to' | 660 | to' |
| 663 | towars | 661 | towards |
| 664 | transportable | 662 | transportable |
| 665 | txt | 663 | txt |
| 666 | types' | 664 | types' |
| @@ -674,7 +672,6 @@ undefine | |||
| 674 | undefines | 672 | undefines |
| 675 | underfull | 673 | underfull |
| 676 | undo's | 674 | undo's |
| 677 | undodata | ||
| 678 | unevaluated' | 675 | unevaluated' |
| 679 | unexec | 676 | unexec |
| 680 | unexpand | 677 | unexpand |
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 3a081dddc61..fc12939bec5 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi | |||
| @@ -3191,10 +3191,12 @@ controls the total height of the display line ending in that newline. | |||
| 3191 | 3191 | ||
| 3192 | @item wrap-prefix | 3192 | @item wrap-prefix |
| 3193 | If text has a @code{wrap-prefix} property, the prefix it defines will | 3193 | If text has a @code{wrap-prefix} property, the prefix it defines will |
| 3194 | be added at display-time to the beginning of every continuation line | 3194 | be added at display time to the beginning of every continuation line |
| 3195 | due to text wrapping (so if lines are truncated, the wrap-prefix is | 3195 | due to text wrapping (so if lines are truncated, the wrap-prefix is |
| 3196 | never used). It may be a string, an image, or a stretch-glyph such as | 3196 | never used). It may be a string or an image (@pxref{Other Display |
| 3197 | used by the @code{display} text-property. @xref{Display Property}. | 3197 | Specs}), or a stretch of whitespace such as specified by the |
| 3198 | @code{:width} or @code{:align-to} display properties (@pxref{Specified | ||
| 3199 | Space}). | ||
| 3198 | 3200 | ||
| 3199 | A wrap-prefix may also be specified for an entire buffer using the | 3201 | A wrap-prefix may also be specified for an entire buffer using the |
| 3200 | @code{wrap-prefix} buffer-local variable (however, a | 3202 | @code{wrap-prefix} buffer-local variable (however, a |
| @@ -3203,9 +3205,11 @@ the @code{wrap-prefix} variable). @xref{Truncation}. | |||
| 3203 | 3205 | ||
| 3204 | @item line-prefix | 3206 | @item line-prefix |
| 3205 | If text has a @code{line-prefix} property, the prefix it defines will | 3207 | If text has a @code{line-prefix} property, the prefix it defines will |
| 3206 | be added at display-time to the beginning of every non-continuation | 3208 | be added at display time to the beginning of every non-continuation |
| 3207 | line. It may be a string, an image, or a stretch-glyph such as used | 3209 | line. It may be a string or an image (@pxref{Other Display |
| 3208 | by the @code{display} text-property. @xref{Display Property}. | 3210 | Specs}), or a stretch of whitespace such as specified by the |
| 3211 | @code{:width} or @code{:align-to} display properties (@pxref{Specified | ||
| 3212 | Space}). | ||
| 3209 | 3213 | ||
| 3210 | A line-prefix may also be specified for an entire buffer using the | 3214 | A line-prefix may also be specified for an entire buffer using the |
| 3211 | @code{line-prefix} buffer-local variable (however, a | 3215 | @code{line-prefix} buffer-local variable (however, a |
| @@ -3762,7 +3766,7 @@ Additionally, if two fields are separated by another field with the | |||
| 3762 | special value @code{boundary}, then any point within this special | 3766 | special value @code{boundary}, then any point within this special |
| 3763 | field is also considered to be ``on the boundary.'' | 3767 | field is also considered to be ``on the boundary.'' |
| 3764 | 3768 | ||
| 3765 | Commands like @kbd{C-a} with no argumemt, that normally move backward | 3769 | Commands like @kbd{C-a} with no argument, that normally move backward |
| 3766 | to a specific kind of location and stay there once there, probably | 3770 | to a specific kind of location and stay there once there, probably |
| 3767 | should specify @code{nil} for @var{escape-from-edge}. Other motion | 3771 | should specify @code{nil} for @var{escape-from-edge}. Other motion |
| 3768 | commands that check fields should probably pass @code{t}. | 3772 | commands that check fields should probably pass @code{t}. |
| @@ -4322,5 +4326,3 @@ If you do want modification hooks to be run in a particular piece of | |||
| 4322 | code that is itself run from a modification hook, then rebind locally | 4326 | code that is itself run from a modification hook, then rebind locally |
| 4323 | @code{inhibit-modification-hooks} to @code{nil}. | 4327 | @code{inhibit-modification-hooks} to @code{nil}. |
| 4324 | @end defvar | 4328 | @end defvar |
| 4325 | |||
| 4326 | |||
diff --git a/doc/lispref/two-volume-cross-refs.txt b/doc/lispref/two-volume-cross-refs.txt index 53a9f58cd01..6eb11a92f47 100644 --- a/doc/lispref/two-volume-cross-refs.txt +++ b/doc/lispref/two-volume-cross-refs.txt | |||
| @@ -34,7 +34,7 @@ where each volume starts with a higher page number since I find it | |||
| 34 | harder to go to the right place in the volume.) | 34 | harder to go to the right place in the volume.) |
| 35 | 35 | ||
| 36 | References to the same volume are just the page number; references to | 36 | References to the same volume are just the page number; references to |
| 37 | the other volume are a volumne number (in Roman numerals) preceding | 37 | the other volume are a volume number (in Roman numerals) preceding |
| 38 | the page number. | 38 | the page number. |
| 39 | 39 | ||
| 40 | For example, in Volume I: | 40 | For example, in Volume I: |
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index bb1b0524689..437b6db8d58 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi | |||
| @@ -376,7 +376,7 @@ Bars}). At the top of the window is an optional header line | |||
| 376 | line (@pxref{Mode Line Format}). | 376 | line (@pxref{Mode Line Format}). |
| 377 | 377 | ||
| 378 | Emacs provides several functions for finding the height and width of | 378 | Emacs provides several functions for finding the height and width of |
| 379 | a window. Except where noted, these heights and widths are reported | 379 | a window. Except where noted, Emacs reports window heights and widths |
| 380 | as integer numbers of lines and columns respectively. On a graphical | 380 | as integer numbers of lines and columns respectively. On a graphical |
| 381 | display, each ``line'' and ``column'' actually corresponds to the | 381 | display, each ``line'' and ``column'' actually corresponds to the |
| 382 | height and width of a ``default'' character specified by the frame's | 382 | height and width of a ``default'' character specified by the frame's |
| @@ -439,26 +439,6 @@ that of the root window on that frame. If @var{window} is omitted or | |||
| 439 | @code{nil}, it defaults to the selected window. | 439 | @code{nil}, it defaults to the selected window. |
| 440 | @end defun | 440 | @end defun |
| 441 | 441 | ||
| 442 | @cindex window position | ||
| 443 | The following functions can be used to determine the position of a | ||
| 444 | window relative to the window area of its frame: | ||
| 445 | |||
| 446 | @defun window-top-line &optional window | ||
| 447 | This function returns the distance, in lines, between the top of | ||
| 448 | @var{window} and the top of the frame's window area. For instance, | ||
| 449 | the return value is 0 if there is no window above @var{window}. If | ||
| 450 | @var{window} is omitted or @code{nil}, it defaults to the selected | ||
| 451 | window. | ||
| 452 | @end defun | ||
| 453 | |||
| 454 | @defun window-left-column &optional window | ||
| 455 | This function returns the distance, in columns, between the left edge | ||
| 456 | of @var{window} and the left edge of the frame's window area. For | ||
| 457 | instance, the return value is 0 if there is no window to the left of | ||
| 458 | @var{window}. If @var{window} is omitted or @code{nil}, it defaults | ||
| 459 | to the selected window. | ||
| 460 | @end defun | ||
| 461 | |||
| 462 | @cindex window body height | 442 | @cindex window body height |
| 463 | @cindex body height of a window | 443 | @cindex body height of a window |
| 464 | @cindex window body width | 444 | @cindex window body width |
| @@ -535,45 +515,12 @@ can be resized in the desired direction. To determine that, use the | |||
| 535 | function @code{window-resizable}. @xref{Resizing Windows}. | 515 | function @code{window-resizable}. @xref{Resizing Windows}. |
| 536 | @end defun | 516 | @end defun |
| 537 | 517 | ||
| 538 | The following functions can be used to find a window's size and | 518 | @xref{Coordinates and Windows}, for more functions that report the |
| 539 | position in pixels. Though mostly useful on graphical displays, they | 519 | positions of various parts of a window relative to the frame, from |
| 540 | can also be called on text-only terminals, where the screen area of | 520 | which you can calculate its size. In particular, you can use the |
| 541 | each text character is taken to be ``one pixel''. | 521 | functions @code{window-pixel-edges} and |
| 542 | 522 | @code{window-inside-pixel-edges} to find the size in pixels, for | |
| 543 | @defun window-pixel-edges &optional window | 523 | graphical displays. |
| 544 | This function return a list of pixel coordinates for the edges of | ||
| 545 | @var{window}. If @var{window} is omitted or @code{nil}, it defaults | ||
| 546 | to the selected window. | ||
| 547 | |||
| 548 | The return value has the form @code{(@var{left} @var{top} @var{right} | ||
| 549 | @var{bottom})}. The list elements are, respectively, the X coordinate | ||
| 550 | of the left window edge, the Y coordinate of the top edge, one more | ||
| 551 | than the X coordinate of the right edge, and one more than the Y | ||
| 552 | coordinate of the bottom edge. The origin coordinate @samp{(0,0)} is | ||
| 553 | taken to be the top left corner of the frame's window area. | ||
| 554 | |||
| 555 | These edge values include the space used by the window's scroll bar, | ||
| 556 | margins, fringes, header line, and mode line, if any. | ||
| 557 | @end defun | ||
| 558 | |||
| 559 | @defun window-inside-pixel-edges &optional window | ||
| 560 | This function is like @code{window-pixel-edges}, except that it | ||
| 561 | returns the edge coordinates for the window's text area, rather than | ||
| 562 | the edge coordinates for the window itself. @var{window} must specify | ||
| 563 | a live window. | ||
| 564 | @end defun | ||
| 565 | |||
| 566 | @defun window-absolute-pixel-edges &optional window | ||
| 567 | This function is like @code{window-pixel-edges}, except that it | ||
| 568 | returns the edge coordinates relative to the top left corner of the | ||
| 569 | display screen. | ||
| 570 | @end defun | ||
| 571 | |||
| 572 | @defun window-inside-absolute-pixel-edges &optional window | ||
| 573 | This function is like @code{window-inside-pixel-edges}, except that it | ||
| 574 | returns the edge coordinates relative to the top left corner of the | ||
| 575 | display screen. @var{window} must specify a live window. | ||
| 576 | @end defun | ||
| 577 | 524 | ||
| 578 | @node Resizing Windows | 525 | @node Resizing Windows |
| 579 | @section Resizing Windows | 526 | @section Resizing Windows |
| @@ -943,8 +890,9 @@ direction as the existing window combination (otherwise, a new | |||
| 943 | internal window is created anyway). The default is @code{nil}. Other | 890 | internal window is created anyway). The default is @code{nil}. Other |
| 944 | values are reserved for future use. | 891 | values are reserved for future use. |
| 945 | 892 | ||
| 946 | Thus, if the value is always @code{t}, each window tree is a binary | 893 | Thus, if the value of this variable is at all times @code{t}, then at |
| 947 | tree: each window except the root window has exactly one sibling. | 894 | all times every window tree is a binary tree (a tree where each window |
| 895 | except the root window has exactly one sibling). | ||
| 948 | 896 | ||
| 949 | Furthermore, @code{split-window} calls | 897 | Furthermore, @code{split-window} calls |
| 950 | @code{set-window-combination-limit} on the newly-created internal | 898 | @code{set-window-combination-limit} on the newly-created internal |
| @@ -2976,32 +2924,90 @@ is off the screen due to horizontal scrolling: | |||
| 2976 | @end group | 2924 | @end group |
| 2977 | @end example | 2925 | @end example |
| 2978 | 2926 | ||
| 2979 | |||
| 2980 | @node Coordinates and Windows | 2927 | @node Coordinates and Windows |
| 2981 | @section Coordinates and Windows | 2928 | @section Coordinates and Windows |
| 2929 | @cindex frame-relative coordinate | ||
| 2930 | @cindex coordinate, relative to frame | ||
| 2931 | @cindex window position | ||
| 2932 | |||
| 2933 | This section describes functions that report the position of a | ||
| 2934 | window. Most of these functions report positions relative to the | ||
| 2935 | window's frame. In this case, the coordinate origin @samp{(0,0)} lies | ||
| 2936 | near the upper left corner of the frame. For technical reasons, on | ||
| 2937 | graphical displays the origin is not located at the exact corner of | ||
| 2938 | the graphical window as it appears on the screen. If Emacs is built | ||
| 2939 | with the GTK+ toolkit, the origin is at the upper left corner of the | ||
| 2940 | frame area used for displaying Emacs windows, below the title-bar, | ||
| 2941 | GTK+ menu bar, and tool bar (since these are drawn by the window | ||
| 2942 | manager and/or GTK+, not by Emacs). But if Emacs is not built with | ||
| 2943 | GTK+, the origin is at the upper left corner of the tool bar (since in | ||
| 2944 | this case Emacs itself draws the tool bar). In both cases, the X and | ||
| 2945 | Y coordinates increase rightward and downward respectively. | ||
| 2946 | |||
| 2947 | Except where noted, X and Y coordinates are reported in integer | ||
| 2948 | character units, i.e. numbers of lines and columns respectively. On a | ||
| 2949 | graphical display, each ``line'' and ``column'' corresponds to the | ||
| 2950 | height and width of a default character specified by the frame's | ||
| 2951 | default font. | ||
| 2952 | |||
| 2953 | @defun window-edges &optional window | ||
| 2954 | This function returns a list of the edge coordinates of @var{window}. | ||
| 2955 | If @var{window} is omitted or @code{nil}, it defaults to the selected | ||
| 2956 | window. | ||
| 2982 | 2957 | ||
| 2983 | This section describes how to relate screen coordinates to windows. | 2958 | The return value has the form @code{(@var{left} @var{top} @var{right} |
| 2959 | @var{bottom})}. These list elements are, respectively, the X | ||
| 2960 | coordinate of the leftmost column occupied by the window, the Y | ||
| 2961 | coordinate of the topmost row, the X coordinate one column to the | ||
| 2962 | right of the rightmost column, and the Y coordinate one row down from | ||
| 2963 | the bottommost row. | ||
| 2984 | 2964 | ||
| 2985 | @defun window-at x y &optional frame | 2965 | Note that these are the actual outer edges of the window, including |
| 2986 | This function returns the window containing the specified cursor | 2966 | any header line, mode line, scroll bar, fringes, and display margins. |
| 2987 | position in the frame @var{frame}. The coordinates @var{x} and @var{y} | 2967 | On a text-only terminal, if the window has a neighbor on its right, |
| 2988 | are measured in characters and count from the top left corner of the | 2968 | its right edge includes the separator line between the window and its |
| 2989 | frame. If they are out of range, @code{window-at} returns @code{nil}. | 2969 | neighbor. |
| 2970 | @end defun | ||
| 2990 | 2971 | ||
| 2991 | If you omit @var{frame}, the selected frame is used. | 2972 | @defun window-inside-edges &optional window |
| 2973 | This function is similar to @code{window-edges}, but the returned edge | ||
| 2974 | values are for the text area of the window. They exclude any header | ||
| 2975 | line, mode line, scroll bar, fringes, display margins, and vertical | ||
| 2976 | separator. | ||
| 2992 | @end defun | 2977 | @end defun |
| 2993 | 2978 | ||
| 2994 | @defun coordinates-in-window-p coordinates window | 2979 | @defun window-top-line &optional window |
| 2995 | This function checks whether a particular frame position falls within | 2980 | This function returns the Y coordinate of the topmost row of |
| 2996 | the window @var{window}. | 2981 | @var{window}, equivalent to the @var{top} entry in the list returned |
| 2982 | by @code{window-edges}. | ||
| 2983 | @end defun | ||
| 2984 | |||
| 2985 | @defun window-left-column &optional window | ||
| 2986 | This function returns the X coordinate of the leftmost column of | ||
| 2987 | @var{window}, equivalent to the @var{left} entry in the list returned | ||
| 2988 | by @code{window-edges}. | ||
| 2989 | @end defun | ||
| 2997 | 2990 | ||
| 2998 | The argument @var{coordinates} is a cons cell of the form @code{(@var{x} | 2991 | The following functions can be used to relate a set of |
| 2999 | . @var{y})}. The coordinates @var{x} and @var{y} are measured in | 2992 | frame-relative coordinates to a window: |
| 3000 | characters, and count from the top left corner of the screen or frame. | ||
| 3001 | 2993 | ||
| 3002 | The value returned by @code{coordinates-in-window-p} is non-@code{nil} | 2994 | @defun window-at x y &optional frame |
| 3003 | if the coordinates are inside @var{window}. The value also indicates | 2995 | This function returns the live window at the frame-relative |
| 3004 | what part of the window the position is in, as follows: | 2996 | coordinates @var{x} and @var{y}, on frame @var{frame}. If there is no |
| 2997 | window at that position, the return value is @code{nil}. If | ||
| 2998 | @var{frame} is omitted or @code{nil}, it defaults to the selected | ||
| 2999 | frame. | ||
| 3000 | @end defun | ||
| 3001 | |||
| 3002 | @defun coordinates-in-window-p coordinates window | ||
| 3003 | This function checks whether a window @var{window} occupies the | ||
| 3004 | frame-relative coordinates @var{coordinates}, and if so which part of | ||
| 3005 | the window that is. @var{window} should be a live window. | ||
| 3006 | @var{coordinates} should be a cons cell of the form @code{(@var{x} | ||
| 3007 | . @var{y})}, where @var{x} and @var{y} are frame-relative coordinates. | ||
| 3008 | |||
| 3009 | If there is no window at the specified position, the return value is | ||
| 3010 | @code{nil} . Otherwise, the return value is one of the following: | ||
| 3005 | 3011 | ||
| 3006 | @table @code | 3012 | @table @code |
| 3007 | @item (@var{relx} . @var{rely}) | 3013 | @item (@var{relx} . @var{rely}) |
| @@ -3038,6 +3044,44 @@ The function @code{coordinates-in-window-p} does not require a frame as | |||
| 3038 | argument because it always uses the frame that @var{window} is on. | 3044 | argument because it always uses the frame that @var{window} is on. |
| 3039 | @end defun | 3045 | @end defun |
| 3040 | 3046 | ||
| 3047 | The following functions return window positions in pixels, rather | ||
| 3048 | than character units. Though mostly useful on graphical displays, | ||
| 3049 | they can also be called on text-only terminals, where the screen area | ||
| 3050 | of each text character is taken to be ``one pixel''. | ||
| 3051 | |||
| 3052 | @defun window-pixel-edges &optional window | ||
| 3053 | This function returns a list of pixel coordinates for the edges of | ||
| 3054 | @var{window}. If @var{window} is omitted or @code{nil}, it defaults | ||
| 3055 | to the selected window. | ||
| 3056 | |||
| 3057 | The return value has the form @code{(@var{left} @var{top} @var{right} | ||
| 3058 | @var{bottom})}. The list elements are, respectively, the X pixel | ||
| 3059 | coordinate of the left window edge, the Y pixel coordinate of the top | ||
| 3060 | edge, one more than the X pixel coordinate of the right edge, and one | ||
| 3061 | more than the Y pixel coordinate of the bottom edge. | ||
| 3062 | @end defun | ||
| 3063 | |||
| 3064 | @defun window-inside-pixel-edges &optional window | ||
| 3065 | This function is like @code{window-pixel-edges}, except that it | ||
| 3066 | returns the pixel coordinates for the edges of the window's text area, | ||
| 3067 | rather than the pixel coordinates for the edges of the window itself. | ||
| 3068 | @var{window} must specify a live window. | ||
| 3069 | @end defun | ||
| 3070 | |||
| 3071 | The following functions return window positions in pixels, relative | ||
| 3072 | to the display screen rather than the frame: | ||
| 3073 | |||
| 3074 | @defun window-absolute-pixel-edges &optional window | ||
| 3075 | This function is like @code{window-pixel-edges}, except that it | ||
| 3076 | returns the edge pixel coordinates relative to the top left corner of | ||
| 3077 | the display screen. | ||
| 3078 | @end defun | ||
| 3079 | |||
| 3080 | @defun window-inside-absolute-pixel-edges &optional window | ||
| 3081 | This function is like @code{window-inside-pixel-edges}, except that it | ||
| 3082 | returns the edge pixel coordinates relative to the top left corner of | ||
| 3083 | the display screen. @var{window} must specify a live window. | ||
| 3084 | @end defun | ||
| 3041 | 3085 | ||
| 3042 | @node Window Configurations | 3086 | @node Window Configurations |
| 3043 | @section Window Configurations | 3087 | @section Window Configurations |