diff options
| author | Richard M. Stallman | 2004-10-27 10:57:40 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2004-10-27 10:57:40 +0000 |
| commit | 2965dff97966011811df1358102ecf840b738619 (patch) | |
| tree | 831177b28fb6a8a946bc3c41d07d47ea24cfdfc9 /src | |
| parent | 396b39cf4f0a1ead1e737b25491667fb2df6e0cc (diff) | |
| download | emacs-2965dff97966011811df1358102ecf840b738619.tar.gz emacs-2965dff97966011811df1358102ecf840b738619.zip | |
(vmotion): When moving up, check the newline before.
Make prevline an int, not a Lisp_Object.
Diffstat (limited to 'src')
| -rw-r--r-- | src/indent.c | 53 |
1 files changed, 25 insertions, 28 deletions
diff --git a/src/indent.c b/src/indent.c index de76464564e..23c6cb1986d 100644 --- a/src/indent.c +++ b/src/indent.c | |||
| @@ -1883,7 +1883,7 @@ vmotion (from, vtarget, w) | |||
| 1883 | struct position pos; | 1883 | struct position pos; |
| 1884 | /* vpos is cumulative vertical position, changed as from is changed */ | 1884 | /* vpos is cumulative vertical position, changed as from is changed */ |
| 1885 | register int vpos = 0; | 1885 | register int vpos = 0; |
| 1886 | Lisp_Object prevline; | 1886 | int prevline; |
| 1887 | register int first; | 1887 | register int first; |
| 1888 | int from_byte; | 1888 | int from_byte; |
| 1889 | int lmargin = hscroll > 0 ? 1 - hscroll : 0; | 1889 | int lmargin = hscroll > 0 ? 1 - hscroll : 0; |
| @@ -1917,23 +1917,21 @@ vmotion (from, vtarget, w) | |||
| 1917 | { | 1917 | { |
| 1918 | Lisp_Object propval; | 1918 | Lisp_Object propval; |
| 1919 | 1919 | ||
| 1920 | XSETFASTINT (prevline, find_next_newline_no_quit (from - 1, -1)); | 1920 | prevline = find_next_newline_no_quit (from - 1, -1); |
| 1921 | while (XFASTINT (prevline) > BEGV | 1921 | while (prevline > BEGV |
| 1922 | && ((selective > 0 | 1922 | && ((selective > 0 |
| 1923 | && indented_beyond_p (XFASTINT (prevline), | 1923 | && indented_beyond_p (prevline, |
| 1924 | CHAR_TO_BYTE (XFASTINT (prevline)), | 1924 | CHAR_TO_BYTE (prevline), |
| 1925 | (double) selective)) /* iftc */ | 1925 | (double) selective)) /* iftc */ |
| 1926 | /* watch out for newlines with `invisible' property */ | 1926 | /* Watch out for newlines with `invisible' property. |
| 1927 | || (propval = Fget_char_property (prevline, | 1927 | When moving upward, check the newline before. */ |
| 1928 | || (propval = Fget_char_property (make_number (prevline - 1), | ||
| 1928 | Qinvisible, | 1929 | Qinvisible, |
| 1929 | text_prop_object), | 1930 | text_prop_object), |
| 1930 | TEXT_PROP_MEANS_INVISIBLE (propval)))) | 1931 | TEXT_PROP_MEANS_INVISIBLE (propval)))) |
| 1931 | XSETFASTINT (prevline, | 1932 | prevline = find_next_newline_no_quit (prevline - 1, -1); |
| 1932 | find_next_newline_no_quit (XFASTINT (prevline) - 1, | 1933 | pos = *compute_motion (prevline, 0, |
| 1933 | -1)); | 1934 | lmargin + (prevline == BEG ? start_hpos : 0), |
| 1934 | pos = *compute_motion (XFASTINT (prevline), 0, | ||
| 1935 | lmargin + (XFASTINT (prevline) == BEG | ||
| 1936 | ? start_hpos : 0), | ||
| 1937 | 0, | 1935 | 0, |
| 1938 | from, | 1936 | from, |
| 1939 | /* Don't care for VPOS... */ | 1937 | /* Don't care for VPOS... */ |
| @@ -1944,12 +1942,11 @@ vmotion (from, vtarget, w) | |||
| 1944 | /* This compensates for start_hpos | 1942 | /* This compensates for start_hpos |
| 1945 | so that a tab as first character | 1943 | so that a tab as first character |
| 1946 | still occupies 8 columns. */ | 1944 | still occupies 8 columns. */ |
| 1947 | (XFASTINT (prevline) == BEG | 1945 | (prevline == BEG ? -start_hpos : 0), |
| 1948 | ? -start_hpos : 0), | ||
| 1949 | w); | 1946 | w); |
| 1950 | vpos -= pos.vpos; | 1947 | vpos -= pos.vpos; |
| 1951 | first = 0; | 1948 | first = 0; |
| 1952 | from = XFASTINT (prevline); | 1949 | from = prevline; |
| 1953 | } | 1950 | } |
| 1954 | 1951 | ||
| 1955 | /* If we made exactly the desired vertical distance, | 1952 | /* If we made exactly the desired vertical distance, |
| @@ -1977,21 +1974,21 @@ vmotion (from, vtarget, w) | |||
| 1977 | { | 1974 | { |
| 1978 | Lisp_Object propval; | 1975 | Lisp_Object propval; |
| 1979 | 1976 | ||
| 1980 | XSETFASTINT (prevline, find_next_newline_no_quit (from, -1)); | 1977 | prevline = find_next_newline_no_quit (from, -1); |
| 1981 | while (XFASTINT (prevline) > BEGV | 1978 | while (prevline > BEGV |
| 1982 | && ((selective > 0 | 1979 | && ((selective > 0 |
| 1983 | && indented_beyond_p (XFASTINT (prevline), | 1980 | && indented_beyond_p (prevline, |
| 1984 | CHAR_TO_BYTE (XFASTINT (prevline)), | 1981 | CHAR_TO_BYTE (prevline), |
| 1985 | (double) selective)) /* iftc */ | 1982 | (double) selective)) /* iftc */ |
| 1986 | /* watch out for newlines with `invisible' property */ | 1983 | /* Watch out for newlines with `invisible' property. |
| 1987 | || (propval = Fget_char_property (prevline, Qinvisible, | 1984 | When moving downward, check the newline after. */ |
| 1985 | || (propval = Fget_char_property (make_number (prevline), | ||
| 1986 | Qinvisible, | ||
| 1988 | text_prop_object), | 1987 | text_prop_object), |
| 1989 | TEXT_PROP_MEANS_INVISIBLE (propval)))) | 1988 | TEXT_PROP_MEANS_INVISIBLE (propval)))) |
| 1990 | XSETFASTINT (prevline, | 1989 | prevline = find_next_newline_no_quit (prevline - 1, -1); |
| 1991 | find_next_newline_no_quit (XFASTINT (prevline) - 1, | 1990 | pos = *compute_motion (prevline, 0, |
| 1992 | -1)); | 1991 | lmargin + (prevline == BEG |
| 1993 | pos = *compute_motion (XFASTINT (prevline), 0, | ||
| 1994 | lmargin + (XFASTINT (prevline) == BEG | ||
| 1995 | ? start_hpos : 0), | 1992 | ? start_hpos : 0), |
| 1996 | 0, | 1993 | 0, |
| 1997 | from, | 1994 | from, |
| @@ -2000,7 +1997,7 @@ vmotion (from, vtarget, w) | |||
| 2000 | /* ... nor HPOS. */ | 1997 | /* ... nor HPOS. */ |
| 2001 | 1 << (BITS_PER_SHORT - 1), | 1998 | 1 << (BITS_PER_SHORT - 1), |
| 2002 | -1, hscroll, | 1999 | -1, hscroll, |
| 2003 | (XFASTINT (prevline) == BEG ? -start_hpos : 0), | 2000 | (prevline == BEG ? -start_hpos : 0), |
| 2004 | w); | 2001 | w); |
| 2005 | did_motion = 1; | 2002 | did_motion = 1; |
| 2006 | } | 2003 | } |