diff options
| author | Gerd Moellmann | 1999-07-21 21:43:52 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 1999-07-21 21:43:52 +0000 |
| commit | 8720a429d9432c585fe1c9db3b52a6d34da8aa36 (patch) | |
| tree | 85e61e70a4320ff1ef83dcbe78b0a8f415b13a2b /src | |
| parent | 04e209dc56204c774dc08879e54d50138ce48101 (diff) | |
| download | emacs-8720a429d9432c585fe1c9db3b52a6d34da8aa36.tar.gz emacs-8720a429d9432c585fe1c9db3b52a6d34da8aa36.zip | |
(Fvertical_motion): Rewritten.
Diffstat (limited to 'src')
| -rw-r--r-- | src/indent.c | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/src/indent.c b/src/indent.c index 5e5c1a0a68d..c51f5bb3fc4 100644 --- a/src/indent.c +++ b/src/indent.c | |||
| @@ -203,7 +203,7 @@ width_run_cache_on_off () | |||
| 203 | characters immediately following, then *NEXT_BOUNDARY_P | 203 | characters immediately following, then *NEXT_BOUNDARY_P |
| 204 | will equal the return value. */ | 204 | will equal the return value. */ |
| 205 | 205 | ||
| 206 | static int | 206 | int |
| 207 | skip_invisible (pos, next_boundary_p, to, window) | 207 | skip_invisible (pos, next_boundary_p, to, window) |
| 208 | int pos; | 208 | int pos; |
| 209 | int *next_boundary_p; | 209 | int *next_boundary_p; |
| @@ -1518,6 +1518,7 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, | |||
| 1518 | return &val_compute_motion; | 1518 | return &val_compute_motion; |
| 1519 | } | 1519 | } |
| 1520 | 1520 | ||
| 1521 | |||
| 1521 | #if 0 /* The doc string is too long for some compilers, | 1522 | #if 0 /* The doc string is too long for some compilers, |
| 1522 | but make-docfile can find it in this comment. */ | 1523 | but make-docfile can find it in this comment. */ |
| 1523 | DEFUN ("compute-motion", Ffoo, Sfoo, 7, 7, 0, | 1524 | DEFUN ("compute-motion", Ffoo, Sfoo, 7, 7, 0, |
| @@ -1814,7 +1815,10 @@ whether or not it is currently displayed in some window.") | |||
| 1814 | (lines, window) | 1815 | (lines, window) |
| 1815 | Lisp_Object lines, window; | 1816 | Lisp_Object lines, window; |
| 1816 | { | 1817 | { |
| 1817 | struct position pos; | 1818 | struct it it; |
| 1819 | struct text_pos pt; | ||
| 1820 | struct buffer *old, *b; | ||
| 1821 | struct window *w; | ||
| 1818 | 1822 | ||
| 1819 | CHECK_NUMBER (lines, 0); | 1823 | CHECK_NUMBER (lines, 0); |
| 1820 | if (! NILP (window)) | 1824 | if (! NILP (window)) |
| @@ -1822,11 +1826,28 @@ whether or not it is currently displayed in some window.") | |||
| 1822 | else | 1826 | else |
| 1823 | window = selected_window; | 1827 | window = selected_window; |
| 1824 | 1828 | ||
| 1825 | pos = *vmotion (PT, (int) XINT (lines), XWINDOW (window)); | 1829 | w = XWINDOW (window); |
| 1826 | 1830 | b = XBUFFER (w->buffer); | |
| 1827 | SET_PT (pos.bufpos); | 1831 | if (b != current_buffer) |
| 1828 | return make_number (pos.vpos); | 1832 | { |
| 1833 | old = current_buffer; | ||
| 1834 | set_buffer_internal_1 (b); | ||
| 1835 | } | ||
| 1836 | else | ||
| 1837 | old = NULL; | ||
| 1838 | |||
| 1839 | SET_TEXT_POS (pt, PT, PT_BYTE); | ||
| 1840 | start_display (&it, w, pt); | ||
| 1841 | move_it_by_lines (&it, XINT (lines), 0); | ||
| 1842 | SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); | ||
| 1843 | |||
| 1844 | if (old) | ||
| 1845 | set_buffer_internal_1 (old); | ||
| 1846 | |||
| 1847 | return make_number (it.vpos); | ||
| 1829 | } | 1848 | } |
| 1849 | |||
| 1850 | |||
| 1830 | 1851 | ||
| 1831 | /* file's initialization. */ | 1852 | /* file's initialization. */ |
| 1832 | 1853 | ||