diff options
| author | Karl Heuer | 1994-09-19 00:17:26 +0000 |
|---|---|---|
| committer | Karl Heuer | 1994-09-19 00:17:26 +0000 |
| commit | 92992c7e07f8ec934b0766a2803b5964e5eff2d5 (patch) | |
| tree | 6586b0cb40df9f7beb218142409c8f25e7cd56e2 /src | |
| parent | 16a3738c96038f92866676208471bdedda8fed3a (diff) | |
| download | emacs-92992c7e07f8ec934b0766a2803b5964e5eff2d5.tar.gz emacs-92992c7e07f8ec934b0766a2803b5964e5eff2d5.zip | |
(vmotion, Fvertical_motion): Fix Lisp_Object vs. int problems.
Diffstat (limited to 'src')
| -rw-r--r-- | src/indent.c | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/src/indent.c b/src/indent.c index 4fc1c264816..b50fab4f6a4 100644 --- a/src/indent.c +++ b/src/indent.c | |||
| @@ -748,7 +748,7 @@ vmotion (from, vtarget, width, hscroll, window) | |||
| 748 | struct position pos; | 748 | struct position pos; |
| 749 | /* vpos is cumulative vertical position, changed as from is changed */ | 749 | /* vpos is cumulative vertical position, changed as from is changed */ |
| 750 | register int vpos = 0; | 750 | register int vpos = 0; |
| 751 | register int prevline; | 751 | Lisp_Object prevline; |
| 752 | register int first; | 752 | register int first; |
| 753 | int lmargin = hscroll > 0 ? 1 - hscroll : 0; | 753 | int lmargin = hscroll > 0 ? 1 - hscroll : 0; |
| 754 | int selective | 754 | int selective |
| @@ -768,20 +768,22 @@ vmotion (from, vtarget, width, hscroll, window) | |||
| 768 | to determine hpos of starting point */ | 768 | to determine hpos of starting point */ |
| 769 | if (from > BEGV && FETCH_CHAR (from - 1) != '\n') | 769 | if (from > BEGV && FETCH_CHAR (from - 1) != '\n') |
| 770 | { | 770 | { |
| 771 | prevline = find_next_newline_no_quit (from, -1); | 771 | XFASTINT (prevline) = find_next_newline_no_quit (from, -1); |
| 772 | while (prevline > BEGV | 772 | while (XFASTINT (prevline) > BEGV |
| 773 | && ((selective > 0 | 773 | && ((selective > 0 |
| 774 | && indented_beyond_p (prevline, selective)) | 774 | && indented_beyond_p (XFASTINT (prevline), selective)) |
| 775 | #ifdef USE_TEXT_PROPERTIES | 775 | #ifdef USE_TEXT_PROPERTIES |
| 776 | /* watch out for newlines with `invisible' property */ | 776 | /* watch out for newlines with `invisible' property */ |
| 777 | || ! NILP (Fget_char_property (XFASTINT (prevline), | 777 | || ! NILP (Fget_char_property (prevline, |
| 778 | Qinvisible, | 778 | Qinvisible, |
| 779 | window)) | 779 | window)) |
| 780 | #endif | 780 | #endif |
| 781 | )) | 781 | )) |
| 782 | prevline = find_next_newline_no_quit (prevline - 1, -1); | 782 | XFASTINT (prevline) |
| 783 | pos = *compute_motion (prevline, 0, | 783 | = find_next_newline_no_quit (XFASTINT (prevline) - 1, -1); |
| 784 | lmargin + (prevline == 1 ? start_hpos : 0), | 784 | pos = *compute_motion (XFASTINT (prevline), 0, |
| 785 | lmargin + (XFASTINT (prevline) == 1 | ||
| 786 | ? start_hpos : 0), | ||
| 785 | from, 1 << (INTBITS - 2), 0, | 787 | from, 1 << (INTBITS - 2), 0, |
| 786 | width, hscroll, 0, XWINDOW (window)); | 788 | width, hscroll, 0, XWINDOW (window)); |
| 787 | } | 789 | } |
| @@ -803,29 +805,29 @@ vmotion (from, vtarget, width, hscroll, window) | |||
| 803 | 805 | ||
| 804 | while ((vpos > vtarget || first) && from > BEGV) | 806 | while ((vpos > vtarget || first) && from > BEGV) |
| 805 | { | 807 | { |
| 806 | prevline = from; | 808 | XFASTINT (prevline) = from; |
| 807 | while (1) | 809 | while (1) |
| 808 | { | 810 | { |
| 809 | prevline = find_next_newline_no_quit (prevline - 1, -1); | 811 | XFASTINT (prevline) |
| 810 | if (prevline == BEGV | 812 | = find_next_newline_no_quit (XFASTINT (prevline) - 1, -1); |
| 813 | if (XFASTINT (prevline) == BEGV | ||
| 811 | || ((selective <= 0 | 814 | || ((selective <= 0 |
| 812 | || ! indented_beyond_p (prevline, selective)) | 815 | || ! indented_beyond_p (XFASTINT (prevline), selective)) |
| 813 | #ifdef USE_TEXT_PROPERTIES | 816 | #ifdef USE_TEXT_PROPERTIES |
| 814 | /* watch out for newlines with `invisible' property */ | 817 | /* watch out for newlines with `invisible' property */ |
| 815 | && NILP (Fget_char_property (XFASTINT (prevline), | 818 | && NILP (Fget_char_property (prevline, Qinvisible, window)) |
| 816 | Qinvisible, | ||
| 817 | window)) | ||
| 818 | #endif | 819 | #endif |
| 819 | )) | 820 | )) |
| 820 | break; | 821 | break; |
| 821 | } | 822 | } |
| 822 | pos = *compute_motion (prevline, 0, | 823 | pos = *compute_motion (XFASTINT (prevline), 0, |
| 823 | lmargin + (prevline == 1 ? start_hpos : 0), | 824 | lmargin + (XFASTINT (prevline) == 1 |
| 825 | ? start_hpos : 0), | ||
| 824 | from, 1 << (INTBITS - 2), 0, | 826 | from, 1 << (INTBITS - 2), 0, |
| 825 | width, hscroll, 0, XWINDOW (window)); | 827 | width, hscroll, 0, XWINDOW (window)); |
| 826 | vpos -= pos.vpos; | 828 | vpos -= pos.vpos; |
| 827 | first = 0; | 829 | first = 0; |
| 828 | from = prevline; | 830 | from = XFASTINT (prevline); |
| 829 | } | 831 | } |
| 830 | 832 | ||
| 831 | /* If we made exactly the desired vertical distance, | 833 | /* If we made exactly the desired vertical distance, |
| @@ -869,7 +871,7 @@ if beginning or end of buffer was reached.") | |||
| 869 | if (! NILP (window)) | 871 | if (! NILP (window)) |
| 870 | CHECK_WINDOW (window, 0); | 872 | CHECK_WINDOW (window, 0); |
| 871 | else | 873 | else |
| 872 | XSET (window, Lisp_Window, selected_window); | 874 | window = selected_window; |
| 873 | 875 | ||
| 874 | w = XWINDOW (window); | 876 | w = XWINDOW (window); |
| 875 | 877 | ||