comparison src/window.c @ 59700:c401b93db575

* window.c (Fpos_visible_in_window_p): Simplify return value for partially visible rows. (window_scroll_pixel_based): Adapt to that change.
author Kim F. Storm <storm@cua.dk>
date Sun, 23 Jan 2005 13:13:03 +0000
parents 75b50deae4e9
children 351ffb20ab9f
comparison
equal deleted inserted replaced
59699:6491ad700699 59700:c401b93db575
331 optional argument PARTIALLY is non-nil. 331 optional argument PARTIALLY is non-nil.
332 If POS is only out of view because of horizontal scrolling, return non-nil. 332 If POS is only out of view because of horizontal scrolling, return non-nil.
333 POS defaults to point in WINDOW; WINDOW defaults to the selected window. 333 POS defaults to point in WINDOW; WINDOW defaults to the selected window.
334 334
335 If POS is visible, return t if PARTIALLY is nil; if PARTIALLY is non-nil, 335 If POS is visible, return t if PARTIALLY is nil; if PARTIALLY is non-nil,
336 return value is a list (X Y FULLY [RTOP RBOT]) where X and Y are the pixel 336 return value is a list (X Y PARTIAL) where X and Y are the pixel coordinates
337 coordinates relative to the top left corner of the window, and FULLY is t if the 337 relative to the top left corner of the window. PARTIAL is nil if the character
338 character after POS is fully visible and nil otherwise. If FULLY is nil, 338 after POS is fully visible; otherwise it is a cons (RTOP . RBOT) where RTOP
339 RTOP and RBOT are the number of pixels invisible at the top and bottom row 339 and RBOT are the number of pixels invisible at the top and bottom of the row. */)
340 of the window. */)
341 (pos, window, partially) 340 (pos, window, partially)
342 Lisp_Object pos, window, partially; 341 Lisp_Object pos, window, partially;
343 { 342 {
344 register struct window *w; 343 register struct window *w;
345 register int posint; 344 register int posint;
374 in_window = Qt; 373 in_window = Qt;
375 374
376 if (!NILP (in_window) && !NILP (partially)) 375 if (!NILP (in_window) && !NILP (partially))
377 in_window = Fcons (make_number (x), 376 in_window = Fcons (make_number (x),
378 Fcons (make_number (y), 377 Fcons (make_number (y),
379 Fcons (fully_p ? Qt : Qnil, 378 Fcons ((fully_p ? Qnil
380 (fully_p 379 : Fcons (make_number (rtop),
381 ? Qnil 380 make_number (rbot))),
382 : Fcons (make_number (rtop), 381 Qnil)));
383 Fcons (make_number (rbot),
384 Qnil))))));
385 return in_window; 382 return in_window;
386 } 383 }
387 384
388 385
389 static struct window * 386 static struct window *
4576 4573
4577 start = it.current.pos; 4574 start = it.current.pos;
4578 } 4575 }
4579 else if (auto_window_vscroll_p) 4576 else if (auto_window_vscroll_p)
4580 { 4577 {
4581 if (NILP (XCAR (XCDR (XCDR (tem))))) 4578 if (tem = XCAR (XCDR (XCDR (tem))), CONSP (tem))
4582 { 4579 {
4583 int px; 4580 int px;
4584 int dy = WINDOW_FRAME_LINE_HEIGHT (w); 4581 int dy = WINDOW_FRAME_LINE_HEIGHT (w);
4585 if (whole) 4582 if (whole)
4586 dy = window_box_height (w) - next_screen_context_lines * dy; 4583 dy = window_box_height (w) - next_screen_context_lines * dy;
4587 dy *= n; 4584 dy *= n;
4588 4585
4589 if (n < 0 && (px = XINT (Fnth (make_number (3), tem))) > 0) 4586 if (n < 0 && (px = XINT (XCAR (tem))) > 0)
4590 { 4587 {
4591 px = max (0, -w->vscroll - min (px, -dy)); 4588 px = max (0, -w->vscroll - min (px, -dy));
4592 Fset_window_vscroll (window, make_number (px), Qt); 4589 Fset_window_vscroll (window, make_number (px), Qt);
4593 return; 4590 return;
4594 } 4591 }
4595 if (n > 0 && (px = XINT (Fnth (make_number (4), tem))) > 0) 4592 if (n > 0 && (px = XINT (XCDR (tem))) > 0)
4596 { 4593 {
4597 px = max (0, -w->vscroll + min (px, dy)); 4594 px = max (0, -w->vscroll + min (px, dy));
4598 Fset_window_vscroll (window, make_number (px), Qt); 4595 Fset_window_vscroll (window, make_number (px), Qt);
4599 return; 4596 return;
4600 } 4597 }