aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer1994-03-18 04:18:37 +0000
committerKarl Heuer1994-03-18 04:18:37 +0000
commit1827d03696e86b9c15aa71c3ebcdf1039545b399 (patch)
tree0e3f9b77f69e7c12e08f2ed58d90d5d47b62c7a6 /src
parent4390cc9c3afe81bbdd171cf810a991342082da52 (diff)
downloademacs-1827d03696e86b9c15aa71c3ebcdf1039545b399.tar.gz
emacs-1827d03696e86b9c15aa71c3ebcdf1039545b399.zip
(compute_motion): Doc fixes.
Diffstat (limited to 'src')
-rw-r--r--src/indent.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/indent.c b/src/indent.c
index 5eef49c3a16..83122d3b0db 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -401,6 +401,11 @@ struct position val_compute_motion;
401 and vpos give its cartesian location. I'm not clear on what the 401 and vpos give its cartesian location. I'm not clear on what the
402 other members are. 402 other members are.
403 403
404 Note that FROMHPOS and TOHPOS should be expressed in real screen
405 columns, taking HSCROLL and the truncation glyph at the left margin
406 into account. That is, beginning-of-line moves you to the hpos
407 -HSCROLL + (HSCROLL > 0).
408
404 For example, to find the buffer position of column COL of line LINE 409 For example, to find the buffer position of column COL of line LINE
405 of a certain window, pass the window's starting location as FROM 410 of a certain window, pass the window's starting location as FROM
406 and the window's upper-left coordinates as FROMVPOS and FROMHPOS. 411 and the window's upper-left coordinates as FROMVPOS and FROMHPOS.
@@ -422,12 +427,12 @@ struct position val_compute_motion;
422 FRAME_HAS_VERTICAL_SCROLL_BARS (XFRAME (WINDOW_FRAME (window))) 427 FRAME_HAS_VERTICAL_SCROLL_BARS (XFRAME (WINDOW_FRAME (window)))
423 and frame_width = FRAME_WIDTH (XFRAME (window->frame)) 428 and frame_width = FRAME_WIDTH (XFRAME (window->frame))
424 429
425 Or, 430 Or you can let window_internal_width do this all for you, and write:
426 window_internal_width (w) - 1 431 window_internal_width (w) - 1
427 432
428 The `-1' accounts for the continuation-line backslashes; the rest 433 The `-1' accounts for the continuation-line backslashes; the rest
429 accounts for window borders if the window is split horizontally, and 434 accounts for window borders if the window is split horizontally, and
430 the scroll bars if the frame supports them. */ 435 the scroll bars if they are turned on. */
431 436
432struct position * 437struct position *
433compute_motion (from, fromvpos, fromhpos, to, tovpos, tohpos, width, hscroll, tab_offset) 438compute_motion (from, fromvpos, fromhpos, to, tovpos, tohpos, width, hscroll, tab_offset)
@@ -537,7 +542,7 @@ compute_motion (from, fromvpos, fromhpos, to, tovpos, tohpos, width, hscroll, ta
537 vpos++; 542 vpos++;
538 hpos = 0; 543 hpos = 0;
539 hpos -= hscroll; 544 hpos -= hscroll;
540 if (hscroll > 0) hpos++; /* Count the $ on column 0 */ 545 if (hscroll > 0) hpos++; /* Truncation glyph on column 0 */
541 tab_offset = 0; 546 tab_offset = 0;
542 } 547 }
543 } 548 }