Mercurial > emacs
comparison src/window.c @ 109428:5ba21f4a3d62
Merge from mainline.
author | Katsumi Yamaoka <yamaoka@jpl.org> |
---|---|
date | Thu, 08 Jul 2010 22:47:34 +0000 |
parents | 8cfee7d2955f |
children | a4b9fa0b861b |
comparison
equal
deleted
inserted
replaced
109427:9d1a0d3d72be | 109428:5ba21f4a3d62 |
---|---|
203 extern Lisp_Object Qtty; | 203 extern Lisp_Object Qtty; |
204 | 204 |
205 | 205 |
206 DEFUN ("windowp", Fwindowp, Swindowp, 1, 1, 0, | 206 DEFUN ("windowp", Fwindowp, Swindowp, 1, 1, 0, |
207 doc: /* Return t if OBJECT is a window. */) | 207 doc: /* Return t if OBJECT is a window. */) |
208 (object) | 208 (Lisp_Object object) |
209 Lisp_Object object; | |
210 { | 209 { |
211 return WINDOWP (object) ? Qt : Qnil; | 210 return WINDOWP (object) ? Qt : Qnil; |
212 } | 211 } |
213 | 212 |
214 DEFUN ("window-live-p", Fwindow_live_p, Swindow_live_p, 1, 1, 0, | 213 DEFUN ("window-live-p", Fwindow_live_p, Swindow_live_p, 1, 1, 0, |
215 doc: /* Return t if OBJECT is a window which is currently visible. */) | 214 doc: /* Return t if OBJECT is a window which is currently visible. */) |
216 (object) | 215 (Lisp_Object object) |
217 Lisp_Object object; | |
218 { | 216 { |
219 return WINDOW_LIVE_P (object) ? Qt : Qnil; | 217 return WINDOW_LIVE_P (object) ? Qt : Qnil; |
220 } | 218 } |
221 | 219 |
222 Lisp_Object | 220 Lisp_Object |
241 p->frame = Qnil; | 239 p->frame = Qnil; |
242 p->display_table = Qnil; | 240 p->display_table = Qnil; |
243 p->dedicated = Qnil; | 241 p->dedicated = Qnil; |
244 p->window_parameters = Qnil; | 242 p->window_parameters = Qnil; |
245 p->pseudo_window_p = 0; | 243 p->pseudo_window_p = 0; |
246 bzero (&p->cursor, sizeof (p->cursor)); | 244 memset (&p->cursor, 0, sizeof (p->cursor)); |
247 bzero (&p->last_cursor, sizeof (p->last_cursor)); | 245 memset (&p->last_cursor, 0, sizeof (p->last_cursor)); |
248 bzero (&p->phys_cursor, sizeof (p->phys_cursor)); | 246 memset (&p->phys_cursor, 0, sizeof (p->phys_cursor)); |
249 p->desired_matrix = p->current_matrix = 0; | 247 p->desired_matrix = p->current_matrix = 0; |
250 p->nrows_scale_factor = p->ncols_scale_factor = 1; | 248 p->nrows_scale_factor = p->ncols_scale_factor = 1; |
251 p->phys_cursor_type = -1; | 249 p->phys_cursor_type = -1; |
252 p->phys_cursor_width = -1; | 250 p->phys_cursor_width = -1; |
253 p->must_be_updated_p = 0; | 251 p->must_be_updated_p = 0; |
272 return val; | 270 return val; |
273 } | 271 } |
274 | 272 |
275 DEFUN ("selected-window", Fselected_window, Sselected_window, 0, 0, 0, | 273 DEFUN ("selected-window", Fselected_window, Sselected_window, 0, 0, 0, |
276 doc: /* Return the window that the cursor now appears in and commands apply to. */) | 274 doc: /* Return the window that the cursor now appears in and commands apply to. */) |
277 () | 275 (void) |
278 { | 276 { |
279 return selected_window; | 277 return selected_window; |
280 } | 278 } |
281 | 279 |
282 DEFUN ("minibuffer-window", Fminibuffer_window, Sminibuffer_window, 0, 1, 0, | 280 DEFUN ("minibuffer-window", Fminibuffer_window, Sminibuffer_window, 0, 1, 0, |
283 doc: /* Return the window used now for minibuffers. | 281 doc: /* Return the window used now for minibuffers. |
284 If the optional argument FRAME is specified, return the minibuffer window | 282 If the optional argument FRAME is specified, return the minibuffer window |
285 used by that frame. */) | 283 used by that frame. */) |
286 (frame) | 284 (Lisp_Object frame) |
287 Lisp_Object frame; | |
288 { | 285 { |
289 if (NILP (frame)) | 286 if (NILP (frame)) |
290 frame = selected_frame; | 287 frame = selected_frame; |
291 CHECK_LIVE_FRAME (frame); | 288 CHECK_LIVE_FRAME (frame); |
292 return FRAME_MINIBUF_WINDOW (XFRAME (frame)); | 289 return FRAME_MINIBUF_WINDOW (XFRAME (frame)); |
293 } | 290 } |
294 | 291 |
295 DEFUN ("window-minibuffer-p", Fwindow_minibuffer_p, Swindow_minibuffer_p, 0, 1, 0, | 292 DEFUN ("window-minibuffer-p", Fwindow_minibuffer_p, Swindow_minibuffer_p, 0, 1, 0, |
296 doc: /* Return non-nil if WINDOW is a minibuffer window. | 293 doc: /* Return non-nil if WINDOW is a minibuffer window. |
297 WINDOW defaults to the selected window. */) | 294 WINDOW defaults to the selected window. */) |
298 (window) | 295 (Lisp_Object window) |
299 Lisp_Object window; | |
300 { | 296 { |
301 struct window *w = decode_window (window); | 297 struct window *w = decode_window (window); |
302 return MINI_WINDOW_P (w) ? Qt : Qnil; | 298 return MINI_WINDOW_P (w) ? Qt : Qnil; |
303 } | 299 } |
304 | 300 |
318 where X and Y are the pixel coordinates relative to the top left corner | 314 where X and Y are the pixel coordinates relative to the top left corner |
319 of the window. The remaining elements are omitted if the character after | 315 of the window. The remaining elements are omitted if the character after |
320 POS is fully visible; otherwise, RTOP and RBOT are the number of pixels | 316 POS is fully visible; otherwise, RTOP and RBOT are the number of pixels |
321 off-window at the top and bottom of the row, ROWH is the height of the | 317 off-window at the top and bottom of the row, ROWH is the height of the |
322 display row, and VPOS is the row number (0-based) containing POS. */) | 318 display row, and VPOS is the row number (0-based) containing POS. */) |
323 (pos, window, partially) | 319 (Lisp_Object pos, Lisp_Object window, Lisp_Object partially) |
324 Lisp_Object pos, window, partially; | |
325 { | 320 { |
326 register struct window *w; | 321 register struct window *w; |
327 register int posint; | 322 register int posint; |
328 register struct buffer *buf; | 323 register struct buffer *buf; |
329 struct text_pos top; | 324 struct text_pos top; |
387 the bottom of the text line. If there are off-window pixels at the top | 382 the bottom of the text line. If there are off-window pixels at the top |
388 of the (first) text line, YPOS is negative. | 383 of the (first) text line, YPOS is negative. |
389 | 384 |
390 Return nil if window display is not up-to-date. In that case, use | 385 Return nil if window display is not up-to-date. In that case, use |
391 `pos-visible-in-window-p' to obtain the information. */) | 386 `pos-visible-in-window-p' to obtain the information. */) |
392 (line, window) | 387 (Lisp_Object line, Lisp_Object window) |
393 Lisp_Object line, window; | |
394 { | 388 { |
395 register struct window *w; | 389 register struct window *w; |
396 register struct buffer *b; | 390 register struct buffer *b; |
397 struct glyph_row *row, *end_row; | 391 struct glyph_row *row, *end_row; |
398 int max_y, crop, i, n; | 392 int max_y, crop, i, n; |
503 } | 497 } |
504 | 498 |
505 DEFUN ("window-buffer", Fwindow_buffer, Swindow_buffer, 0, 1, 0, | 499 DEFUN ("window-buffer", Fwindow_buffer, Swindow_buffer, 0, 1, 0, |
506 doc: /* Return the buffer that WINDOW is displaying. | 500 doc: /* Return the buffer that WINDOW is displaying. |
507 WINDOW defaults to the selected window. */) | 501 WINDOW defaults to the selected window. */) |
508 (window) | 502 (Lisp_Object window) |
509 Lisp_Object window; | |
510 { | 503 { |
511 return decode_window (window)->buffer; | 504 return decode_window (window)->buffer; |
512 } | 505 } |
513 | 506 |
514 DEFUN ("window-height", Fwindow_height, Swindow_height, 0, 1, 0, | 507 DEFUN ("window-height", Fwindow_height, Swindow_height, 0, 1, 0, |
515 doc: /* Return the number of lines in WINDOW. | 508 doc: /* Return the number of lines in WINDOW. |
516 WINDOW defaults to the selected window. | 509 WINDOW defaults to the selected window. |
517 | 510 |
518 The return value includes WINDOW's mode line and header line, if any. */) | 511 The return value includes WINDOW's mode line and header line, if any. */) |
519 (window) | 512 (Lisp_Object window) |
520 Lisp_Object window; | |
521 { | 513 { |
522 return decode_any_window (window)->total_lines; | 514 return decode_any_window (window)->total_lines; |
523 } | 515 } |
524 | 516 |
525 DEFUN ("window-width", Fwindow_width, Swindow_width, 0, 1, 0, | 517 DEFUN ("window-width", Fwindow_width, Swindow_width, 0, 1, 0, |
527 WINDOW defaults to the selected window. | 519 WINDOW defaults to the selected window. |
528 | 520 |
529 Note: The return value is the number of columns available for text in | 521 Note: The return value is the number of columns available for text in |
530 WINDOW. If you want to find out how many columns WINDOW takes up, use | 522 WINDOW. If you want to find out how many columns WINDOW takes up, use |
531 (let ((edges (window-edges))) (- (nth 2 edges) (nth 0 edges))). */) | 523 (let ((edges (window-edges))) (- (nth 2 edges) (nth 0 edges))). */) |
532 (window) | 524 (Lisp_Object window) |
533 Lisp_Object window; | |
534 { | 525 { |
535 return make_number (window_box_text_cols (decode_any_window (window))); | 526 return make_number (window_box_text_cols (decode_any_window (window))); |
536 } | 527 } |
537 | 528 |
538 DEFUN ("window-full-width-p", Fwindow_full_width_p, Swindow_full_width_p, 0, 1, 0, | 529 DEFUN ("window-full-width-p", Fwindow_full_width_p, Swindow_full_width_p, 0, 1, 0, |
539 doc: /* Return t if WINDOW is as wide as its frame. | 530 doc: /* Return t if WINDOW is as wide as its frame. |
540 WINDOW defaults to the selected window. */) | 531 WINDOW defaults to the selected window. */) |
541 (window) | 532 (Lisp_Object window) |
542 Lisp_Object window; | |
543 { | 533 { |
544 return WINDOW_FULL_WIDTH_P (decode_any_window (window)) ? Qt : Qnil; | 534 return WINDOW_FULL_WIDTH_P (decode_any_window (window)) ? Qt : Qnil; |
545 } | 535 } |
546 | 536 |
547 DEFUN ("window-hscroll", Fwindow_hscroll, Swindow_hscroll, 0, 1, 0, | 537 DEFUN ("window-hscroll", Fwindow_hscroll, Swindow_hscroll, 0, 1, 0, |
548 doc: /* Return the number of columns by which WINDOW is scrolled from left margin. | 538 doc: /* Return the number of columns by which WINDOW is scrolled from left margin. |
549 WINDOW defaults to the selected window. */) | 539 WINDOW defaults to the selected window. */) |
550 (window) | 540 (Lisp_Object window) |
551 Lisp_Object window; | |
552 { | 541 { |
553 return decode_window (window)->hscroll; | 542 return decode_window (window)->hscroll; |
554 } | 543 } |
555 | 544 |
556 DEFUN ("set-window-hscroll", Fset_window_hscroll, Sset_window_hscroll, 2, 2, 0, | 545 DEFUN ("set-window-hscroll", Fset_window_hscroll, Sset_window_hscroll, 2, 2, 0, |
557 doc: /* Set number of columns WINDOW is scrolled from left margin to NCOL. | 546 doc: /* Set number of columns WINDOW is scrolled from left margin to NCOL. |
558 Return NCOL. NCOL should be zero or positive. | 547 Return NCOL. NCOL should be zero or positive. |
559 | 548 |
560 Note that if `automatic-hscrolling' is non-nil, you cannot scroll the | 549 Note that if `automatic-hscrolling' is non-nil, you cannot scroll the |
561 window so that the location of point moves off-window. */) | 550 window so that the location of point moves off-window. */) |
562 (window, ncol) | 551 (Lisp_Object window, Lisp_Object ncol) |
563 Lisp_Object window, ncol; | |
564 { | 552 { |
565 struct window *w = decode_window (window); | 553 struct window *w = decode_window (window); |
566 int hscroll; | 554 int hscroll; |
567 | 555 |
568 CHECK_NUMBER (ncol); | 556 CHECK_NUMBER (ncol); |
579 DEFUN ("window-redisplay-end-trigger", Fwindow_redisplay_end_trigger, | 567 DEFUN ("window-redisplay-end-trigger", Fwindow_redisplay_end_trigger, |
580 Swindow_redisplay_end_trigger, 0, 1, 0, | 568 Swindow_redisplay_end_trigger, 0, 1, 0, |
581 doc: /* Return WINDOW's redisplay end trigger value. | 569 doc: /* Return WINDOW's redisplay end trigger value. |
582 WINDOW defaults to the selected window. | 570 WINDOW defaults to the selected window. |
583 See `set-window-redisplay-end-trigger' for more information. */) | 571 See `set-window-redisplay-end-trigger' for more information. */) |
584 (window) | 572 (Lisp_Object window) |
585 Lisp_Object window; | |
586 { | 573 { |
587 return decode_window (window)->redisplay_end_trigger; | 574 return decode_window (window)->redisplay_end_trigger; |
588 } | 575 } |
589 | 576 |
590 DEFUN ("set-window-redisplay-end-trigger", Fset_window_redisplay_end_trigger, | 577 DEFUN ("set-window-redisplay-end-trigger", Fset_window_redisplay_end_trigger, |
593 VALUE should be a buffer position (typically a marker) or nil. | 580 VALUE should be a buffer position (typically a marker) or nil. |
594 If it is a buffer position, then if redisplay in WINDOW reaches a position | 581 If it is a buffer position, then if redisplay in WINDOW reaches a position |
595 beyond VALUE, the functions in `redisplay-end-trigger-functions' are called | 582 beyond VALUE, the functions in `redisplay-end-trigger-functions' are called |
596 with two arguments: WINDOW, and the end trigger value. | 583 with two arguments: WINDOW, and the end trigger value. |
597 Afterwards the end-trigger value is reset to nil. */) | 584 Afterwards the end-trigger value is reset to nil. */) |
598 (window, value) | 585 (register Lisp_Object window, Lisp_Object value) |
599 register Lisp_Object window, value; | |
600 { | 586 { |
601 register struct window *w; | 587 register struct window *w; |
602 | 588 |
603 w = decode_window (window); | 589 w = decode_window (window); |
604 w->redisplay_end_trigger = value; | 590 w->redisplay_end_trigger = value; |
614 RIGHT is one more than the rightmost column occupied by WINDOW. | 600 RIGHT is one more than the rightmost column occupied by WINDOW. |
615 BOTTOM is one more than the bottommost row occupied by WINDOW. | 601 BOTTOM is one more than the bottommost row occupied by WINDOW. |
616 The edges include the space used by WINDOW's scroll bar, display | 602 The edges include the space used by WINDOW's scroll bar, display |
617 margins, fringes, header line, and/or mode line. For the edges of | 603 margins, fringes, header line, and/or mode line. For the edges of |
618 just the text area, use `window-inside-edges'. */) | 604 just the text area, use `window-inside-edges'. */) |
619 (window) | 605 (Lisp_Object window) |
620 Lisp_Object window; | |
621 { | 606 { |
622 register struct window *w = decode_any_window (window); | 607 register struct window *w = decode_any_window (window); |
623 | 608 |
624 return Fcons (make_number (WINDOW_LEFT_EDGE_COL (w)), | 609 return Fcons (make_number (WINDOW_LEFT_EDGE_COL (w)), |
625 Fcons (make_number (WINDOW_TOP_EDGE_LINE (w)), | 610 Fcons (make_number (WINDOW_TOP_EDGE_LINE (w)), |
636 RIGHT is one more than the rightmost x position occupied by WINDOW. | 621 RIGHT is one more than the rightmost x position occupied by WINDOW. |
637 BOTTOM is one more than the bottommost y position occupied by WINDOW. | 622 BOTTOM is one more than the bottommost y position occupied by WINDOW. |
638 The pixel edges include the space used by WINDOW's scroll bar, display | 623 The pixel edges include the space used by WINDOW's scroll bar, display |
639 margins, fringes, header line, and/or mode line. For the pixel edges | 624 margins, fringes, header line, and/or mode line. For the pixel edges |
640 of just the text area, use `window-inside-pixel-edges'. */) | 625 of just the text area, use `window-inside-pixel-edges'. */) |
641 (window) | 626 (Lisp_Object window) |
642 Lisp_Object window; | |
643 { | 627 { |
644 register struct window *w = decode_any_window (window); | 628 register struct window *w = decode_any_window (window); |
645 | 629 |
646 return Fcons (make_number (WINDOW_LEFT_EDGE_X (w)), | 630 return Fcons (make_number (WINDOW_LEFT_EDGE_X (w)), |
647 Fcons (make_number (WINDOW_TOP_EDGE_Y (w)), | 631 Fcons (make_number (WINDOW_TOP_EDGE_Y (w)), |
676 RIGHT is one more than the rightmost x position occupied by WINDOW. | 660 RIGHT is one more than the rightmost x position occupied by WINDOW. |
677 BOTTOM is one more than the bottommost y position occupied by WINDOW. | 661 BOTTOM is one more than the bottommost y position occupied by WINDOW. |
678 The pixel edges include the space used by WINDOW's scroll bar, display | 662 The pixel edges include the space used by WINDOW's scroll bar, display |
679 margins, fringes, header line, and/or mode line. For the pixel edges | 663 margins, fringes, header line, and/or mode line. For the pixel edges |
680 of just the text area, use `window-inside-absolute-pixel-edges'. */) | 664 of just the text area, use `window-inside-absolute-pixel-edges'. */) |
681 (window) | 665 (Lisp_Object window) |
682 Lisp_Object window; | |
683 { | 666 { |
684 register struct window *w = decode_any_window (window); | 667 register struct window *w = decode_any_window (window); |
685 int add_x, add_y; | 668 int add_x, add_y; |
686 calc_absolute_offset (w, &add_x, &add_y); | 669 calc_absolute_offset (w, &add_x, &add_y); |
687 | 670 |
700 | 683 |
701 RIGHT is one more than the rightmost column of WINDOW's text area. | 684 RIGHT is one more than the rightmost column of WINDOW's text area. |
702 BOTTOM is one more than the bottommost row of WINDOW's text area. | 685 BOTTOM is one more than the bottommost row of WINDOW's text area. |
703 The inside edges do not include the space used by the WINDOW's scroll | 686 The inside edges do not include the space used by the WINDOW's scroll |
704 bar, display margins, fringes, header line, and/or mode line. */) | 687 bar, display margins, fringes, header line, and/or mode line. */) |
705 (window) | 688 (Lisp_Object window) |
706 Lisp_Object window; | |
707 { | 689 { |
708 register struct window *w = decode_any_window (window); | 690 register struct window *w = decode_any_window (window); |
709 | 691 |
710 return list4 (make_number (WINDOW_BOX_LEFT_EDGE_COL (w) | 692 return list4 (make_number (WINDOW_BOX_LEFT_EDGE_COL (w) |
711 + WINDOW_LEFT_MARGIN_COLS (w) | 693 + WINDOW_LEFT_MARGIN_COLS (w) |
726 | 708 |
727 RIGHT is one more than the rightmost x position of WINDOW's text area. | 709 RIGHT is one more than the rightmost x position of WINDOW's text area. |
728 BOTTOM is one more than the bottommost y position of WINDOW's text area. | 710 BOTTOM is one more than the bottommost y position of WINDOW's text area. |
729 The inside edges do not include the space used by WINDOW's scroll bar, | 711 The inside edges do not include the space used by WINDOW's scroll bar, |
730 display margins, fringes, header line, and/or mode line. */) | 712 display margins, fringes, header line, and/or mode line. */) |
731 (window) | 713 (Lisp_Object window) |
732 Lisp_Object window; | |
733 { | 714 { |
734 register struct window *w = decode_any_window (window); | 715 register struct window *w = decode_any_window (window); |
735 | 716 |
736 return list4 (make_number (WINDOW_BOX_LEFT_EDGE_X (w) | 717 return list4 (make_number (WINDOW_BOX_LEFT_EDGE_X (w) |
737 + WINDOW_LEFT_MARGIN_WIDTH (w) | 718 + WINDOW_LEFT_MARGIN_WIDTH (w) |
754 | 735 |
755 RIGHT is one more than the rightmost x position of WINDOW's text area. | 736 RIGHT is one more than the rightmost x position of WINDOW's text area. |
756 BOTTOM is one more than the bottommost y position of WINDOW's text area. | 737 BOTTOM is one more than the bottommost y position of WINDOW's text area. |
757 The inside edges do not include the space used by WINDOW's scroll bar, | 738 The inside edges do not include the space used by WINDOW's scroll bar, |
758 display margins, fringes, header line, and/or mode line. */) | 739 display margins, fringes, header line, and/or mode line. */) |
759 (window) | 740 (Lisp_Object window) |
760 Lisp_Object window; | |
761 { | 741 { |
762 register struct window *w = decode_any_window (window); | 742 register struct window *w = decode_any_window (window); |
763 int add_x, add_y; | 743 int add_x, add_y; |
764 calc_absolute_offset (w, &add_x, &add_y); | 744 calc_absolute_offset (w, &add_x, &add_y); |
765 | 745 |
1000 If they are in the right fringe of WINDOW, `right-fringe' is returned. | 980 If they are in the right fringe of WINDOW, `right-fringe' is returned. |
1001 If they are on the border between WINDOW and its right sibling, | 981 If they are on the border between WINDOW and its right sibling, |
1002 `vertical-line' is returned. | 982 `vertical-line' is returned. |
1003 If they are in the windows's left or right marginal areas, `left-margin'\n\ | 983 If they are in the windows's left or right marginal areas, `left-margin'\n\ |
1004 or `right-margin' is returned. */) | 984 or `right-margin' is returned. */) |
1005 (coordinates, window) | 985 (register Lisp_Object coordinates, Lisp_Object window) |
1006 register Lisp_Object coordinates, window; | |
1007 { | 986 { |
1008 struct window *w; | 987 struct window *w; |
1009 struct frame *f; | 988 struct frame *f; |
1010 int x, y; | 989 int x, y; |
1011 Lisp_Object lx, ly; | 990 Lisp_Object lx, ly; |
1153 DEFUN ("window-at", Fwindow_at, Swindow_at, 2, 3, 0, | 1132 DEFUN ("window-at", Fwindow_at, Swindow_at, 2, 3, 0, |
1154 doc: /* Return window containing coordinates X and Y on FRAME. | 1133 doc: /* Return window containing coordinates X and Y on FRAME. |
1155 If omitted, FRAME defaults to the currently selected frame. | 1134 If omitted, FRAME defaults to the currently selected frame. |
1156 The top left corner of the frame is considered to be row 0, | 1135 The top left corner of the frame is considered to be row 0, |
1157 column 0. */) | 1136 column 0. */) |
1158 (x, y, frame) | 1137 (Lisp_Object x, Lisp_Object y, Lisp_Object frame) |
1159 Lisp_Object x, y, frame; | |
1160 { | 1138 { |
1161 struct frame *f; | 1139 struct frame *f; |
1162 | 1140 |
1163 if (NILP (frame)) | 1141 if (NILP (frame)) |
1164 frame = selected_frame; | 1142 frame = selected_frame; |
1187 Note that, when WINDOW is the selected window and its buffer | 1165 Note that, when WINDOW is the selected window and its buffer |
1188 is also currently selected, the value returned is the same as (point). | 1166 is also currently selected, the value returned is the same as (point). |
1189 It would be more strictly correct to return the `top-level' value | 1167 It would be more strictly correct to return the `top-level' value |
1190 of point, outside of any save-excursion forms. | 1168 of point, outside of any save-excursion forms. |
1191 But that is hard to define. */) | 1169 But that is hard to define. */) |
1192 (window) | 1170 (Lisp_Object window) |
1193 Lisp_Object window; | |
1194 { | 1171 { |
1195 register struct window *w = decode_window (window); | 1172 register struct window *w = decode_window (window); |
1196 | 1173 |
1197 if (w == XWINDOW (selected_window) | 1174 if (w == XWINDOW (selected_window) |
1198 && current_buffer == XBUFFER (w->buffer)) | 1175 && current_buffer == XBUFFER (w->buffer)) |
1202 | 1179 |
1203 DEFUN ("window-start", Fwindow_start, Swindow_start, 0, 1, 0, | 1180 DEFUN ("window-start", Fwindow_start, Swindow_start, 0, 1, 0, |
1204 doc: /* Return position at which display currently starts in WINDOW. | 1181 doc: /* Return position at which display currently starts in WINDOW. |
1205 WINDOW defaults to the selected window. | 1182 WINDOW defaults to the selected window. |
1206 This is updated by redisplay or by calling `set-window-start'. */) | 1183 This is updated by redisplay or by calling `set-window-start'. */) |
1207 (window) | 1184 (Lisp_Object window) |
1208 Lisp_Object window; | |
1209 { | 1185 { |
1210 return Fmarker_position (decode_window (window)->start); | 1186 return Fmarker_position (decode_window (window)->start); |
1211 } | 1187 } |
1212 | 1188 |
1213 /* This is text temporarily removed from the doc string below. | 1189 /* This is text temporarily removed from the doc string below. |
1229 does not update this value. | 1205 does not update this value. |
1230 Return nil if there is no recorded value. \(This can happen if the | 1206 Return nil if there is no recorded value. \(This can happen if the |
1231 last redisplay of WINDOW was preempted, and did not finish.) | 1207 last redisplay of WINDOW was preempted, and did not finish.) |
1232 If UPDATE is non-nil, compute the up-to-date position | 1208 If UPDATE is non-nil, compute the up-to-date position |
1233 if it isn't already recorded. */) | 1209 if it isn't already recorded. */) |
1234 (window, update) | 1210 (Lisp_Object window, Lisp_Object update) |
1235 Lisp_Object window, update; | |
1236 { | 1211 { |
1237 Lisp_Object value; | 1212 Lisp_Object value; |
1238 struct window *w = decode_window (window); | 1213 struct window *w = decode_window (window); |
1239 Lisp_Object buf; | 1214 Lisp_Object buf; |
1240 struct buffer *b; | 1215 struct buffer *b; |
1298 } | 1273 } |
1299 | 1274 |
1300 DEFUN ("set-window-point", Fset_window_point, Sset_window_point, 2, 2, 0, | 1275 DEFUN ("set-window-point", Fset_window_point, Sset_window_point, 2, 2, 0, |
1301 doc: /* Make point value in WINDOW be at position POS in WINDOW's buffer. | 1276 doc: /* Make point value in WINDOW be at position POS in WINDOW's buffer. |
1302 Return POS. */) | 1277 Return POS. */) |
1303 (window, pos) | 1278 (Lisp_Object window, Lisp_Object pos) |
1304 Lisp_Object window, pos; | |
1305 { | 1279 { |
1306 register struct window *w = decode_window (window); | 1280 register struct window *w = decode_window (window); |
1307 | 1281 |
1308 CHECK_NUMBER_COERCE_MARKER (pos); | 1282 CHECK_NUMBER_COERCE_MARKER (pos); |
1309 if (w == XWINDOW (selected_window) | 1283 if (w == XWINDOW (selected_window) |
1323 DEFUN ("set-window-start", Fset_window_start, Sset_window_start, 2, 3, 0, | 1297 DEFUN ("set-window-start", Fset_window_start, Sset_window_start, 2, 3, 0, |
1324 doc: /* Make display in WINDOW start at position POS in WINDOW's buffer. | 1298 doc: /* Make display in WINDOW start at position POS in WINDOW's buffer. |
1325 WINDOW defaults to the selected window. Return POS. | 1299 WINDOW defaults to the selected window. Return POS. |
1326 Optional third arg NOFORCE non-nil inhibits next redisplay from | 1300 Optional third arg NOFORCE non-nil inhibits next redisplay from |
1327 overriding motion of point in order to display at this exact start. */) | 1301 overriding motion of point in order to display at this exact start. */) |
1328 (window, pos, noforce) | 1302 (Lisp_Object window, Lisp_Object pos, Lisp_Object noforce) |
1329 Lisp_Object window, pos, noforce; | |
1330 { | 1303 { |
1331 register struct window *w = decode_window (window); | 1304 register struct window *w = decode_window (window); |
1332 | 1305 |
1333 CHECK_NUMBER_COERCE_MARKER (pos); | 1306 CHECK_NUMBER_COERCE_MARKER (pos); |
1334 set_marker_restricted (w->start, pos, w->buffer); | 1307 set_marker_restricted (w->start, pos, w->buffer); |
1362 `kill-buffer' can delete a dedicated window and the containing frame. | 1335 `kill-buffer' can delete a dedicated window and the containing frame. |
1363 | 1336 |
1364 Functions like `set-window-buffer' may change the buffer displayed by a | 1337 Functions like `set-window-buffer' may change the buffer displayed by a |
1365 window, unless that window is "strongly" dedicated to its buffer, that | 1338 window, unless that window is "strongly" dedicated to its buffer, that |
1366 is the value returned by `window-dedicated-p' is t. */) | 1339 is the value returned by `window-dedicated-p' is t. */) |
1367 (window) | 1340 (Lisp_Object window) |
1368 Lisp_Object window; | |
1369 { | 1341 { |
1370 return decode_window (window)->dedicated; | 1342 return decode_window (window)->dedicated; |
1371 } | 1343 } |
1372 | 1344 |
1373 DEFUN ("set-window-dedicated-p", Fset_window_dedicated_p, | 1345 DEFUN ("set-window-dedicated-p", Fset_window_dedicated_p, |
1387 As a special case, if FLAG is t, mark WINDOW as "strongly" dedicated to | 1359 As a special case, if FLAG is t, mark WINDOW as "strongly" dedicated to |
1388 its buffer. Functions like `set-window-buffer' may change the buffer | 1360 its buffer. Functions like `set-window-buffer' may change the buffer |
1389 displayed by a window, unless that window is strongly dedicated to its | 1361 displayed by a window, unless that window is strongly dedicated to its |
1390 buffer. If and when `set-window-buffer' displays another buffer in a | 1362 buffer. If and when `set-window-buffer' displays another buffer in a |
1391 window, it also makes sure that the window is not marked as dedicated. */) | 1363 window, it also makes sure that the window is not marked as dedicated. */) |
1392 (window, flag) | 1364 (Lisp_Object window, Lisp_Object flag) |
1393 Lisp_Object window, flag; | |
1394 { | 1365 { |
1395 register struct window *w = decode_window (window); | 1366 register struct window *w = decode_window (window); |
1396 | 1367 |
1397 w->dedicated = flag; | 1368 w->dedicated = flag; |
1398 return w->dedicated; | 1369 return w->dedicated; |
1402 DEFUN ("window-parameters", Fwindow_parameters, Swindow_parameters, | 1373 DEFUN ("window-parameters", Fwindow_parameters, Swindow_parameters, |
1403 0, 1, 0, | 1374 0, 1, 0, |
1404 doc: /* Return the parameters of WINDOW and their values. | 1375 doc: /* Return the parameters of WINDOW and their values. |
1405 WINDOW defaults to the selected window. The return value is a list of | 1376 WINDOW defaults to the selected window. The return value is a list of |
1406 elements of the form (PARAMETER . VALUE). */) | 1377 elements of the form (PARAMETER . VALUE). */) |
1407 (window) | 1378 (Lisp_Object window) |
1408 Lisp_Object window; | |
1409 { | 1379 { |
1410 return Fcopy_alist (decode_window (window)->window_parameters); | 1380 return Fcopy_alist (decode_window (window)->window_parameters); |
1411 } | 1381 } |
1412 | 1382 |
1413 DEFUN ("window-parameter", Fwindow_parameter, Swindow_parameter, | 1383 DEFUN ("window-parameter", Fwindow_parameter, Swindow_parameter, |
1414 2, 2, 0, | 1384 2, 2, 0, |
1415 doc: /* Return WINDOW's value for PARAMETER. | 1385 doc: /* Return WINDOW's value for PARAMETER. |
1416 WINDOW defaults to the selected window. */) | 1386 WINDOW defaults to the selected window. */) |
1417 (window, parameter) | 1387 (Lisp_Object window, Lisp_Object parameter) |
1418 Lisp_Object window, parameter; | |
1419 { | 1388 { |
1420 Lisp_Object result; | 1389 Lisp_Object result; |
1421 | 1390 |
1422 result = Fassq (parameter, decode_window (window)->window_parameters); | 1391 result = Fassq (parameter, decode_window (window)->window_parameters); |
1423 return CDR_SAFE (result); | 1392 return CDR_SAFE (result); |
1425 | 1394 |
1426 DEFUN ("set-window-parameter", Fset_window_parameter, | 1395 DEFUN ("set-window-parameter", Fset_window_parameter, |
1427 Sset_window_parameter, 3, 3, 0, | 1396 Sset_window_parameter, 3, 3, 0, |
1428 doc: /* Set WINDOW's value of PARAMETER to VALUE. | 1397 doc: /* Set WINDOW's value of PARAMETER to VALUE. |
1429 WINDOW defaults to the selected window. Return VALUE. */) | 1398 WINDOW defaults to the selected window. Return VALUE. */) |
1430 (window, parameter, value) | 1399 (Lisp_Object window, Lisp_Object parameter, Lisp_Object value) |
1431 Lisp_Object window, parameter, value; | |
1432 { | 1400 { |
1433 register struct window *w = decode_window (window); | 1401 register struct window *w = decode_window (window); |
1434 Lisp_Object old_alist_elt; | 1402 Lisp_Object old_alist_elt; |
1435 | 1403 |
1436 old_alist_elt = Fassq (parameter, w->window_parameters); | 1404 old_alist_elt = Fassq (parameter, w->window_parameters); |
1444 | 1412 |
1445 DEFUN ("window-display-table", Fwindow_display_table, Swindow_display_table, | 1413 DEFUN ("window-display-table", Fwindow_display_table, Swindow_display_table, |
1446 0, 1, 0, | 1414 0, 1, 0, |
1447 doc: /* Return the display-table that WINDOW is using. | 1415 doc: /* Return the display-table that WINDOW is using. |
1448 WINDOW defaults to the selected window. */) | 1416 WINDOW defaults to the selected window. */) |
1449 (window) | 1417 (Lisp_Object window) |
1450 Lisp_Object window; | |
1451 { | 1418 { |
1452 return decode_window (window)->display_table; | 1419 return decode_window (window)->display_table; |
1453 } | 1420 } |
1454 | 1421 |
1455 /* Get the display table for use on window W. This is either W's | 1422 /* Get the display table for use on window W. This is either W's |
1477 return dp; | 1444 return dp; |
1478 } | 1445 } |
1479 | 1446 |
1480 DEFUN ("set-window-display-table", Fset_window_display_table, Sset_window_display_table, 2, 2, 0, | 1447 DEFUN ("set-window-display-table", Fset_window_display_table, Sset_window_display_table, 2, 2, 0, |
1481 doc: /* Set WINDOW's display-table to TABLE. */) | 1448 doc: /* Set WINDOW's display-table to TABLE. */) |
1482 (window, table) | 1449 (register Lisp_Object window, Lisp_Object table) |
1483 register Lisp_Object window, table; | |
1484 { | 1450 { |
1485 register struct window *w; | 1451 register struct window *w; |
1486 | 1452 |
1487 w = decode_window (window); | 1453 w = decode_window (window); |
1488 w->display_table = table; | 1454 w->display_table = table; |
1555 p->top_line = o->top_line; | 1521 p->top_line = o->top_line; |
1556 p->total_cols = o->total_cols; | 1522 p->total_cols = o->total_cols; |
1557 p->total_lines = o->total_lines; | 1523 p->total_lines = o->total_lines; |
1558 p->desired_matrix = p->current_matrix = 0; | 1524 p->desired_matrix = p->current_matrix = 0; |
1559 p->vscroll = 0; | 1525 p->vscroll = 0; |
1560 bzero (&p->cursor, sizeof (p->cursor)); | 1526 memset (&p->cursor, 0, sizeof (p->cursor)); |
1561 bzero (&p->last_cursor, sizeof (p->last_cursor)); | 1527 memset (&p->last_cursor, 0, sizeof (p->last_cursor)); |
1562 bzero (&p->phys_cursor, sizeof (p->phys_cursor)); | 1528 memset (&p->phys_cursor, 0, sizeof (p->phys_cursor)); |
1563 p->phys_cursor_type = -1; | 1529 p->phys_cursor_type = -1; |
1564 p->phys_cursor_width = -1; | 1530 p->phys_cursor_width = -1; |
1565 p->must_be_updated_p = 0; | 1531 p->must_be_updated_p = 0; |
1566 p->pseudo_window_p = 0; | 1532 p->pseudo_window_p = 0; |
1567 XSETFASTINT (p->window_end_vpos, 0); | 1533 XSETFASTINT (p->window_end_vpos, 0); |
1594 | 1560 |
1595 DEFUN ("delete-window", Fdelete_window, Sdelete_window, 0, 1, "", | 1561 DEFUN ("delete-window", Fdelete_window, Sdelete_window, 0, 1, "", |
1596 doc: /* Remove WINDOW from its frame. | 1562 doc: /* Remove WINDOW from its frame. |
1597 WINDOW defaults to the selected window. Return nil. | 1563 WINDOW defaults to the selected window. Return nil. |
1598 Signal an error when WINDOW is the only window on its frame. */) | 1564 Signal an error when WINDOW is the only window on its frame. */) |
1599 (window) | 1565 (register Lisp_Object window) |
1600 register Lisp_Object window; | |
1601 { | 1566 { |
1602 struct frame *f; | 1567 struct frame *f; |
1603 if (NILP (window)) | 1568 if (NILP (window)) |
1604 window = selected_window; | 1569 window = selected_window; |
1605 else | 1570 else |
2092 | 2057 |
2093 If you use consistent values for MINIBUF and ALL-FRAMES, you can use | 2058 If you use consistent values for MINIBUF and ALL-FRAMES, you can use |
2094 `next-window' to iterate through the entire cycle of acceptable | 2059 `next-window' to iterate through the entire cycle of acceptable |
2095 windows, eventually ending up back at the window you started with. | 2060 windows, eventually ending up back at the window you started with. |
2096 `previous-window' traverses the same cycle, in the reverse order. */) | 2061 `previous-window' traverses the same cycle, in the reverse order. */) |
2097 (window, minibuf, all_frames) | 2062 (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames) |
2098 Lisp_Object window, minibuf, all_frames; | |
2099 { | 2063 { |
2100 return next_window (window, minibuf, all_frames, 1); | 2064 return next_window (window, minibuf, all_frames, 1); |
2101 } | 2065 } |
2102 | 2066 |
2103 | 2067 |
2110 If you use consistent values for MINIBUF and ALL-FRAMES, you can | 2074 If you use consistent values for MINIBUF and ALL-FRAMES, you can |
2111 use `previous-window' to iterate through the entire cycle of | 2075 use `previous-window' to iterate through the entire cycle of |
2112 acceptable windows, eventually ending up back at the window you | 2076 acceptable windows, eventually ending up back at the window you |
2113 started with. `next-window' traverses the same cycle, in the | 2077 started with. `next-window' traverses the same cycle, in the |
2114 reverse order. */) | 2078 reverse order. */) |
2115 (window, minibuf, all_frames) | 2079 (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames) |
2116 Lisp_Object window, minibuf, all_frames; | |
2117 { | 2080 { |
2118 return next_window (window, minibuf, all_frames, 0); | 2081 return next_window (window, minibuf, all_frames, 0); |
2119 } | 2082 } |
2120 | 2083 |
2121 | 2084 |
2130 | 2093 |
2131 This function uses `next-window' for finding the window to select. | 2094 This function uses `next-window' for finding the window to select. |
2132 The argument ALL-FRAMES has the same meaning as in `next-window', | 2095 The argument ALL-FRAMES has the same meaning as in `next-window', |
2133 but the MINIBUF argument of `next-window' is always effectively | 2096 but the MINIBUF argument of `next-window' is always effectively |
2134 nil. */) | 2097 nil. */) |
2135 (count, all_frames) | 2098 (Lisp_Object count, Lisp_Object all_frames) |
2136 Lisp_Object count, all_frames; | |
2137 { | 2099 { |
2138 Lisp_Object window; | 2100 Lisp_Object window; |
2139 int i; | 2101 int i; |
2140 | 2102 |
2141 CHECK_NUMBER (count); | 2103 CHECK_NUMBER (count); |
2157 WINDOW nil or omitted means use the selected window. | 2119 WINDOW nil or omitted means use the selected window. |
2158 MINIBUF t means include the minibuffer window, even if it isn't active. | 2120 MINIBUF t means include the minibuffer window, even if it isn't active. |
2159 MINIBUF nil or omitted means include the minibuffer window only | 2121 MINIBUF nil or omitted means include the minibuffer window only |
2160 if it's active. | 2122 if it's active. |
2161 MINIBUF neither nil nor t means never include the minibuffer window. */) | 2123 MINIBUF neither nil nor t means never include the minibuffer window. */) |
2162 (frame, minibuf, window) | 2124 (Lisp_Object frame, Lisp_Object minibuf, Lisp_Object window) |
2163 Lisp_Object frame, minibuf, window; | |
2164 { | 2125 { |
2165 if (NILP (window)) | 2126 if (NILP (window)) |
2166 window = FRAMEP (frame) ? XFRAME (frame)->selected_window : selected_window; | 2127 window = FRAMEP (frame) ? XFRAME (frame)->selected_window : selected_window; |
2167 CHECK_WINDOW (window); | 2128 CHECK_WINDOW (window); |
2168 if (NILP (frame)) | 2129 if (NILP (frame)) |
2470 If optional argument FRAME is `visible', search all visible frames. | 2431 If optional argument FRAME is `visible', search all visible frames. |
2471 If FRAME is 0, search all visible and iconified frames. | 2432 If FRAME is 0, search all visible and iconified frames. |
2472 If FRAME is t, search all frames. | 2433 If FRAME is t, search all frames. |
2473 If FRAME is nil, search only the selected frame. | 2434 If FRAME is nil, search only the selected frame. |
2474 If FRAME is a frame, search only that frame. */) | 2435 If FRAME is a frame, search only that frame. */) |
2475 (frame, dedicated) | 2436 (Lisp_Object frame, Lisp_Object dedicated) |
2476 Lisp_Object frame, dedicated; | |
2477 { | 2437 { |
2478 register Lisp_Object w; | 2438 register Lisp_Object w; |
2479 /* First try for a window that is full-width */ | 2439 /* First try for a window that is full-width */ |
2480 w = window_loop (GET_LRU_WINDOW, | 2440 w = window_loop (GET_LRU_WINDOW, |
2481 NILP (dedicated) ? make_number (1) : make_number (3), | 2441 NILP (dedicated) ? make_number (1) : make_number (3), |
2496 If optional argument FRAME is `visible', search all visible frames. | 2456 If optional argument FRAME is `visible', search all visible frames. |
2497 If FRAME is 0, search all visible and iconified frames. | 2457 If FRAME is 0, search all visible and iconified frames. |
2498 If FRAME is t, search all frames. | 2458 If FRAME is t, search all frames. |
2499 If FRAME is nil, search only the selected frame. | 2459 If FRAME is nil, search only the selected frame. |
2500 If FRAME is a frame, search only that frame. */) | 2460 If FRAME is a frame, search only that frame. */) |
2501 (frame, dedicated) | 2461 (Lisp_Object frame, Lisp_Object dedicated) |
2502 Lisp_Object frame, dedicated; | |
2503 { | 2462 { |
2504 return window_loop (GET_LARGEST_WINDOW, dedicated, 0, | 2463 return window_loop (GET_LARGEST_WINDOW, dedicated, 0, |
2505 frame); | 2464 frame); |
2506 } | 2465 } |
2507 | 2466 |
2512 If optional argument FRAME is `visible', search all visible frames. | 2471 If optional argument FRAME is `visible', search all visible frames. |
2513 If optional argument FRAME is 0, search all visible and iconified frames. | 2472 If optional argument FRAME is 0, search all visible and iconified frames. |
2514 If FRAME is t, search all frames. | 2473 If FRAME is t, search all frames. |
2515 If FRAME is nil, search only the selected frame. | 2474 If FRAME is nil, search only the selected frame. |
2516 If FRAME is a frame, search only that frame. */) | 2475 If FRAME is a frame, search only that frame. */) |
2517 (buffer_or_name, frame) | 2476 (Lisp_Object buffer_or_name, Lisp_Object frame) |
2518 Lisp_Object buffer_or_name, frame; | |
2519 { | 2477 { |
2520 Lisp_Object buffer; | 2478 Lisp_Object buffer; |
2521 | 2479 |
2522 if (NILP (buffer_or_name)) | 2480 if (NILP (buffer_or_name)) |
2523 buffer = Fcurrent_buffer (); | 2481 buffer = Fcurrent_buffer (); |
2537 This function tries to reduce display jumps by keeping the text | 2495 This function tries to reduce display jumps by keeping the text |
2538 previously visible in WINDOW in the same place on the frame. Doing this | 2496 previously visible in WINDOW in the same place on the frame. Doing this |
2539 depends on the value of (window-start WINDOW), so if calling this | 2497 depends on the value of (window-start WINDOW), so if calling this |
2540 function in a program gives strange scrolling, make sure the | 2498 function in a program gives strange scrolling, make sure the |
2541 window-start value is reasonable when this function is called. */) | 2499 window-start value is reasonable when this function is called. */) |
2542 (window) | 2500 (Lisp_Object window) |
2543 Lisp_Object window; | |
2544 { | 2501 { |
2545 struct window *w; | 2502 struct window *w; |
2546 int startpos; | 2503 int startpos; |
2547 int top, new_top; | 2504 int top, new_top; |
2548 | 2505 |
2605 If FRAME is nil, search all frames. | 2562 If FRAME is nil, search all frames. |
2606 If FRAME is t, search only the selected frame. | 2563 If FRAME is t, search only the selected frame. |
2607 If FRAME is a frame, search only that frame. | 2564 If FRAME is a frame, search only that frame. |
2608 When a window showing BUFFER-OR-NAME is dedicated and the only window of | 2565 When a window showing BUFFER-OR-NAME is dedicated and the only window of |
2609 its frame, that frame is deleted when there are other frames left. */) | 2566 its frame, that frame is deleted when there are other frames left. */) |
2610 (buffer_or_name, frame) | 2567 (Lisp_Object buffer_or_name, Lisp_Object frame) |
2611 Lisp_Object buffer_or_name, frame; | |
2612 { | 2568 { |
2613 Lisp_Object buffer; | 2569 Lisp_Object buffer; |
2614 | 2570 |
2615 /* FRAME uses t and nil to mean the opposite of what window_loop | 2571 /* FRAME uses t and nil to mean the opposite of what window_loop |
2616 expects. */ | 2572 expects. */ |
2641 | 2597 |
2642 When a window showing BUFFER-OR-NAME is dedicated that window is | 2598 When a window showing BUFFER-OR-NAME is dedicated that window is |
2643 deleted. If that window is the only window on its frame, that frame is | 2599 deleted. If that window is the only window on its frame, that frame is |
2644 deleted too when there are other frames left. If there are no other | 2600 deleted too when there are other frames left. If there are no other |
2645 frames left, some other buffer is displayed in that window. */) | 2601 frames left, some other buffer is displayed in that window. */) |
2646 (buffer_or_name) | 2602 (Lisp_Object buffer_or_name) |
2647 Lisp_Object buffer_or_name; | |
2648 { | 2603 { |
2649 Lisp_Object buffer; | 2604 Lisp_Object buffer; |
2650 | 2605 |
2651 if (NILP (buffer_or_name)) | 2606 if (NILP (buffer_or_name)) |
2652 buffer = Fcurrent_buffer (); | 2607 buffer = Fcurrent_buffer (); |
3479 XSETINT (b->display_count, XINT (b->display_count) + 1); | 3434 XSETINT (b->display_count, XINT (b->display_count) + 1); |
3480 b->display_time = Fcurrent_time (); | 3435 b->display_time = Fcurrent_time (); |
3481 | 3436 |
3482 XSETFASTINT (w->window_end_pos, 0); | 3437 XSETFASTINT (w->window_end_pos, 0); |
3483 XSETFASTINT (w->window_end_vpos, 0); | 3438 XSETFASTINT (w->window_end_vpos, 0); |
3484 bzero (&w->last_cursor, sizeof w->last_cursor); | 3439 memset (&w->last_cursor, 0, sizeof w->last_cursor); |
3485 w->window_end_valid = Qnil; | 3440 w->window_end_valid = Qnil; |
3486 if (!(keep_margins_p && samebuf)) | 3441 if (!(keep_margins_p && samebuf)) |
3487 { /* If we're not actually changing the buffer, don't reset hscroll and | 3442 { /* If we're not actually changing the buffer, don't reset hscroll and |
3488 vscroll. This case happens for example when called from | 3443 vscroll. This case happens for example when called from |
3489 change_frame_size_1, where we use a dummy call to | 3444 change_frame_size_1, where we use a dummy call to |
3568 buffer (that is `window-dedicated-p' returns t for WINDOW) and does not | 3523 buffer (that is `window-dedicated-p' returns t for WINDOW) and does not |
3569 already display BUFFER-OR-NAME. | 3524 already display BUFFER-OR-NAME. |
3570 | 3525 |
3571 This function runs `window-scroll-functions' before running | 3526 This function runs `window-scroll-functions' before running |
3572 `window-configuration-change-hook'. */) | 3527 `window-configuration-change-hook'. */) |
3573 (window, buffer_or_name, keep_margins) | 3528 (register Lisp_Object window, Lisp_Object buffer_or_name, Lisp_Object keep_margins) |
3574 register Lisp_Object window, buffer_or_name, keep_margins; | |
3575 { | 3529 { |
3576 register Lisp_Object tem, buffer; | 3530 register Lisp_Object tem, buffer; |
3577 register struct window *w = decode_window (window); | 3531 register struct window *w = decode_window (window); |
3578 | 3532 |
3579 XSETWINDOW (window, w); | 3533 XSETWINDOW (window, w); |
3612 at the front of the list of recently selected ones and do not | 3566 at the front of the list of recently selected ones and do not |
3613 make this window the most recently selected one. | 3567 make this window the most recently selected one. |
3614 | 3568 |
3615 Note that the main editor command loop selects the buffer of the | 3569 Note that the main editor command loop selects the buffer of the |
3616 selected window before each command. */) | 3570 selected window before each command. */) |
3617 (window, norecord) | 3571 (register Lisp_Object window, Lisp_Object norecord) |
3618 register Lisp_Object window, norecord; | |
3619 { | 3572 { |
3620 register struct window *w; | 3573 register struct window *w; |
3621 register struct window *ow; | 3574 register struct window *ow; |
3622 struct frame *sf; | 3575 struct frame *sf; |
3623 | 3576 |
3713 0, 1, 0, | 3666 0, 1, 0, |
3714 doc: /* Force all windows to be updated on next redisplay. | 3667 doc: /* Force all windows to be updated on next redisplay. |
3715 If optional arg OBJECT is a window, force redisplay of that window only. | 3668 If optional arg OBJECT is a window, force redisplay of that window only. |
3716 If OBJECT is a buffer or buffer name, force redisplay of all windows | 3669 If OBJECT is a buffer or buffer name, force redisplay of all windows |
3717 displaying that buffer. */) | 3670 displaying that buffer. */) |
3718 (object) | 3671 (Lisp_Object object) |
3719 Lisp_Object object; | |
3720 { | 3672 { |
3721 if (NILP (object)) | 3673 if (NILP (object)) |
3722 { | 3674 { |
3723 windows_or_buffers_changed++; | 3675 windows_or_buffers_changed++; |
3724 update_mode_lines++; | 3676 update_mode_lines++; |
3855 Returns the newly created window (which is the lower or rightmost one). | 3807 Returns the newly created window (which is the lower or rightmost one). |
3856 The upper or leftmost window is the original one, and remains selected | 3808 The upper or leftmost window is the original one, and remains selected |
3857 if it was selected before. | 3809 if it was selected before. |
3858 | 3810 |
3859 See Info node `(elisp)Splitting Windows' for more details and examples. */) | 3811 See Info node `(elisp)Splitting Windows' for more details and examples. */) |
3860 (window, size, horizontal) | 3812 (Lisp_Object window, Lisp_Object size, Lisp_Object horizontal) |
3861 Lisp_Object window, size, horizontal; | |
3862 { | 3813 { |
3863 register Lisp_Object new; | 3814 register Lisp_Object new; |
3864 register struct window *o, *p; | 3815 register struct window *o, *p; |
3865 FRAME_PTR fo; | 3816 FRAME_PTR fo; |
3866 register int size_int; | 3817 register int size_int; |
3946 p->prev = window; | 3897 p->prev = window; |
3947 o->next = new; | 3898 o->next = new; |
3948 p->parent = o->parent; | 3899 p->parent = o->parent; |
3949 p->buffer = Qt; | 3900 p->buffer = Qt; |
3950 p->window_end_valid = Qnil; | 3901 p->window_end_valid = Qnil; |
3951 bzero (&p->last_cursor, sizeof p->last_cursor); | 3902 memset (&p->last_cursor, 0, sizeof p->last_cursor); |
3952 | 3903 |
3953 /* Duplicate special geometry settings. */ | 3904 /* Duplicate special geometry settings. */ |
3954 | 3905 |
3955 p->left_margin_cols = o->left_margin_cols; | 3906 p->left_margin_cols = o->left_margin_cols; |
3956 p->right_margin_cols = o->right_margin_cols; | 3907 p->right_margin_cols = o->right_margin_cols; |
3995 window wider by SIZE columns. If SIZE is negative, shrink the window by | 3946 window wider by SIZE columns. If SIZE is negative, shrink the window by |
3996 -SIZE lines or columns. Return nil. | 3947 -SIZE lines or columns. Return nil. |
3997 | 3948 |
3998 This function can delete windows if they get too small. The size of | 3949 This function can delete windows if they get too small. The size of |
3999 fixed size windows is not altered by this function. */) | 3950 fixed size windows is not altered by this function. */) |
4000 (size, horizontal) | 3951 (Lisp_Object size, Lisp_Object horizontal) |
4001 Lisp_Object size, horizontal; | |
4002 { | 3952 { |
4003 CHECK_NUMBER (size); | 3953 CHECK_NUMBER (size); |
4004 enlarge_window (selected_window, XINT (size), !NILP (horizontal)); | 3954 enlarge_window (selected_window, XINT (size), !NILP (horizontal)); |
4005 | 3955 |
4006 run_window_configuration_change_hook (SELECTED_FRAME ()); | 3956 run_window_configuration_change_hook (SELECTED_FRAME ()); |
4015 window narrower by SIZE columns. If SIZE is negative, enlarge selected | 3965 window narrower by SIZE columns. If SIZE is negative, enlarge selected |
4016 window by -SIZE lines or columns. Return nil. | 3966 window by -SIZE lines or columns. Return nil. |
4017 | 3967 |
4018 This function can delete windows if they get too small. The size of | 3968 This function can delete windows if they get too small. The size of |
4019 fixed size windows is not altered by this function. */) | 3969 fixed size windows is not altered by this function. */) |
4020 (size, horizontal) | 3970 (Lisp_Object size, Lisp_Object horizontal) |
4021 Lisp_Object size, horizontal; | |
4022 { | 3971 { |
4023 CHECK_NUMBER (size); | 3972 CHECK_NUMBER (size); |
4024 enlarge_window (selected_window, -XINT (size), !NILP (horizontal)); | 3973 enlarge_window (selected_window, -XINT (size), !NILP (horizontal)); |
4025 | 3974 |
4026 run_window_configuration_change_hook (SELECTED_FRAME ()); | 3975 run_window_configuration_change_hook (SELECTED_FRAME ()); |
4468 Otherwise, adjust the height, moving the bottom edge. | 4417 Otherwise, adjust the height, moving the bottom edge. |
4469 | 4418 |
4470 Following siblings of the selected window are resized to fulfill | 4419 Following siblings of the selected window are resized to fulfill |
4471 the size request. If they become too small in the process, they | 4420 the size request. If they become too small in the process, they |
4472 are not deleted; instead, we signal an error. */) | 4421 are not deleted; instead, we signal an error. */) |
4473 (window, delta, horizontal) | 4422 (Lisp_Object window, Lisp_Object delta, Lisp_Object horizontal) |
4474 Lisp_Object window, delta, horizontal; | |
4475 { | 4423 { |
4476 CHECK_NUMBER (delta); | 4424 CHECK_NUMBER (delta); |
4477 if (NILP (window)) | 4425 if (NILP (window)) |
4478 window = selected_window; | 4426 window = selected_window; |
4479 adjust_window_trailing_edge (window, XINT (delta), !NILP (horizontal)); | 4427 adjust_window_trailing_edge (window, XINT (delta), !NILP (horizontal)); |
5364 If ARG is omitted or nil, scroll upward by a near full screen. | 5312 If ARG is omitted or nil, scroll upward by a near full screen. |
5365 A near full screen is `next-screen-context-lines' less than a full screen. | 5313 A near full screen is `next-screen-context-lines' less than a full screen. |
5366 Negative ARG means scroll downward. | 5314 Negative ARG means scroll downward. |
5367 If ARG is the atom `-', scroll downward by nearly full screen. | 5315 If ARG is the atom `-', scroll downward by nearly full screen. |
5368 When calling from a program, supply as argument a number, nil, or `-'. */) | 5316 When calling from a program, supply as argument a number, nil, or `-'. */) |
5369 (arg) | 5317 (Lisp_Object arg) |
5370 Lisp_Object arg; | |
5371 { | 5318 { |
5372 scroll_command (arg, 1); | 5319 scroll_command (arg, 1); |
5373 return Qnil; | 5320 return Qnil; |
5374 } | 5321 } |
5375 | 5322 |
5378 If ARG is omitted or nil, scroll down by a near full screen. | 5325 If ARG is omitted or nil, scroll down by a near full screen. |
5379 A near full screen is `next-screen-context-lines' less than a full screen. | 5326 A near full screen is `next-screen-context-lines' less than a full screen. |
5380 Negative ARG means scroll upward. | 5327 Negative ARG means scroll upward. |
5381 If ARG is the atom `-', scroll upward by nearly full screen. | 5328 If ARG is the atom `-', scroll upward by nearly full screen. |
5382 When calling from a program, supply as argument a number, nil, or `-'. */) | 5329 When calling from a program, supply as argument a number, nil, or `-'. */) |
5383 (arg) | 5330 (Lisp_Object arg) |
5384 Lisp_Object arg; | |
5385 { | 5331 { |
5386 scroll_command (arg, -1); | 5332 scroll_command (arg, -1); |
5387 return Qnil; | 5333 return Qnil; |
5388 } | 5334 } |
5389 | 5335 |
5392 If `other-window-scroll-buffer' is non-nil, a window | 5338 If `other-window-scroll-buffer' is non-nil, a window |
5393 showing that buffer is used. | 5339 showing that buffer is used. |
5394 If in the minibuffer, `minibuffer-scroll-window' if non-nil | 5340 If in the minibuffer, `minibuffer-scroll-window' if non-nil |
5395 specifies the window. This takes precedence over | 5341 specifies the window. This takes precedence over |
5396 `other-window-scroll-buffer'. */) | 5342 `other-window-scroll-buffer'. */) |
5397 () | 5343 (void) |
5398 { | 5344 { |
5399 Lisp_Object window; | 5345 Lisp_Object window; |
5400 | 5346 |
5401 if (MINI_WINDOW_P (XWINDOW (selected_window)) | 5347 if (MINI_WINDOW_P (XWINDOW (selected_window)) |
5402 && !NILP (Vminibuf_scroll_window)) | 5348 && !NILP (Vminibuf_scroll_window)) |
5442 If `other-window-scroll-buffer' is non-nil, scroll the window | 5388 If `other-window-scroll-buffer' is non-nil, scroll the window |
5443 showing that buffer, popping the buffer up if necessary. | 5389 showing that buffer, popping the buffer up if necessary. |
5444 If in the minibuffer, `minibuffer-scroll-window' if non-nil | 5390 If in the minibuffer, `minibuffer-scroll-window' if non-nil |
5445 specifies the window to scroll. This takes precedence over | 5391 specifies the window to scroll. This takes precedence over |
5446 `other-window-scroll-buffer'. */) | 5392 `other-window-scroll-buffer'. */) |
5447 (arg) | 5393 (Lisp_Object arg) |
5448 Lisp_Object arg; | |
5449 { | 5394 { |
5450 Lisp_Object window; | 5395 Lisp_Object window; |
5451 struct window *w; | 5396 struct window *w; |
5452 int count = SPECPDL_INDEX (); | 5397 int count = SPECPDL_INDEX (); |
5453 | 5398 |
5486 effect after the change. | 5431 effect after the change. |
5487 If SET-MINIMUM is non-nil, the new scroll amount becomes the | 5432 If SET-MINIMUM is non-nil, the new scroll amount becomes the |
5488 lower bound for automatic scrolling, i.e. automatic scrolling | 5433 lower bound for automatic scrolling, i.e. automatic scrolling |
5489 will not scroll a window to a column less than the value returned | 5434 will not scroll a window to a column less than the value returned |
5490 by this function. This happens in an interactive call. */) | 5435 by this function. This happens in an interactive call. */) |
5491 (arg, set_minimum) | 5436 (register Lisp_Object arg, Lisp_Object set_minimum) |
5492 register Lisp_Object arg, set_minimum; | |
5493 { | 5437 { |
5494 Lisp_Object result; | 5438 Lisp_Object result; |
5495 int hscroll; | 5439 int hscroll; |
5496 struct window *w = XWINDOW (selected_window); | 5440 struct window *w = XWINDOW (selected_window); |
5497 | 5441 |
5516 effect after the change. | 5460 effect after the change. |
5517 If SET-MINIMUM is non-nil, the new scroll amount becomes the | 5461 If SET-MINIMUM is non-nil, the new scroll amount becomes the |
5518 lower bound for automatic scrolling, i.e. automatic scrolling | 5462 lower bound for automatic scrolling, i.e. automatic scrolling |
5519 will not scroll a window to a column less than the value returned | 5463 will not scroll a window to a column less than the value returned |
5520 by this function. This happens in an interactive call. */) | 5464 by this function. This happens in an interactive call. */) |
5521 (arg, set_minimum) | 5465 (register Lisp_Object arg, Lisp_Object set_minimum) |
5522 register Lisp_Object arg, set_minimum; | |
5523 { | 5466 { |
5524 Lisp_Object result; | 5467 Lisp_Object result; |
5525 int hscroll; | 5468 int hscroll; |
5526 struct window *w = XWINDOW (selected_window); | 5469 struct window *w = XWINDOW (selected_window); |
5527 | 5470 |
5540 } | 5483 } |
5541 | 5484 |
5542 DEFUN ("minibuffer-selected-window", Fminibuffer_selected_window, Sminibuffer_selected_window, 0, 0, 0, | 5485 DEFUN ("minibuffer-selected-window", Fminibuffer_selected_window, Sminibuffer_selected_window, 0, 0, 0, |
5543 doc: /* Return the window which was selected when entering the minibuffer. | 5486 doc: /* Return the window which was selected when entering the minibuffer. |
5544 Returns nil, if selected window is not a minibuffer window. */) | 5487 Returns nil, if selected window is not a minibuffer window. */) |
5545 () | 5488 (void) |
5546 { | 5489 { |
5547 if (minibuf_level > 0 | 5490 if (minibuf_level > 0 |
5548 && MINI_WINDOW_P (XWINDOW (selected_window)) | 5491 && MINI_WINDOW_P (XWINDOW (selected_window)) |
5549 && WINDOW_LIVE_P (minibuf_selected_window)) | 5492 && WINDOW_LIVE_P (minibuf_selected_window)) |
5550 return minibuf_selected_window; | 5493 return minibuf_selected_window; |
5622 height needed); if `recenter-redisplay' has the special value `tty', | 5565 height needed); if `recenter-redisplay' has the special value `tty', |
5623 then only tty frame are redrawn. | 5566 then only tty frame are redrawn. |
5624 | 5567 |
5625 Just C-u as prefix means put point in the center of the window | 5568 Just C-u as prefix means put point in the center of the window |
5626 and redisplay normally--don't erase and redraw the frame. */) | 5569 and redisplay normally--don't erase and redraw the frame. */) |
5627 (arg) | 5570 (register Lisp_Object arg) |
5628 register Lisp_Object arg; | |
5629 { | 5571 { |
5630 struct window *w = XWINDOW (selected_window); | 5572 struct window *w = XWINDOW (selected_window); |
5631 struct buffer *buf = XBUFFER (w->buffer); | 5573 struct buffer *buf = XBUFFER (w->buffer); |
5632 struct buffer *obuf = current_buffer; | 5574 struct buffer *obuf = current_buffer; |
5633 int center_p = 0; | 5575 int center_p = 0; |
5807 doc: /* Return the height in lines of the text display area of WINDOW. | 5749 doc: /* Return the height in lines of the text display area of WINDOW. |
5808 WINDOW defaults to the selected window. | 5750 WINDOW defaults to the selected window. |
5809 | 5751 |
5810 The return value does not include the mode line, any header line, nor | 5752 The return value does not include the mode line, any header line, nor |
5811 any partial-height lines in the text display area. */) | 5753 any partial-height lines in the text display area. */) |
5812 (window) | 5754 (Lisp_Object window) |
5813 Lisp_Object window; | |
5814 { | 5755 { |
5815 struct window *w = decode_window (window); | 5756 struct window *w = decode_window (window); |
5816 int pixel_height = window_box_height (w); | 5757 int pixel_height = window_box_height (w); |
5817 int line_height = pixel_height / FRAME_LINE_HEIGHT (XFRAME (w->frame)); | 5758 int line_height = pixel_height / FRAME_LINE_HEIGHT (XFRAME (w->frame)); |
5818 return make_number (line_height); | 5759 return make_number (line_height); |
5824 1, 1, "P", | 5765 1, 1, "P", |
5825 doc: /* Position point relative to window. | 5766 doc: /* Position point relative to window. |
5826 With no argument, position point at center of window. | 5767 With no argument, position point at center of window. |
5827 An argument specifies vertical position within the window; | 5768 An argument specifies vertical position within the window; |
5828 zero means top of window, negative means relative to bottom of window. */) | 5769 zero means top of window, negative means relative to bottom of window. */) |
5829 (arg) | 5770 (Lisp_Object arg) |
5830 Lisp_Object arg; | |
5831 { | 5771 { |
5832 struct window *w = XWINDOW (selected_window); | 5772 struct window *w = XWINDOW (selected_window); |
5833 int lines, start; | 5773 int lines, start; |
5834 Lisp_Object window; | 5774 Lisp_Object window; |
5835 #if 0 | 5775 #if 0 |
5938 #define SAVED_WINDOW_N(swv,n) \ | 5878 #define SAVED_WINDOW_N(swv,n) \ |
5939 ((struct saved_window *) (XVECTOR ((swv)->contents[(n)]))) | 5879 ((struct saved_window *) (XVECTOR ((swv)->contents[(n)]))) |
5940 | 5880 |
5941 DEFUN ("window-configuration-p", Fwindow_configuration_p, Swindow_configuration_p, 1, 1, 0, | 5881 DEFUN ("window-configuration-p", Fwindow_configuration_p, Swindow_configuration_p, 1, 1, 0, |
5942 doc: /* Return t if OBJECT is a window-configuration object. */) | 5882 doc: /* Return t if OBJECT is a window-configuration object. */) |
5943 (object) | 5883 (Lisp_Object object) |
5944 Lisp_Object object; | |
5945 { | 5884 { |
5946 return WINDOW_CONFIGURATIONP (object) ? Qt : Qnil; | 5885 return WINDOW_CONFIGURATIONP (object) ? Qt : Qnil; |
5947 } | 5886 } |
5948 | 5887 |
5949 DEFUN ("window-configuration-frame", Fwindow_configuration_frame, Swindow_configuration_frame, 1, 1, 0, | 5888 DEFUN ("window-configuration-frame", Fwindow_configuration_frame, Swindow_configuration_frame, 1, 1, 0, |
5950 doc: /* Return the frame that CONFIG, a window-configuration object, is about. */) | 5889 doc: /* Return the frame that CONFIG, a window-configuration object, is about. */) |
5951 (config) | 5890 (Lisp_Object config) |
5952 Lisp_Object config; | |
5953 { | 5891 { |
5954 register struct save_window_data *data; | 5892 register struct save_window_data *data; |
5955 struct Lisp_Vector *saved_windows; | 5893 struct Lisp_Vector *saved_windows; |
5956 | 5894 |
5957 CHECK_WINDOW_CONFIGURATION (config); | 5895 CHECK_WINDOW_CONFIGURATION (config); |
5967 CONFIGURATION must be a value previously returned | 5905 CONFIGURATION must be a value previously returned |
5968 by `current-window-configuration' (which see). | 5906 by `current-window-configuration' (which see). |
5969 If CONFIGURATION was made from a frame that is now deleted, | 5907 If CONFIGURATION was made from a frame that is now deleted, |
5970 only frame-independent values can be restored. In this case, | 5908 only frame-independent values can be restored. In this case, |
5971 the return value is nil. Otherwise the value is t. */) | 5909 the return value is nil. Otherwise the value is t. */) |
5972 (configuration) | 5910 (Lisp_Object configuration) |
5973 Lisp_Object configuration; | |
5974 { | 5911 { |
5975 register struct save_window_data *data; | 5912 register struct save_window_data *data; |
5976 struct Lisp_Vector *saved_windows; | 5913 struct Lisp_Vector *saved_windows; |
5977 Lisp_Object new_current_buffer; | 5914 Lisp_Object new_current_buffer; |
5978 Lisp_Object frame; | 5915 Lisp_Object frame; |
6474 and for each displayed buffer, where display starts, and the positions of | 6411 and for each displayed buffer, where display starts, and the positions of |
6475 point and mark. An exception is made for point in the current buffer: | 6412 point and mark. An exception is made for point in the current buffer: |
6476 its value is -not- saved. | 6413 its value is -not- saved. |
6477 This also records the currently selected frame, and FRAME's focus | 6414 This also records the currently selected frame, and FRAME's focus |
6478 redirection (see `redirect-frame-focus'). */) | 6415 redirection (see `redirect-frame-focus'). */) |
6479 (frame) | 6416 (Lisp_Object frame) |
6480 Lisp_Object frame; | |
6481 { | 6417 { |
6482 register Lisp_Object tem; | 6418 register Lisp_Object tem; |
6483 register int n_windows; | 6419 register int n_windows; |
6484 register struct save_window_data *data; | 6420 register struct save_window_data *data; |
6485 register int i; | 6421 register int i; |
6523 and the value of point and mark for each window. | 6459 and the value of point and mark for each window. |
6524 Also restore the choice of selected window. | 6460 Also restore the choice of selected window. |
6525 Also restore which buffer is current. | 6461 Also restore which buffer is current. |
6526 Does not restore the value of point in current buffer. | 6462 Does not restore the value of point in current buffer. |
6527 usage: (save-window-excursion BODY...) */) | 6463 usage: (save-window-excursion BODY...) */) |
6528 (args) | 6464 (Lisp_Object args) |
6529 Lisp_Object args; | |
6530 { | 6465 { |
6531 register Lisp_Object val; | 6466 register Lisp_Object val; |
6532 register int count = SPECPDL_INDEX (); | 6467 register int count = SPECPDL_INDEX (); |
6533 | 6468 |
6534 record_unwind_protect (Fset_window_configuration, | 6469 record_unwind_protect (Fset_window_configuration, |
6595 again be a window or a list representing a window split, and so on. | 6530 again be a window or a list representing a window split, and so on. |
6596 EDGES is a list \(LEFT TOP RIGHT BOTTOM) as returned by `window-edges'. | 6531 EDGES is a list \(LEFT TOP RIGHT BOTTOM) as returned by `window-edges'. |
6597 | 6532 |
6598 If FRAME is nil or omitted, return information on the currently | 6533 If FRAME is nil or omitted, return information on the currently |
6599 selected frame. */) | 6534 selected frame. */) |
6600 (frame) | 6535 (Lisp_Object frame) |
6601 Lisp_Object frame; | |
6602 { | 6536 { |
6603 FRAME_PTR f; | 6537 FRAME_PTR f; |
6604 | 6538 |
6605 if (NILP (frame)) | 6539 if (NILP (frame)) |
6606 frame = selected_frame; | 6540 frame = selected_frame; |
6625 If WINDOW is nil, set margins of the currently selected window. | 6559 If WINDOW is nil, set margins of the currently selected window. |
6626 Second arg LEFT-WIDTH specifies the number of character cells to | 6560 Second arg LEFT-WIDTH specifies the number of character cells to |
6627 reserve for the left marginal area. Optional third arg RIGHT-WIDTH | 6561 reserve for the left marginal area. Optional third arg RIGHT-WIDTH |
6628 does the same for the right marginal area. A nil width parameter | 6562 does the same for the right marginal area. A nil width parameter |
6629 means no margin. */) | 6563 means no margin. */) |
6630 (window, left_width, right_width) | 6564 (Lisp_Object window, Lisp_Object left_width, Lisp_Object right_width) |
6631 Lisp_Object window, left_width, right_width; | |
6632 { | 6565 { |
6633 struct window *w = decode_window (window); | 6566 struct window *w = decode_window (window); |
6634 | 6567 |
6635 /* Translate negative or zero widths to nil. | 6568 /* Translate negative or zero widths to nil. |
6636 Margins that are too wide have to be checked elsewhere. */ | 6569 Margins that are too wide have to be checked elsewhere. */ |
6670 doc: /* Get width of marginal areas of window WINDOW. | 6603 doc: /* Get width of marginal areas of window WINDOW. |
6671 If WINDOW is omitted or nil, use the currently selected window. | 6604 If WINDOW is omitted or nil, use the currently selected window. |
6672 Value is a cons of the form (LEFT-WIDTH . RIGHT-WIDTH). | 6605 Value is a cons of the form (LEFT-WIDTH . RIGHT-WIDTH). |
6673 If a marginal area does not exist, its width will be returned | 6606 If a marginal area does not exist, its width will be returned |
6674 as nil. */) | 6607 as nil. */) |
6675 (window) | 6608 (Lisp_Object window) |
6676 Lisp_Object window; | |
6677 { | 6609 { |
6678 struct window *w = decode_window (window); | 6610 struct window *w = decode_window (window); |
6679 return Fcons (w->left_margin_cols, w->right_margin_cols); | 6611 return Fcons (w->left_margin_cols, w->right_margin_cols); |
6680 } | 6612 } |
6681 | 6613 |
6696 frame's default fringe width. Default fringe widths can be set with | 6628 frame's default fringe width. Default fringe widths can be set with |
6697 the command `set-fringe-style'. | 6629 the command `set-fringe-style'. |
6698 If optional fourth arg OUTSIDE-MARGINS is non-nil, draw the fringes | 6630 If optional fourth arg OUTSIDE-MARGINS is non-nil, draw the fringes |
6699 outside of the display margins. By default, fringes are drawn between | 6631 outside of the display margins. By default, fringes are drawn between |
6700 display marginal areas and the text area. */) | 6632 display marginal areas and the text area. */) |
6701 (window, left_width, right_width, outside_margins) | 6633 (Lisp_Object window, Lisp_Object left_width, Lisp_Object right_width, Lisp_Object outside_margins) |
6702 Lisp_Object window, left_width, right_width, outside_margins; | |
6703 { | 6634 { |
6704 struct window *w = decode_window (window); | 6635 struct window *w = decode_window (window); |
6705 | 6636 |
6706 if (!NILP (left_width)) | 6637 if (!NILP (left_width)) |
6707 CHECK_NATNUM (left_width); | 6638 CHECK_NATNUM (left_width); |
6734 DEFUN ("window-fringes", Fwindow_fringes, Swindow_fringes, | 6665 DEFUN ("window-fringes", Fwindow_fringes, Swindow_fringes, |
6735 0, 1, 0, | 6666 0, 1, 0, |
6736 doc: /* Get width of fringes of window WINDOW. | 6667 doc: /* Get width of fringes of window WINDOW. |
6737 If WINDOW is omitted or nil, use the currently selected window. | 6668 If WINDOW is omitted or nil, use the currently selected window. |
6738 Value is a list of the form (LEFT-WIDTH RIGHT-WIDTH OUTSIDE-MARGINS). */) | 6669 Value is a list of the form (LEFT-WIDTH RIGHT-WIDTH OUTSIDE-MARGINS). */) |
6739 (window) | 6670 (Lisp_Object window) |
6740 Lisp_Object window; | |
6741 { | 6671 { |
6742 struct window *w = decode_window (window); | 6672 struct window *w = decode_window (window); |
6743 | 6673 |
6744 return Fcons (make_number (WINDOW_LEFT_FRINGE_WIDTH (w)), | 6674 return Fcons (make_number (WINDOW_LEFT_FRINGE_WIDTH (w)), |
6745 Fcons (make_number (WINDOW_RIGHT_FRINGE_WIDTH (w)), | 6675 Fcons (make_number (WINDOW_RIGHT_FRINGE_WIDTH (w)), |
6762 Third parameter VERTICAL-TYPE specifies the type of the vertical scroll | 6692 Third parameter VERTICAL-TYPE specifies the type of the vertical scroll |
6763 bar: left, right, or nil. | 6693 bar: left, right, or nil. |
6764 If WIDTH is nil, use the frame's scroll-bar width. | 6694 If WIDTH is nil, use the frame's scroll-bar width. |
6765 If VERTICAL-TYPE is t, use the frame's scroll-bar type. | 6695 If VERTICAL-TYPE is t, use the frame's scroll-bar type. |
6766 Fourth parameter HORIZONTAL-TYPE is currently unused. */) | 6696 Fourth parameter HORIZONTAL-TYPE is currently unused. */) |
6767 (window, width, vertical_type, horizontal_type) | 6697 (Lisp_Object window, Lisp_Object width, Lisp_Object vertical_type, Lisp_Object horizontal_type) |
6768 Lisp_Object window, width, vertical_type, horizontal_type; | |
6769 { | 6698 { |
6770 struct window *w = decode_window (window); | 6699 struct window *w = decode_window (window); |
6771 | 6700 |
6772 if (!NILP (width)) | 6701 if (!NILP (width)) |
6773 { | 6702 { |
6807 doc: /* Get width and type of scroll bars of window WINDOW. | 6736 doc: /* Get width and type of scroll bars of window WINDOW. |
6808 If WINDOW is omitted or nil, use the currently selected window. | 6737 If WINDOW is omitted or nil, use the currently selected window. |
6809 Value is a list of the form (WIDTH COLS VERTICAL-TYPE HORIZONTAL-TYPE). | 6738 Value is a list of the form (WIDTH COLS VERTICAL-TYPE HORIZONTAL-TYPE). |
6810 If WIDTH is nil or TYPE is t, the window is using the frame's corresponding | 6739 If WIDTH is nil or TYPE is t, the window is using the frame's corresponding |
6811 value. */) | 6740 value. */) |
6812 (window) | 6741 (Lisp_Object window) |
6813 Lisp_Object window; | |
6814 { | 6742 { |
6815 struct window *w = decode_window (window); | 6743 struct window *w = decode_window (window); |
6816 return Fcons (make_number ((WINDOW_CONFIG_SCROLL_BAR_WIDTH (w) | 6744 return Fcons (make_number ((WINDOW_CONFIG_SCROLL_BAR_WIDTH (w) |
6817 ? WINDOW_CONFIG_SCROLL_BAR_WIDTH (w) | 6745 ? WINDOW_CONFIG_SCROLL_BAR_WIDTH (w) |
6818 : WINDOW_SCROLL_BAR_AREA_WIDTH (w))), | 6746 : WINDOW_SCROLL_BAR_AREA_WIDTH (w))), |
6830 DEFUN ("window-vscroll", Fwindow_vscroll, Swindow_vscroll, 0, 2, 0, | 6758 DEFUN ("window-vscroll", Fwindow_vscroll, Swindow_vscroll, 0, 2, 0, |
6831 doc: /* Return the amount by which WINDOW is scrolled vertically. | 6759 doc: /* Return the amount by which WINDOW is scrolled vertically. |
6832 Use the selected window if WINDOW is nil or omitted. | 6760 Use the selected window if WINDOW is nil or omitted. |
6833 Normally, value is a multiple of the canonical character height of WINDOW; | 6761 Normally, value is a multiple of the canonical character height of WINDOW; |
6834 optional second arg PIXELS-P means value is measured in pixels. */) | 6762 optional second arg PIXELS-P means value is measured in pixels. */) |
6835 (window, pixels_p) | 6763 (Lisp_Object window, Lisp_Object pixels_p) |
6836 Lisp_Object window, pixels_p; | |
6837 { | 6764 { |
6838 Lisp_Object result; | 6765 Lisp_Object result; |
6839 struct frame *f; | 6766 struct frame *f; |
6840 struct window *w; | 6767 struct window *w; |
6841 | 6768 |
6864 optional third arg PIXELS-P non-nil means that VSCROLL is in pixels. | 6791 optional third arg PIXELS-P non-nil means that VSCROLL is in pixels. |
6865 If PIXELS-P is nil, VSCROLL may have to be rounded so that it | 6792 If PIXELS-P is nil, VSCROLL may have to be rounded so that it |
6866 corresponds to an integral number of pixels. The return value is the | 6793 corresponds to an integral number of pixels. The return value is the |
6867 result of this rounding. | 6794 result of this rounding. |
6868 If PIXELS-P is non-nil, the return value is VSCROLL. */) | 6795 If PIXELS-P is non-nil, the return value is VSCROLL. */) |
6869 (window, vscroll, pixels_p) | 6796 (Lisp_Object window, Lisp_Object vscroll, Lisp_Object pixels_p) |
6870 Lisp_Object window, vscroll, pixels_p; | |
6871 { | 6797 { |
6872 struct window *w; | 6798 struct window *w; |
6873 struct frame *f; | 6799 struct frame *f; |
6874 | 6800 |
6875 if (NILP (window)) | 6801 if (NILP (window)) |
7099 DEFUN ("compare-window-configurations", Fcompare_window_configurations, | 7025 DEFUN ("compare-window-configurations", Fcompare_window_configurations, |
7100 Scompare_window_configurations, 2, 2, 0, | 7026 Scompare_window_configurations, 2, 2, 0, |
7101 doc: /* Compare two window configurations as regards the structure of windows. | 7027 doc: /* Compare two window configurations as regards the structure of windows. |
7102 This function ignores details such as the values of point and mark | 7028 This function ignores details such as the values of point and mark |
7103 and scrolling positions. */) | 7029 and scrolling positions. */) |
7104 (x, y) | 7030 (Lisp_Object x, Lisp_Object y) |
7105 Lisp_Object x, y; | |
7106 { | 7031 { |
7107 if (compare_window_configurations (x, y, 1)) | 7032 if (compare_window_configurations (x, y, 1)) |
7108 return Qt; | 7033 return Qt; |
7109 return Qnil; | 7034 return Qnil; |
7110 } | 7035 } |