comparison src/indent.c @ 764:bb24f1180bb6

entered into RCS
author Jim Blandy <jimb@redhat.com>
date Mon, 13 Jul 1992 19:54:34 +0000
parents cde1f15848c6
children fa662930e654
comparison
equal deleted inserted replaced
763:f2efaa0394de 764:bb24f1180bb6
20 20
21 #include "config.h" 21 #include "config.h"
22 #include "lisp.h" 22 #include "lisp.h"
23 #include "buffer.h" 23 #include "buffer.h"
24 #include "indent.h" 24 #include "indent.h"
25 #include "screen.h" 25 #include "frame.h"
26 #include "window.h" 26 #include "window.h"
27 #include "termchar.h" 27 #include "termchar.h"
28 #include "termopts.h" 28 #include "termopts.h"
29 #include "disptab.h" 29 #include "disptab.h"
30 30
68 "Return the horizontal position of point. Beginning of line is column 0.\n\ 68 "Return the horizontal position of point. Beginning of line is column 0.\n\
69 This is calculated by adding together the widths of all the displayed\n\ 69 This is calculated by adding together the widths of all the displayed\n\
70 representations of the character between the start of the previous line\n\ 70 representations of the character between the start of the previous line\n\
71 and point. (eg control characters will have a width of 2 or 4, tabs\n\ 71 and point. (eg control characters will have a width of 2 or 4, tabs\n\
72 will have a variable width)\n\ 72 will have a variable width)\n\
73 Ignores finite width of screen, which means that this function may return\n\ 73 Ignores finite width of frame, which means that this function may return\n\
74 values greater than (screen-width).\n\ 74 values greater than (frame-width).\n\
75 Whether the line is visible (if `selective-display' is t) has no effect;\n\ 75 Whether the line is visible (if `selective-display' is t) has no effect;\n\
76 however, ^M is treated as end of line when `selective-display' is t.") 76 however, ^M is treated as end of line when `selective-display' is t.")
77 () 77 ()
78 { 78 {
79 Lisp_Object temp; 79 Lisp_Object temp;
393 TOHPOS. 393 TOHPOS.
394 394
395 When displaying in window w, a typical formula for WIDTH is: 395 When displaying in window w, a typical formula for WIDTH is:
396 396
397 window_width - 1 397 window_width - 1
398 - (window_width + window_left != screen_width) 398 - (window_width + window_left != frame_width)
399 399
400 where 400 where
401 window_width is XFASTINT (w->width), 401 window_width is XFASTINT (w->width),
402 window_left is XFASTINT (w->left), 402 window_left is XFASTINT (w->left),
403 and screen_width = SCREEN_WIDTH (XSCREEN (window->screen)) 403 and frame_width = FRAME_WIDTH (XFRAME (window->frame))
404 404
405 This accounts for the continuation-line backslashes, and the window 405 This accounts for the continuation-line backslashes, and the window
406 borders if the window is split vertically. */ 406 borders if the window is split vertically. */
407 407
408 struct position * 408 struct position *
511 if (vpos > tovpos 511 if (vpos > tovpos
512 || (vpos == tovpos && hpos >= tohpos)) 512 || (vpos == tovpos && hpos >= tohpos))
513 break; 513 break;
514 if (hscroll 514 if (hscroll
515 || (truncate_partial_width_windows 515 || (truncate_partial_width_windows
516 && width + 1 < SCREEN_WIDTH (selected_screen)) 516 && width + 1 < FRAME_WIDTH (selected_frame))
517 || !NILP (current_buffer->truncate_lines)) 517 || !NILP (current_buffer->truncate_lines))
518 { 518 {
519 /* Truncating: skip to newline. */ 519 /* Truncating: skip to newline. */
520 while (pos < to && FETCH_CHAR (pos) != '\n') pos++; 520 while (pos < to && FETCH_CHAR (pos) != '\n') pos++;
521 pos--; 521 pos--;
559 { 559 {
560 int opoint = point; 560 int opoint = point;
561 int col; 561 int col;
562 int width = XFASTINT (w->width) - 1 562 int width = XFASTINT (w->width) - 1
563 - (XFASTINT (w->width) + XFASTINT (w->left) 563 - (XFASTINT (w->width) + XFASTINT (w->left)
564 != SCREEN_WIDTH (XSCREEN (w->screen))); 564 != FRAME_WIDTH (XFRAME (w->frame)));
565 565
566 if (pos == BEGV || FETCH_CHAR (pos - 1) == '\n') 566 if (pos == BEGV || FETCH_CHAR (pos - 1) == '\n')
567 return 0; 567 return 0;
568 SET_PT (pos); 568 SET_PT (pos);
569 col = current_column (); 569 col = current_column ();
676 { 676 {
677 struct position pos; 677 struct position pos;
678 register struct window *w = XWINDOW (selected_window); 678 register struct window *w = XWINDOW (selected_window);
679 int width = XFASTINT (w->width) - 1 679 int width = XFASTINT (w->width) - 1
680 - (XFASTINT (w->width) + XFASTINT (w->left) 680 - (XFASTINT (w->width) + XFASTINT (w->left)
681 != SCREEN_WIDTH (XSCREEN (w->screen))); 681 != FRAME_WIDTH (XFRAME (w->frame)));
682 682
683 CHECK_NUMBER (lines, 0); 683 CHECK_NUMBER (lines, 0);
684 684
685 pos = *vmotion (point, XINT (lines), width, 685 pos = *vmotion (point, XINT (lines), width,
686 /* Not XFASTINT since perhaps could be negative */ 686 /* Not XFASTINT since perhaps could be negative */