diff options
| author | Miles Bader | 2004-07-23 04:30:44 +0000 |
|---|---|---|
| committer | Miles Bader | 2004-07-23 04:30:44 +0000 |
| commit | 6bb4a8bf9aaa63141ad7c12ab6b6ba9939050178 (patch) | |
| tree | ffe1b6fc55a6ef858938f3e80a9fd79ae096ad10 /src/window.c | |
| parent | cd9fc52e16bd2c780919c927bbf734039dd9a7dc (diff) | |
| parent | 9586e1d3a4255c58bf827400ab7c038a3ee988a3 (diff) | |
| download | emacs-6bb4a8bf9aaa63141ad7c12ab6b6ba9939050178.tar.gz emacs-6bb4a8bf9aaa63141ad7c12ab6b6ba9939050178.zip | |
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-25
Merge from emacs--cvs-trunk--0
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-459
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-463
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-464
Update from CVS: lisp/progmodes/make-mode.el: Fix comments.
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-465
Update from CVS
Diffstat (limited to 'src/window.c')
| -rw-r--r-- | src/window.c | 70 |
1 files changed, 49 insertions, 21 deletions
diff --git a/src/window.c b/src/window.c index 62ce399e95c..1b1cab13e7a 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -260,6 +260,7 @@ make_window () | |||
| 260 | bzero (&p->last_cursor, sizeof (p->last_cursor)); | 260 | bzero (&p->last_cursor, sizeof (p->last_cursor)); |
| 261 | bzero (&p->phys_cursor, sizeof (p->phys_cursor)); | 261 | bzero (&p->phys_cursor, sizeof (p->phys_cursor)); |
| 262 | p->desired_matrix = p->current_matrix = 0; | 262 | p->desired_matrix = p->current_matrix = 0; |
| 263 | p->nrows_scale_factor = p->ncols_scale_factor = 1; | ||
| 263 | p->phys_cursor_type = -1; | 264 | p->phys_cursor_type = -1; |
| 264 | p->phys_cursor_width = -1; | 265 | p->phys_cursor_width = -1; |
| 265 | p->must_be_updated_p = 0; | 266 | p->must_be_updated_p = 0; |
| @@ -318,15 +319,17 @@ WINDOW defaults to the selected window. */) | |||
| 318 | 319 | ||
| 319 | DEFUN ("pos-visible-in-window-p", Fpos_visible_in_window_p, | 320 | DEFUN ("pos-visible-in-window-p", Fpos_visible_in_window_p, |
| 320 | Spos_visible_in_window_p, 0, 3, 0, | 321 | Spos_visible_in_window_p, 0, 3, 0, |
| 321 | doc: /* Return t if position POS is currently on the frame in WINDOW. | 322 | doc: /* Return non-nil if position POS is currently on the frame in WINDOW. |
| 322 | Return nil if that position is scrolled vertically out of view. | 323 | Return nil if that position is scrolled vertically out of view. |
| 323 | If a character is only partially visible, nil is returned, unless the | 324 | If a character is only partially visible, nil is returned, unless the |
| 324 | optional argument PARTIALLY is non-nil. | 325 | optional argument PARTIALLY is non-nil. |
| 326 | If POS is only out of view because of horizontal scrolling, return non-nil. | ||
| 325 | POS defaults to point in WINDOW; WINDOW defaults to the selected window. | 327 | POS defaults to point in WINDOW; WINDOW defaults to the selected window. |
| 326 | 328 | ||
| 327 | If POS is visible, return t if PARTIALLY is nil; if PARTIALLY is non-nil, | 329 | If POS is visible, return t if PARTIALLY is nil; if PARTIALLY is non-nil, |
| 328 | return value is a list (X Y PARTIAL) where X and Y are the pixel relative | 330 | return value is a list (X Y FULLY) where X and Y are the pixel coordinates |
| 329 | coordinate */) | 331 | relative to the top left corner of the window, and FULLY is t if the |
| 332 | character after POS is fully visible and nil otherwise. */) | ||
| 330 | (pos, window, partially) | 333 | (pos, window, partially) |
| 331 | Lisp_Object pos, window, partially; | 334 | Lisp_Object pos, window, partially; |
| 332 | { | 335 | { |
| @@ -430,7 +433,7 @@ DEFUN ("window-hscroll", Fwindow_hscroll, Swindow_hscroll, 0, 1, 0, | |||
| 430 | 433 | ||
| 431 | DEFUN ("set-window-hscroll", Fset_window_hscroll, Sset_window_hscroll, 2, 2, 0, | 434 | DEFUN ("set-window-hscroll", Fset_window_hscroll, Sset_window_hscroll, 2, 2, 0, |
| 432 | doc: /* Set number of columns WINDOW is scrolled from left margin to NCOL. | 435 | doc: /* Set number of columns WINDOW is scrolled from left margin to NCOL. |
| 433 | NCOL should be zero or positive. | 436 | Return NCOL. NCOL should be zero or positive. |
| 434 | 437 | ||
| 435 | Note that if `automatic-hscrolling' is non-nil, you cannot scroll the | 438 | Note that if `automatic-hscrolling' is non-nil, you cannot scroll the |
| 436 | window so that the location of point becomes invisible. */) | 439 | window so that the location of point becomes invisible. */) |
| @@ -544,7 +547,7 @@ display margins, fringes, header line, and/or mode line. */) | |||
| 544 | } | 547 | } |
| 545 | 548 | ||
| 546 | DEFUN ("window-inside-pixel-edges", Fwindow_inside_pixel_edges, Swindow_inside_pixel_edges, 0, 1, 0, | 549 | DEFUN ("window-inside-pixel-edges", Fwindow_inside_pixel_edges, Swindow_inside_pixel_edges, 0, 1, 0, |
| 547 | doc: /* Return a list of the edge coordinates of WINDOW. | 550 | doc: /* Return a list of the edge pixel coordinates of WINDOW. |
| 548 | \(LEFT TOP RIGHT BOTTOM), all relative to 0, 0 at top left corner of frame. | 551 | \(LEFT TOP RIGHT BOTTOM), all relative to 0, 0 at top left corner of frame. |
| 549 | RIGHT is one more than the rightmost x position used by text in WINDOW, | 552 | RIGHT is one more than the rightmost x position used by text in WINDOW, |
| 550 | and BOTTOM is one more than the bottommost y position used by text in WINDOW. | 553 | and BOTTOM is one more than the bottommost y position used by text in WINDOW. |
| @@ -670,7 +673,7 @@ coordinates_in_window (w, x, y) | |||
| 670 | 673 | ||
| 671 | /* Outside any interesting column? */ | 674 | /* Outside any interesting column? */ |
| 672 | if (*x < left_x || *x > right_x) | 675 | if (*x < left_x || *x > right_x) |
| 673 | return ON_NOTHING; | 676 | return ON_VERTICAL_BORDER; |
| 674 | 677 | ||
| 675 | lmargin_width = window_box_width (w, LEFT_MARGIN_AREA); | 678 | lmargin_width = window_box_width (w, LEFT_MARGIN_AREA); |
| 676 | rmargin_width = window_box_width (w, RIGHT_MARGIN_AREA); | 679 | rmargin_width = window_box_width (w, RIGHT_MARGIN_AREA); |
| @@ -986,6 +989,8 @@ DEFUN ("window-end", Fwindow_end, Swindow_end, 0, 2, 0, | |||
| 986 | This is updated by redisplay, when it runs to completion. | 989 | This is updated by redisplay, when it runs to completion. |
| 987 | Simply changing the buffer text or setting `window-start' | 990 | Simply changing the buffer text or setting `window-start' |
| 988 | does not update this value. | 991 | does not update this value. |
| 992 | Return nil if there is no recorded value. \(This can happen if the | ||
| 993 | last redisplay of WINDOW was preempted, and did not finish.) | ||
| 989 | If UPDATE is non-nil, compute the up-to-date position | 994 | If UPDATE is non-nil, compute the up-to-date position |
| 990 | if it isn't already recorded. */) | 995 | if it isn't already recorded. */) |
| 991 | (window, update) | 996 | (window, update) |
| @@ -1051,7 +1056,8 @@ if it isn't already recorded. */) | |||
| 1051 | } | 1056 | } |
| 1052 | 1057 | ||
| 1053 | DEFUN ("set-window-point", Fset_window_point, Sset_window_point, 2, 2, 0, | 1058 | DEFUN ("set-window-point", Fset_window_point, Sset_window_point, 2, 2, 0, |
| 1054 | doc: /* Make point value in WINDOW be at position POS in WINDOW's buffer. */) | 1059 | doc: /* Make point value in WINDOW be at position POS in WINDOW's buffer. |
| 1060 | Return POS. */) | ||
| 1055 | (window, pos) | 1061 | (window, pos) |
| 1056 | Lisp_Object window, pos; | 1062 | Lisp_Object window, pos; |
| 1057 | { | 1063 | { |
| @@ -1074,6 +1080,7 @@ DEFUN ("set-window-point", Fset_window_point, Sset_window_point, 2, 2, 0, | |||
| 1074 | 1080 | ||
| 1075 | DEFUN ("set-window-start", Fset_window_start, Sset_window_start, 2, 3, 0, | 1081 | DEFUN ("set-window-start", Fset_window_start, Sset_window_start, 2, 3, 0, |
| 1076 | doc: /* Make display in WINDOW start at position POS in WINDOW's buffer. | 1082 | doc: /* Make display in WINDOW start at position POS in WINDOW's buffer. |
| 1083 | Return POS. | ||
| 1077 | Optional third arg NOFORCE non-nil inhibits next redisplay | 1084 | Optional third arg NOFORCE non-nil inhibits next redisplay |
| 1078 | from overriding motion of point in order to display at this exact start. */) | 1085 | from overriding motion of point in order to display at this exact start. */) |
| 1079 | (window, pos, noforce) | 1086 | (window, pos, noforce) |
| @@ -1799,7 +1806,7 @@ static Lisp_Object | |||
| 1799 | window_list_1 (window, minibuf, all_frames) | 1806 | window_list_1 (window, minibuf, all_frames) |
| 1800 | Lisp_Object window, minibuf, all_frames; | 1807 | Lisp_Object window, minibuf, all_frames; |
| 1801 | { | 1808 | { |
| 1802 | Lisp_Object tail, list; | 1809 | Lisp_Object tail, list, rest; |
| 1803 | 1810 | ||
| 1804 | decode_next_window_args (&window, &minibuf, &all_frames); | 1811 | decode_next_window_args (&window, &minibuf, &all_frames); |
| 1805 | list = Qnil; | 1812 | list = Qnil; |
| @@ -1808,7 +1815,17 @@ window_list_1 (window, minibuf, all_frames) | |||
| 1808 | if (candidate_window_p (XCAR (tail), window, minibuf, all_frames)) | 1815 | if (candidate_window_p (XCAR (tail), window, minibuf, all_frames)) |
| 1809 | list = Fcons (XCAR (tail), list); | 1816 | list = Fcons (XCAR (tail), list); |
| 1810 | 1817 | ||
| 1811 | return Fnreverse (list); | 1818 | /* Rotate the list to start with WINDOW. */ |
| 1819 | list = Fnreverse (list); | ||
| 1820 | rest = Fmemq (window, list); | ||
| 1821 | if (!NILP (rest) && !EQ (rest, list)) | ||
| 1822 | { | ||
| 1823 | for (tail = list; XCDR (tail) != rest; tail = XCDR (tail)) | ||
| 1824 | ; | ||
| 1825 | XSETCDR (tail, Qnil); | ||
| 1826 | list = nconc2 (rest, list); | ||
| 1827 | } | ||
| 1828 | return list; | ||
| 1812 | } | 1829 | } |
| 1813 | 1830 | ||
| 1814 | 1831 | ||
| @@ -4838,7 +4855,8 @@ scroll_command (n, direction) | |||
| 4838 | } | 4855 | } |
| 4839 | 4856 | ||
| 4840 | DEFUN ("scroll-up", Fscroll_up, Sscroll_up, 0, 1, "P", | 4857 | DEFUN ("scroll-up", Fscroll_up, Sscroll_up, 0, 1, "P", |
| 4841 | doc: /* Scroll text of current window upward ARG lines; or near full screen if no ARG. | 4858 | doc: /* Scroll text of current window upward ARG lines. |
| 4859 | If ARG is omitted or nil, scroll upward by a near full screen. | ||
| 4842 | A near full screen is `next-screen-context-lines' less than a full screen. | 4860 | A near full screen is `next-screen-context-lines' less than a full screen. |
| 4843 | Negative ARG means scroll downward. | 4861 | Negative ARG means scroll downward. |
| 4844 | If ARG is the atom `-', scroll downward by nearly full screen. | 4862 | If ARG is the atom `-', scroll downward by nearly full screen. |
| @@ -4851,7 +4869,8 @@ When calling from a program, supply as argument a number, nil, or `-'. */) | |||
| 4851 | } | 4869 | } |
| 4852 | 4870 | ||
| 4853 | DEFUN ("scroll-down", Fscroll_down, Sscroll_down, 0, 1, "P", | 4871 | DEFUN ("scroll-down", Fscroll_down, Sscroll_down, 0, 1, "P", |
| 4854 | doc: /* Scroll text of current window down ARG lines; or near full screen if no ARG. | 4872 | doc: /* Scroll text of current window down ARG lines. |
| 4873 | If ARG is omitted or nil, scroll down by a near full screen. | ||
| 4855 | A near full screen is `next-screen-context-lines' less than a full screen. | 4874 | A near full screen is `next-screen-context-lines' less than a full screen. |
| 4856 | Negative ARG means scroll upward. | 4875 | Negative ARG means scroll upward. |
| 4857 | If ARG is the atom `-', scroll upward by nearly full screen. | 4876 | If ARG is the atom `-', scroll upward by nearly full screen. |
| @@ -4865,10 +4884,11 @@ When calling from a program, supply as argument a number, nil, or `-'. */) | |||
| 4865 | 4884 | ||
| 4866 | DEFUN ("other-window-for-scrolling", Fother_window_for_scrolling, Sother_window_for_scrolling, 0, 0, 0, | 4885 | DEFUN ("other-window-for-scrolling", Fother_window_for_scrolling, Sother_window_for_scrolling, 0, 0, 0, |
| 4867 | doc: /* Return the other window for \"other window scroll\" commands. | 4886 | doc: /* Return the other window for \"other window scroll\" commands. |
| 4868 | If in the minibuffer, `minibuffer-scroll-window' if non-nil | ||
| 4869 | specifies the window. | ||
| 4870 | If `other-window-scroll-buffer' is non-nil, a window | 4887 | If `other-window-scroll-buffer' is non-nil, a window |
| 4871 | showing that buffer is used. */) | 4888 | showing that buffer is used. |
| 4889 | If in the minibuffer, `minibuffer-scroll-window' if non-nil | ||
| 4890 | specifies the window. This takes precedence over | ||
| 4891 | `other-window-scroll-buffer'. */) | ||
| 4872 | () | 4892 | () |
| 4873 | { | 4893 | { |
| 4874 | Lisp_Object window; | 4894 | Lisp_Object window; |
| @@ -4914,10 +4934,11 @@ if the current one is at the bottom. Negative ARG means scroll downward. | |||
| 4914 | If ARG is the atom `-', scroll downward by nearly full screen. | 4934 | If ARG is the atom `-', scroll downward by nearly full screen. |
| 4915 | When calling from a program, supply as argument a number, nil, or `-'. | 4935 | When calling from a program, supply as argument a number, nil, or `-'. |
| 4916 | 4936 | ||
| 4917 | If in the minibuffer, `minibuffer-scroll-window' if non-nil | ||
| 4918 | specifies the window to scroll. | ||
| 4919 | If `other-window-scroll-buffer' is non-nil, scroll the window | 4937 | If `other-window-scroll-buffer' is non-nil, scroll the window |
| 4920 | showing that buffer, popping the buffer up if necessary. */) | 4938 | showing that buffer, popping the buffer up if necessary. |
| 4939 | If in the minibuffer, `minibuffer-scroll-window' if non-nil | ||
| 4940 | specifies the window to scroll. This takes precedence over | ||
| 4941 | `other-window-scroll-buffer'. */) | ||
| 4921 | (arg) | 4942 | (arg) |
| 4922 | Lisp_Object arg; | 4943 | Lisp_Object arg; |
| 4923 | { | 4944 | { |
| @@ -5893,7 +5914,8 @@ redirection (see `redirect-frame-focus'). */) | |||
| 5893 | 5914 | ||
| 5894 | DEFUN ("save-window-excursion", Fsave_window_excursion, Ssave_window_excursion, | 5915 | DEFUN ("save-window-excursion", Fsave_window_excursion, Ssave_window_excursion, |
| 5895 | 0, UNEVALLED, 0, | 5916 | 0, UNEVALLED, 0, |
| 5896 | doc: /* Execute body, preserving window sizes and contents. | 5917 | doc: /* Execute BODY, preserving window sizes and contents. |
| 5918 | Return the value of the last form in BODY. | ||
| 5897 | Restore which buffer appears in which window, where display starts, | 5919 | Restore which buffer appears in which window, where display starts, |
| 5898 | and the value of point and mark for each window. | 5920 | and the value of point and mark for each window. |
| 5899 | Also restore the choice of selected window. | 5921 | Also restore the choice of selected window. |
| @@ -6153,7 +6175,11 @@ DEFUN ("set-window-vscroll", Fset_window_vscroll, Sset_window_vscroll, | |||
| 6153 | doc: /* Set amount by which WINDOW should be scrolled vertically to VSCROLL. | 6175 | doc: /* Set amount by which WINDOW should be scrolled vertically to VSCROLL. |
| 6154 | WINDOW nil means use the selected window. Normally, VSCROLL is a | 6176 | WINDOW nil means use the selected window. Normally, VSCROLL is a |
| 6155 | non-negative multiple of the canonical character height of WINDOW; | 6177 | non-negative multiple of the canonical character height of WINDOW; |
| 6156 | optional third arg PIXELS_P non-nil means that VSCROLL is in pixels. */) | 6178 | optional third arg PIXELS_P non-nil means that VSCROLL is in pixels. |
| 6179 | If PIXELS-P is nil, VSCROLL may have to be rounded so that it | ||
| 6180 | corresponds to an integral number of pixels. The return value is the | ||
| 6181 | result of this rounding. | ||
| 6182 | If PIXELS-P is non-nil, the return value is VSCROLL. */) | ||
| 6157 | (window, vscroll, pixels_p) | 6183 | (window, vscroll, pixels_p) |
| 6158 | Lisp_Object window, vscroll, pixels_p; | 6184 | Lisp_Object window, vscroll, pixels_p; |
| 6159 | { | 6185 | { |
| @@ -6637,9 +6663,11 @@ The selected frame is the one whose configuration has changed. */); | |||
| 6637 | 6663 | ||
| 6638 | DEFVAR_BOOL ("window-size-fixed", &window_size_fixed, | 6664 | DEFVAR_BOOL ("window-size-fixed", &window_size_fixed, |
| 6639 | doc: /* Non-nil in a buffer means windows displaying the buffer are fixed-size. | 6665 | doc: /* Non-nil in a buffer means windows displaying the buffer are fixed-size. |
| 6666 | If the value is`height', then only the window's height is fixed. | ||
| 6667 | If the value is `width', then only the window's width is fixed. | ||
| 6668 | Any other non-nil value fixes both the width and the height. | ||
| 6640 | Emacs won't change the size of any window displaying that buffer, | 6669 | Emacs won't change the size of any window displaying that buffer, |
| 6641 | unless you explicitly change the size, or Emacs has no other choice. | 6670 | unless you explicitly change the size, or Emacs has no other choice. */); |
| 6642 | This variable automatically becomes buffer-local when set. */); | ||
| 6643 | Fmake_variable_buffer_local (Qwindow_size_fixed); | 6671 | Fmake_variable_buffer_local (Qwindow_size_fixed); |
| 6644 | window_size_fixed = 0; | 6672 | window_size_fixed = 0; |
| 6645 | 6673 | ||