diff options
| author | Jim Blandy <jimb@redhat.com> | 1993-01-14 15:10:14 +0000 |
|---|---|---|
| committer | Jim Blandy <jimb@redhat.com> | 1993-01-14 15:10:14 +0000 |
| commit | fa61c7012f7c49b718341e92cdd864b184c5693d (patch) | |
| tree | ffacad6a6346a64b56af6ac1c9508dbc9f7b55a3 /src/indent.c | |
| parent | 20a6c8d708ed56e3cbaa0cba2f56d7ae446ae6a5 (diff) | |
| download | emacs-fa61c7012f7c49b718341e92cdd864b184c5693d.tar.gz | |
* window.c (window_internal_width): New function.
* lisp.h (window_internal_height, window_internal_width): Add
extern declarations for these.
* dispnew.c (direct_output_for_insert, direct_output_forward_char,
buffer_posn_from_coords): Use window_internal_width instead of
writing out its definition.
* indent.c (compute_motion): Doc fix; mention scrollbars and
window_internal_width.
(pos_tab_offset, Fvertical_motion): Use window_internal_width
instead of writing it out.
* window.c (Fpos_visible_in_window_p, Fwindow_width, Fscroll_left,
Fscroll_right): Same.
* xdisp.c (redisplay, try_window, try_window_id,
display_text_line): Same.
Diffstat (limited to 'src/indent.c')
| -rw-r--r-- | src/indent.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/indent.c b/src/indent.c index d80ddd3891f..bcb3fe6169a 100644 --- a/src/indent.c +++ b/src/indent.c @@ -396,15 +396,23 @@ struct position val_compute_motion; When displaying in window w, a typical formula for WIDTH is: window_width - 1 - - (window_width + window_left != frame_width) + - (has_vertical_scrollbars + ? VERTICAL_SCROLLBAR_WIDTH + : (window_width + window_left != frame_width)) where window_width is XFASTINT (w->width), window_left is XFASTINT (w->left), - and frame_width = FRAME_WIDTH (XFRAME (window->frame)) + has_vertical_scrollbars is + FRAME_HAS_VERTICAL_SCROLLBARS (XFRAME (WINDOW_FRAME (window))) + and frame_width = FRAME_WIDTH (XFRAME (window->frame)) - This accounts for the continuation-line backslashes, and the window - borders if the window is split vertically. */ + Or, + window_internal_width (w) - 1 + + The `-1' accounts for the continuation-line backslashes; the rest + accounts for window borders if the window is split vertically, and + the scrollbars if the frame supports them. */ struct position * compute_motion (from, fromvpos, fromhpos, to, tovpos, tohpos, width, hscroll, tab_offset) @@ -560,9 +568,7 @@ pos_tab_offset (w, pos) { int opoint = point; int col; - int width = XFASTINT (w->width) - 1 - - (XFASTINT (w->width) + XFASTINT (w->left) - != FRAME_WIDTH (XFRAME (w->frame))); + int width = window_internal_width (w) - 1; if (pos == BEGV || FETCH_CHAR (pos - 1) == '\n') return 0; @@ -677,9 +683,7 @@ Returns number of lines moved; may be closer to zero than LINES\n\ { struct position pos; register struct window *w = XWINDOW (selected_window); - int width = XFASTINT (w->width) - 1 - - (XFASTINT (w->width) + XFASTINT (w->left) - != FRAME_WIDTH (XFRAME (w->frame))); + int width = window_internal_width (w) - 1; CHECK_NUMBER (lines, 0); |
