aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
authorMiles Bader2004-07-23 04:30:44 +0000
committerMiles Bader2004-07-23 04:30:44 +0000
commit6bb4a8bf9aaa63141ad7c12ab6b6ba9939050178 (patch)
treeffe1b6fc55a6ef858938f3e80a9fd79ae096ad10 /src/window.c
parentcd9fc52e16bd2c780919c927bbf734039dd9a7dc (diff)
parent9586e1d3a4255c58bf827400ab7c038a3ee988a3 (diff)
downloademacs-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.c70
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
319DEFUN ("pos-visible-in-window-p", Fpos_visible_in_window_p, 320DEFUN ("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.
322Return nil if that position is scrolled vertically out of view. 323Return nil if that position is scrolled vertically out of view.
323If a character is only partially visible, nil is returned, unless the 324If a character is only partially visible, nil is returned, unless the
324optional argument PARTIALLY is non-nil. 325optional argument PARTIALLY is non-nil.
326If POS is only out of view because of horizontal scrolling, return non-nil.
325POS defaults to point in WINDOW; WINDOW defaults to the selected window. 327POS defaults to point in WINDOW; WINDOW defaults to the selected window.
326 328
327If POS is visible, return t if PARTIALLY is nil; if PARTIALLY is non-nil, 329If POS is visible, return t if PARTIALLY is nil; if PARTIALLY is non-nil,
328return value is a list (X Y PARTIAL) where X and Y are the pixel relative 330return value is a list (X Y FULLY) where X and Y are the pixel coordinates
329coordinate */) 331relative to the top left corner of the window, and FULLY is t if the
332character 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
431DEFUN ("set-window-hscroll", Fset_window_hscroll, Sset_window_hscroll, 2, 2, 0, 434DEFUN ("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.
433NCOL should be zero or positive. 436Return NCOL. NCOL should be zero or positive.
434 437
435Note that if `automatic-hscrolling' is non-nil, you cannot scroll the 438Note that if `automatic-hscrolling' is non-nil, you cannot scroll the
436window so that the location of point becomes invisible. */) 439window 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
546DEFUN ("window-inside-pixel-edges", Fwindow_inside_pixel_edges, Swindow_inside_pixel_edges, 0, 1, 0, 549DEFUN ("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.
549RIGHT is one more than the rightmost x position used by text in WINDOW, 552RIGHT is one more than the rightmost x position used by text in WINDOW,
550and BOTTOM is one more than the bottommost y position used by text in WINDOW. 553and 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,
986This is updated by redisplay, when it runs to completion. 989This is updated by redisplay, when it runs to completion.
987Simply changing the buffer text or setting `window-start' 990Simply changing the buffer text or setting `window-start'
988does not update this value. 991does not update this value.
992Return nil if there is no recorded value. \(This can happen if the
993last redisplay of WINDOW was preempted, and did not finish.)
989If UPDATE is non-nil, compute the up-to-date position 994If UPDATE is non-nil, compute the up-to-date position
990if it isn't already recorded. */) 995if 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
1053DEFUN ("set-window-point", Fset_window_point, Sset_window_point, 2, 2, 0, 1058DEFUN ("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.
1060Return 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
1075DEFUN ("set-window-start", Fset_window_start, Sset_window_start, 2, 3, 0, 1081DEFUN ("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.
1083Return POS.
1077Optional third arg NOFORCE non-nil inhibits next redisplay 1084Optional third arg NOFORCE non-nil inhibits next redisplay
1078from overriding motion of point in order to display at this exact start. */) 1085from 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
1799window_list_1 (window, minibuf, all_frames) 1806window_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
4840DEFUN ("scroll-up", Fscroll_up, Sscroll_up, 0, 1, "P", 4857DEFUN ("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.
4859If ARG is omitted or nil, scroll upward by a near full screen.
4842A near full screen is `next-screen-context-lines' less than a full screen. 4860A near full screen is `next-screen-context-lines' less than a full screen.
4843Negative ARG means scroll downward. 4861Negative ARG means scroll downward.
4844If ARG is the atom `-', scroll downward by nearly full screen. 4862If 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
4853DEFUN ("scroll-down", Fscroll_down, Sscroll_down, 0, 1, "P", 4871DEFUN ("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.
4873If ARG is omitted or nil, scroll down by a near full screen.
4855A near full screen is `next-screen-context-lines' less than a full screen. 4874A near full screen is `next-screen-context-lines' less than a full screen.
4856Negative ARG means scroll upward. 4875Negative ARG means scroll upward.
4857If ARG is the atom `-', scroll upward by nearly full screen. 4876If 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
4866DEFUN ("other-window-for-scrolling", Fother_window_for_scrolling, Sother_window_for_scrolling, 0, 0, 0, 4885DEFUN ("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.
4868If in the minibuffer, `minibuffer-scroll-window' if non-nil
4869specifies the window.
4870If `other-window-scroll-buffer' is non-nil, a window 4887If `other-window-scroll-buffer' is non-nil, a window
4871showing that buffer is used. */) 4888showing that buffer is used.
4889If in the minibuffer, `minibuffer-scroll-window' if non-nil
4890specifies 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.
4914If ARG is the atom `-', scroll downward by nearly full screen. 4934If ARG is the atom `-', scroll downward by nearly full screen.
4915When calling from a program, supply as argument a number, nil, or `-'. 4935When calling from a program, supply as argument a number, nil, or `-'.
4916 4936
4917If in the minibuffer, `minibuffer-scroll-window' if non-nil
4918specifies the window to scroll.
4919If `other-window-scroll-buffer' is non-nil, scroll the window 4937If `other-window-scroll-buffer' is non-nil, scroll the window
4920showing that buffer, popping the buffer up if necessary. */) 4938showing that buffer, popping the buffer up if necessary.
4939If in the minibuffer, `minibuffer-scroll-window' if non-nil
4940specifies 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
5894DEFUN ("save-window-excursion", Fsave_window_excursion, Ssave_window_excursion, 5915DEFUN ("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.
5918Return the value of the last form in BODY.
5897Restore which buffer appears in which window, where display starts, 5919Restore which buffer appears in which window, where display starts,
5898and the value of point and mark for each window. 5920and the value of point and mark for each window.
5899Also restore the choice of selected window. 5921Also 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.
6154WINDOW nil means use the selected window. Normally, VSCROLL is a 6176WINDOW nil means use the selected window. Normally, VSCROLL is a
6155non-negative multiple of the canonical character height of WINDOW; 6177non-negative multiple of the canonical character height of WINDOW;
6156optional third arg PIXELS_P non-nil means that VSCROLL is in pixels. */) 6178optional third arg PIXELS_P non-nil means that VSCROLL is in pixels.
6179If PIXELS-P is nil, VSCROLL may have to be rounded so that it
6180corresponds to an integral number of pixels. The return value is the
6181result of this rounding.
6182If 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.
6666If the value is`height', then only the window's height is fixed.
6667If the value is `width', then only the window's width is fixed.
6668Any other non-nil value fixes both the width and the height.
6640Emacs won't change the size of any window displaying that buffer, 6669Emacs won't change the size of any window displaying that buffer,
6641unless you explicitly change the size, or Emacs has no other choice. 6670unless you explicitly change the size, or Emacs has no other choice. */);
6642This 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