diff options
| author | Eli Zaretskii | 2011-11-04 12:09:41 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2011-11-04 12:09:41 +0200 |
| commit | 89bd5ee15acb93aefd403f3c76d1aff57520608b (patch) | |
| tree | f0b75789124fd62789f8642eec80b97c82c01fe1 | |
| parent | 56c31147dce7a3b3c40792be5b115a2e6dbcfe1d (diff) | |
| download | emacs-89bd5ee15acb93aefd403f3c76d1aff57520608b.tar.gz emacs-89bd5ee15acb93aefd403f3c76d1aff57520608b.zip | |
Fix documentation per bug #9949.
src/window.c (Fwindow_body_size): Mention in the doc string that the
return value is in frame's canonical units.
lisp/window.el (window-body-height, window-body-width): Mention in
the doc string that the return values are in frame's canonical
units.
doc/lispref/windows.texi (Window Sizes): Mention in the doc string that the
return values of `window-body-height' and `window-body-width' are
in frame's canonical units.
| -rw-r--r-- | doc/lispref/ChangeLog | 6 | ||||
| -rw-r--r-- | doc/lispref/windows.texi | 14 | ||||
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/window.el | 18 | ||||
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/window.c | 29 |
6 files changed, 64 insertions, 14 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 1e86e07998c..2da562bdcfb 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2011-11-04 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * windows.texi (Window Sizes): Mention in the doc string that the | ||
| 4 | return values of `window-body-height' and `window-body-width' are | ||
| 5 | in frame's canonical units. (Bug#9949) | ||
| 6 | |||
| 1 | 2011-10-30 Martin Rudalics <rudalics@gmx.at> | 7 | 2011-10-30 Martin Rudalics <rudalics@gmx.at> |
| 2 | 8 | ||
| 3 | * windows.texi (Windows and Frames): Remove "iso-" infix from | 9 | * windows.texi (Windows and Frames): Remove "iso-" infix from |
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 37679aa4a0b..bd20f5d8f44 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi | |||
| @@ -563,8 +563,18 @@ window's body width. | |||
| 563 | 563 | ||
| 564 | @cindex body size of a window | 564 | @cindex body size of a window |
| 565 | @cindex window body size | 565 | @cindex window body size |
| 566 | The following functions retrieve height and width of the body of a live | 566 | @cindex canonical units of window/frame size |
| 567 | window: | 567 | The following functions retrieve height and width of the body of a |
| 568 | live window. Note that the values these functions return are measured | ||
| 569 | in @dfn{canonical units}, i.e.@: for the default frame's face. If the | ||
| 570 | window shows some characters with non-default face, e.g., if the font | ||
| 571 | of some characters is larger or smaller than the default font, the | ||
| 572 | values returned by these functions will not match the actual number of | ||
| 573 | lines or characters per line shown in the window. To get the actual | ||
| 574 | number of columns and lines, move to the last character in the line | ||
| 575 | (e.g., with @code{end-of-visual-line}) or to the last line of the | ||
| 576 | window (e.g., with @code{window-end}), and use @code{posn-at-point} to | ||
| 577 | find the line or column there. | ||
| 568 | 578 | ||
| 569 | @defun window-body-size &optional window horizontal | 579 | @defun window-body-size &optional window horizontal |
| 570 | This function returns the number of lines of @var{window}'s text area. | 580 | This function returns the number of lines of @var{window}'s text area. |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6352a65e4fc..eb276721dbc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2011-11-04 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * window.el (window-body-height, window-body-width): Mention in | ||
| 4 | the doc string that the return values are in frame's canonical | ||
| 5 | units. (Bug#9949) | ||
| 6 | |||
| 1 | 2011-11-03 Alan Mackenzie <acm@muc.de> | 7 | 2011-11-03 Alan Mackenzie <acm@muc.de> |
| 2 | 8 | ||
| 3 | * progmodes/cc-langs.el (c-nonlabel-token-2-key): New variable for | 9 | * progmodes/cc-langs.el (c-nonlabel-token-2-key): New variable for |
diff --git a/lisp/window.el b/lisp/window.el index 9b12c204d48..d6ab5e0e6cc 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -972,7 +972,14 @@ The return value does not include WINDOW's mode line and header | |||
| 972 | line, if any. If a line at the bottom of the window is only | 972 | line, if any. If a line at the bottom of the window is only |
| 973 | partially visible, that line is included in the return value. If | 973 | partially visible, that line is included in the return value. If |
| 974 | you do not want to include a partially visible bottom line in the | 974 | you do not want to include a partially visible bottom line in the |
| 975 | return value, use `window-text-height' instead." | 975 | return value, use `window-text-height' instead. |
| 976 | |||
| 977 | Note that the return value is measured in canonical units, i.e. for | ||
| 978 | the default frame's face. If the window shows some characters with | ||
| 979 | non-default face, e.g., if the font of some characters is larger or | ||
| 980 | smaller than the default font, the value returned by this function | ||
| 981 | will not match the actual number of lines shown in the window. To | ||
| 982 | get the actual number of lines, use `posn-at-point'." | ||
| 976 | (window-body-size window)) | 983 | (window-body-size window)) |
| 977 | 984 | ||
| 978 | (defsubst window-body-width (&optional window) | 985 | (defsubst window-body-width (&optional window) |
| @@ -982,7 +989,14 @@ WINDOW must be a live window and defaults to the selected one. | |||
| 982 | The return value does not include any vertical dividers or scroll | 989 | The return value does not include any vertical dividers or scroll |
| 983 | bars owned by WINDOW. On a window-system the return value does | 990 | bars owned by WINDOW. On a window-system the return value does |
| 984 | not include the number of columns used for WINDOW's fringes or | 991 | not include the number of columns used for WINDOW's fringes or |
| 985 | display margins either." | 992 | display margins either. |
| 993 | |||
| 994 | Note that the return value is measured in canonical units, i.e. for | ||
| 995 | the default frame's face. If the window shows some characters with | ||
| 996 | non-default face, e.g., if the font of some characters is larger or | ||
| 997 | smaller than the default font, the value returned by this function | ||
| 998 | will not match the actual number of characters per line shown in the | ||
| 999 | window. To get the actual number of columns, use `posn-at-point'." | ||
| 986 | (window-body-size window t)) | 1000 | (window-body-size window t)) |
| 987 | 1001 | ||
| 988 | ;; Eventually we should make `window-height' obsolete. | 1002 | ;; Eventually we should make `window-height' obsolete. |
diff --git a/src/ChangeLog b/src/ChangeLog index f198f37d0c1..ccfcb48daf0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2011-11-04 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * window.c (Fwindow_body_size): Mention in the doc string that the | ||
| 4 | return value is in frame's canonical units. (Bug#9949) | ||
| 5 | |||
| 1 | 2011-11-03 Eli Zaretskii <eliz@gnu.org> | 6 | 2011-11-03 Eli Zaretskii <eliz@gnu.org> |
| 2 | 7 | ||
| 3 | * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947) | 8 | * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947) |
diff --git a/src/window.c b/src/window.c index 422073b1bd3..6b3b7f2a471 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -653,16 +653,25 @@ window_body_cols (struct window *w) | |||
| 653 | } | 653 | } |
| 654 | 654 | ||
| 655 | DEFUN ("window-body-size", Fwindow_body_size, Swindow_body_size, 0, 2, 0, | 655 | DEFUN ("window-body-size", Fwindow_body_size, Swindow_body_size, 0, 2, 0, |
| 656 | doc: /* Return the number of lines of WINDOW's body. | 656 | doc: /* Return the number of lines or columns of WINDOW's body. |
| 657 | WINDOW must be a live window and defaults to the selected one. The | 657 | WINDOW must be a live window and defaults to the selected one. |
| 658 | return value does not include WINDOW's mode line and header line, if | 658 | |
| 659 | any. | 659 | If the optional argument HORIZONTAL is omitted or nil, the function |
| 660 | 660 | returns the number of WINDOW's lines, excluding the mode line and | |
| 661 | Optional argument HORIZONTAL non-nil means return the number of columns | 661 | header line, if any. |
| 662 | of WINDOW's body. In this case, the return value does not include any | 662 | |
| 663 | vertical dividers or scroll bars owned by WINDOW. On a window-system | 663 | If HORIZONTAL is non-nil, the function returns the number of columns |
| 664 | the return value does not include the number of columns used for | 664 | excluding any vertical dividers or scroll bars owned by WINDOW. On a |
| 665 | WINDOW's fringes or display margins either. */) | 665 | window-system the return value also excludes the number of columns |
| 666 | used for WINDOW's fringes or display margins. | ||
| 667 | |||
| 668 | Note that the return value is measured in canonical units, i.e. for | ||
| 669 | the default frame's face. If the window shows some characters with | ||
| 670 | non-default face, e.g., if the font of some characters is larger or | ||
| 671 | smaller than the default font, the value returned by this function | ||
| 672 | will not match the actual number of lines or characters per line | ||
| 673 | shown in the window. To get the actual number of columns and lines, | ||
| 674 | use `posn-at-point'. */) | ||
| 666 | (Lisp_Object window, Lisp_Object horizontal) | 675 | (Lisp_Object window, Lisp_Object horizontal) |
| 667 | { | 676 | { |
| 668 | struct window *w = decode_any_window (window); | 677 | struct window *w = decode_any_window (window); |