comparison src/window.c @ 548:a7b7b759f694

*** empty log message ***
author Jim Blandy <jimb@redhat.com>
date Wed, 12 Feb 1992 03:35:14 +0000
parents bacdab90fa8b
children e09a318cf838
comparison
equal deleted inserted replaced
547:1856d835aac3 548:a7b7b759f694
423 423
424 return Qnil; 424 return Qnil;
425 } 425 }
426 426
427 DEFUN ("window-at", Fwindow_at, Swindow_at, 1, 2, 0, 427 DEFUN ("window-at", Fwindow_at, Swindow_at, 1, 2, 0,
428 "Return window containing position COORDINATES on SCREEN.\n\ 428 "Return window containing row ROW, column COLUMN on SCREEN.\n\
429 If omitted, SCREEN defaults to the currently selected screen.\n\ 429 If omitted, SCREEN defaults to the currently selected screen.\n\
430 COORDINATES is a pair (SCREEN-X . SCREEN-Y) of coordinates\n\ 430 The top left corner of the screen is considered to be row 0,\n\
431 which are relative to 0,0 at the top left corner of the screen.") 431 column 0.")
432 (coordinates, screen) 432 (row, column, screen)
433 Lisp_Object coordinates, screen; 433 Lisp_Object row, column, screen;
434 { 434 {
435 int part; 435 int part;
436 436
437 if (NILP (screen)) 437 if (NILP (screen))
438 XSET (screen, Lisp_Screen, selected_screen); 438 XSET (screen, Lisp_Screen, selected_screen);
439 else 439 else
440 CHECK_LIVE_SCREEN (screen, 0); 440 CHECK_LIVE_SCREEN (screen, 2);
441 CHECK_CONS (coordinates, 1); 441 CHECK_NUMBER (row, 0);
442 CHECK_NUMBER (XCONS (coordinates)->car, 1); 442 CHECK_NUMBER (column, 1);
443 CHECK_NUMBER (XCONS (coordinates)->cdr, 1);
444 443
445 return window_from_coordinates (XSCREEN (screen), 444 return window_from_coordinates (XSCREEN (screen),
446 XINT (Fcar (coordinates)), 445 XINT (row), XINT (column),
447 XINT (Fcdr (coordinates)),
448 &part); 446 &part);
449 } 447 }
450 448
451 DEFUN ("window-point", Fwindow_point, Swindow_point, 0, 1, 0, 449 DEFUN ("window-point", Fwindow_point, Swindow_point, 0, 1, 0,
452 "Return current value of point in WINDOW.\n\ 450 "Return current value of point in WINDOW.\n\
2005 int direction; 2003 int direction;
2006 { 2004 {
2007 register int defalt; 2005 register int defalt;
2008 int count = specpdl_ptr - specpdl; 2006 int count = specpdl_ptr - specpdl;
2009 2007
2010 /* Code here used to set the current buffer to the selected window's 2008 /* If selected window's buffer isn't current, make it current for the moment.
2011 buffer, but since this command always operates on the selected 2009 But don't screw up if window_scroll gets an error. */
2012 window, the current buffer should always be the selected window's
2013 buffer already. Verify this assumption, so we won't be screwed
2014 if we're guessing wrong. */
2015 if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer) 2010 if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer)
2016 abort (); 2011 {
2012 record_unwind_protect (save_excursion_restore, save_excursion_save ());
2013 Fset_buffer (XWINDOW (selected_window)->buffer);
2014 }
2017 2015
2018 defalt = (window_internal_height (XWINDOW (selected_window)) 2016 defalt = (window_internal_height (XWINDOW (selected_window))
2019 - next_screen_context_lines); 2017 - next_screen_context_lines);
2020 defalt = direction * (defalt < 1 ? 1 : defalt); 2018 defalt = direction * (defalt < 1 ? 1 : defalt);
2021 2019
2026 else 2024 else
2027 { 2025 {
2028 n = Fprefix_numeric_value (n); 2026 n = Fprefix_numeric_value (n);
2029 window_scroll (selected_window, XINT (n) * direction, 0); 2027 window_scroll (selected_window, XINT (n) * direction, 0);
2030 } 2028 }
2029
2030 unbind_to (count, Qnil);
2031 } 2031 }
2032 2032
2033 DEFUN ("scroll-up", Fscroll_up, Sscroll_up, 0, 1, "P", 2033 DEFUN ("scroll-up", Fscroll_up, Sscroll_up, 0, 1, "P",
2034 "Scroll text of current window upward ARG lines; or near full screen if no ARG.\n\ 2034 "Scroll text of current window upward ARG lines; or near full screen if no ARG.\n\
2035 A near full screen is `next-screen-context-lines' less than a full screen.\n\ 2035 A near full screen is `next-screen-context-lines' less than a full screen.\n\
2612 selected_window = selected_screen->selected_window; 2612 selected_window = selected_screen->selected_window;
2613 last_nonminibuf_screen = selected_screen; 2613 last_nonminibuf_screen = selected_screen;
2614 #else /* not MULTI_SCREEN */ 2614 #else /* not MULTI_SCREEN */
2615 extern Lisp_Object get_minibuffer (); 2615 extern Lisp_Object get_minibuffer ();
2616 2616
2617 root_window = make_window (0); 2617 root_window = make_window ();
2618 minibuf_window = make_window (0); 2618 minibuf_window = make_window ();
2619 2619
2620 XWINDOW (root_window)->next = minibuf_window; 2620 XWINDOW (root_window)->next = minibuf_window;
2621 XWINDOW (minibuf_window)->prev = root_window; 2621 XWINDOW (minibuf_window)->prev = root_window;
2622 2622
2623 /* These values 9 and 10 are arbitrary, 2623 /* These values 9 and 10 are arbitrary,