aboutsummaryrefslogtreecommitdiffstats
path: root/src/indent.c
diff options
context:
space:
mode:
authorJoakim Verona2013-02-21 00:04:28 +0100
committerJoakim Verona2013-02-21 00:04:28 +0100
commitf0f34630a4c8b467df3ec7eb445ceedd93a12a71 (patch)
tree8a3b203c6f091c698fcfb3ccd055f330e07e539d /src/indent.c
parent10fc3c3866ede374437a72f2e8c1cd7c0f51a8fa (diff)
parente11dacb57703fb8044332d8a3933b815547911ec (diff)
downloademacs-f0f34630a4c8b467df3ec7eb445ceedd93a12a71.tar.gz
emacs-f0f34630a4c8b467df3ec7eb445ceedd93a12a71.zip
auto upstream
Diffstat (limited to 'src/indent.c')
-rw-r--r--src/indent.c31
1 files changed, 12 insertions, 19 deletions
diff --git a/src/indent.c b/src/indent.c
index ce1639eae1e..9bf75bc6d95 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -1328,8 +1328,7 @@ compute_motion (ptrdiff_t from, EMACS_INT fromvpos, EMACS_INT fromhpos,
1328 TO (we need to go back below). */ 1328 TO (we need to go back below). */
1329 if (pos <= to) 1329 if (pos <= to)
1330 { 1330 {
1331 pos = find_before_next_newline (pos, to, 1); 1331 pos = find_before_next_newline (pos, to, 1, &pos_byte);
1332 pos_byte = CHAR_TO_BYTE (pos);
1333 hpos = width; 1332 hpos = width;
1334 /* If we just skipped next_boundary, 1333 /* If we just skipped next_boundary,
1335 loop around in the main while 1334 loop around in the main while
@@ -1583,10 +1582,9 @@ compute_motion (ptrdiff_t from, EMACS_INT fromvpos, EMACS_INT fromhpos,
1583 /* Skip any number of invisible lines all at once */ 1582 /* Skip any number of invisible lines all at once */
1584 do 1583 do
1585 { 1584 {
1586 pos = find_before_next_newline (pos, to, 1); 1585 pos = find_before_next_newline (pos, to, 1, &pos_byte);
1587 if (pos < to) 1586 if (pos < to)
1588 pos++; 1587 INC_BOTH (pos, pos_byte);
1589 pos_byte = CHAR_TO_BYTE (pos);
1590 } 1588 }
1591 while (pos < to 1589 while (pos < to
1592 && indented_beyond_p (pos, pos_byte, 1590 && indented_beyond_p (pos, pos_byte,
@@ -1622,10 +1620,7 @@ compute_motion (ptrdiff_t from, EMACS_INT fromvpos, EMACS_INT fromhpos,
1622 everything from a ^M to the end of the line is invisible. 1620 everything from a ^M to the end of the line is invisible.
1623 Stop *before* the real newline. */ 1621 Stop *before* the real newline. */
1624 if (pos < to) 1622 if (pos < to)
1625 { 1623 pos = find_before_next_newline (pos, to, 1, &pos_byte);
1626 pos = find_before_next_newline (pos, to, 1);
1627 pos_byte = CHAR_TO_BYTE (pos);
1628 }
1629 /* If we just skipped next_boundary, 1624 /* If we just skipped next_boundary,
1630 loop around in the main while 1625 loop around in the main while
1631 and handle it. */ 1626 and handle it. */
@@ -1845,21 +1840,20 @@ vmotion (register ptrdiff_t from, register EMACS_INT vtarget, struct window *w)
1845 1840
1846 while ((vpos > vtarget || first) && from > BEGV) 1841 while ((vpos > vtarget || first) && from > BEGV)
1847 { 1842 {
1843 ptrdiff_t bytepos;
1848 Lisp_Object propval; 1844 Lisp_Object propval;
1849 1845
1850 prevline = find_next_newline_no_quit (from - 1, -1); 1846 prevline = find_next_newline_no_quit (from - 1, -1, &bytepos);
1851 while (prevline > BEGV 1847 while (prevline > BEGV
1852 && ((selective > 0 1848 && ((selective > 0
1853 && indented_beyond_p (prevline, 1849 && indented_beyond_p (prevline, bytepos, selective))
1854 CHAR_TO_BYTE (prevline),
1855 selective))
1856 /* Watch out for newlines with `invisible' property. 1850 /* Watch out for newlines with `invisible' property.
1857 When moving upward, check the newline before. */ 1851 When moving upward, check the newline before. */
1858 || (propval = Fget_char_property (make_number (prevline - 1), 1852 || (propval = Fget_char_property (make_number (prevline - 1),
1859 Qinvisible, 1853 Qinvisible,
1860 text_prop_object), 1854 text_prop_object),
1861 TEXT_PROP_MEANS_INVISIBLE (propval)))) 1855 TEXT_PROP_MEANS_INVISIBLE (propval))))
1862 prevline = find_next_newline_no_quit (prevline - 1, -1); 1856 prevline = find_next_newline_no_quit (prevline - 1, -1, &bytepos);
1863 pos = *compute_motion (prevline, 0, 1857 pos = *compute_motion (prevline, 0,
1864 lmargin, 1858 lmargin,
1865 0, 1859 0,
@@ -1897,21 +1891,20 @@ vmotion (register ptrdiff_t from, register EMACS_INT vtarget, struct window *w)
1897 from_byte = CHAR_TO_BYTE (from); 1891 from_byte = CHAR_TO_BYTE (from);
1898 if (from > BEGV && FETCH_BYTE (from_byte - 1) != '\n') 1892 if (from > BEGV && FETCH_BYTE (from_byte - 1) != '\n')
1899 { 1893 {
1894 ptrdiff_t bytepos;
1900 Lisp_Object propval; 1895 Lisp_Object propval;
1901 1896
1902 prevline = find_next_newline_no_quit (from, -1); 1897 prevline = find_next_newline_no_quit (from, -1, &bytepos);
1903 while (prevline > BEGV 1898 while (prevline > BEGV
1904 && ((selective > 0 1899 && ((selective > 0
1905 && indented_beyond_p (prevline, 1900 && indented_beyond_p (prevline, bytepos, selective))
1906 CHAR_TO_BYTE (prevline),
1907 selective))
1908 /* Watch out for newlines with `invisible' property. 1901 /* Watch out for newlines with `invisible' property.
1909 When moving downward, check the newline after. */ 1902 When moving downward, check the newline after. */
1910 || (propval = Fget_char_property (make_number (prevline), 1903 || (propval = Fget_char_property (make_number (prevline),
1911 Qinvisible, 1904 Qinvisible,
1912 text_prop_object), 1905 text_prop_object),
1913 TEXT_PROP_MEANS_INVISIBLE (propval)))) 1906 TEXT_PROP_MEANS_INVISIBLE (propval))))
1914 prevline = find_next_newline_no_quit (prevline - 1, -1); 1907 prevline = find_next_newline_no_quit (prevline - 1, -1, &bytepos);
1915 pos = *compute_motion (prevline, 0, 1908 pos = *compute_motion (prevline, 0,
1916 lmargin, 1909 lmargin,
1917 0, 1910 0,