comparison src/window.c @ 89956:b9eee0a7bef5

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
author Miles Bader <miles@gnu.org>
date Fri, 23 Jul 2004 04:30:44 +0000
parents 029a652ac817 8f77d7fac4d6
children c08afac24467
comparison
equal deleted inserted replaced
89955:7f8b53f94713 89956:b9eee0a7bef5
258 p->pseudo_window_p = 0; 258 p->pseudo_window_p = 0;
259 bzero (&p->cursor, sizeof (p->cursor)); 259 bzero (&p->cursor, sizeof (p->cursor));
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;
266 XSETFASTINT (p->window_end_vpos, 0); 267 XSETFASTINT (p->window_end_vpos, 0);
267 XSETFASTINT (p->window_end_pos, 0); 268 XSETFASTINT (p->window_end_pos, 0);
316 } 317 }
317 318
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 {
333 register struct window *w; 336 register struct window *w;
334 register int posint; 337 register int posint;
428 return decode_window (window)->hscroll; 431 return decode_window (window)->hscroll;
429 } 432 }
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. */)
437 (window, ncol) 440 (window, ncol)
438 Lisp_Object window, ncol; 441 Lisp_Object window, ncol;
542 make_number (WINDOW_BOTTOM_EDGE_LINE (w) 545 make_number (WINDOW_BOTTOM_EDGE_LINE (w)
543 - WINDOW_MODE_LINE_LINES (w))); 546 - WINDOW_MODE_LINE_LINES (w)));
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.
551 The inside edges do not include the space used by the window's scroll bar, 554 The inside edges do not include the space used by the window's scroll bar,
552 display margins, fringes, header line, and/or mode line. */) 555 display margins, fringes, header line, and/or mode line. */)
668 goto header_vertical_border_check; 671 goto header_vertical_border_check;
669 } 672 }
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);
677 680
678 text_left = window_box_left (w, TEXT_AREA); 681 text_left = window_box_left (w, TEXT_AREA);
984 DEFUN ("window-end", Fwindow_end, Swindow_end, 0, 2, 0, 987 DEFUN ("window-end", Fwindow_end, Swindow_end, 0, 2, 0,
985 doc: /* Return position at which display currently ends in WINDOW. 988 doc: /* Return position at which display currently ends in WINDOW.
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)
992 Lisp_Object window, update; 997 Lisp_Object window, update;
993 { 998 {
1049 1054
1050 return value; 1055 return value;
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 {
1058 register struct window *w = decode_window (window); 1064 register struct window *w = decode_window (window);
1059 1065
1072 return pos; 1078 return pos;
1073 } 1079 }
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)
1080 Lisp_Object window, pos, noforce; 1087 Lisp_Object window, pos, noforce;
1081 { 1088 {
1797 1804
1798 static Lisp_Object 1805 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;
1806 1813
1807 for (tail = window_list (); CONSP (tail); tail = XCDR (tail)) 1814 for (tail = window_list (); CONSP (tail); tail = XCDR (tail))
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
1815 1832
1816 /* Look at all windows, performing an operation specified by TYPE 1833 /* Look at all windows, performing an operation specified by TYPE
4836 4853
4837 unbind_to (count, Qnil); 4854 unbind_to (count, Qnil);
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.
4845 When calling from a program, supply as argument a number, nil, or `-'. */) 4863 When calling from a program, supply as argument a number, nil, or `-'. */)
4846 (arg) 4864 (arg)
4849 scroll_command (arg, 1); 4867 scroll_command (arg, 1);
4850 return Qnil; 4868 return Qnil;
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.
4858 When calling from a program, supply as argument a number, nil, or `-'. */) 4877 When calling from a program, supply as argument a number, nil, or `-'. */)
4859 (arg) 4878 (arg)
4863 return Qnil; 4882 return Qnil;
4864 } 4883 }
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.
4887 If `other-window-scroll-buffer' is non-nil, a window
4888 showing that buffer is used.
4868 If in the minibuffer, `minibuffer-scroll-window' if non-nil 4889 If in the minibuffer, `minibuffer-scroll-window' if non-nil
4869 specifies the window. 4890 specifies the window. This takes precedence over
4870 If `other-window-scroll-buffer' is non-nil, a window 4891 `other-window-scroll-buffer'. */)
4871 showing that buffer is used. */)
4872 () 4892 ()
4873 { 4893 {
4874 Lisp_Object window; 4894 Lisp_Object window;
4875 4895
4876 if (MINI_WINDOW_P (XWINDOW (selected_window)) 4896 if (MINI_WINDOW_P (XWINDOW (selected_window))
4912 The next window is the one below the current one; or the one at the top 4932 The next window is the one below the current one; or the one at the top
4913 if the current one is at the bottom. Negative ARG means scroll downward. 4933 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
4937 If `other-window-scroll-buffer' is non-nil, scroll the window
4938 showing that buffer, popping the buffer up if necessary.
4917 If in the minibuffer, `minibuffer-scroll-window' if non-nil 4939 If in the minibuffer, `minibuffer-scroll-window' if non-nil
4918 specifies the window to scroll. 4940 specifies the window to scroll. This takes precedence over
4919 If `other-window-scroll-buffer' is non-nil, scroll the window 4941 `other-window-scroll-buffer'. */)
4920 showing that buffer, popping the buffer up if necessary. */)
4921 (arg) 4942 (arg)
4922 Lisp_Object arg; 4943 Lisp_Object arg;
4923 { 4944 {
4924 Lisp_Object window; 4945 Lisp_Object window;
4925 struct window *w; 4946 struct window *w;
5891 return (tem); 5912 return (tem);
5892 } 5913 }
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.
5900 Also restore which buffer is current. 5922 Also restore which buffer is current.
5901 Does not restore the value of point in current buffer. 5923 Does not restore the value of point in current buffer.
6151 DEFUN ("set-window-vscroll", Fset_window_vscroll, Sset_window_vscroll, 6173 DEFUN ("set-window-vscroll", Fset_window_vscroll, Sset_window_vscroll,
6152 2, 3, 0, 6174 2, 3, 0,
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 {
6160 struct window *w; 6186 struct window *w;
6161 struct frame *f; 6187 struct frame *f;
6635 The selected frame is the one whose configuration has changed. */); 6661 The selected frame is the one whose configuration has changed. */);
6636 Vwindow_configuration_change_hook = Qnil; 6662 Vwindow_configuration_change_hook = Qnil;
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
6646 defsubr (&Sselected_window); 6674 defsubr (&Sselected_window);
6647 defsubr (&Sminibuffer_window); 6675 defsubr (&Sminibuffer_window);