aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2013-03-06 18:35:23 +0200
committerEli Zaretskii2013-03-06 18:35:23 +0200
commita611149e46d0a6927e9c276d4cf2089b7cfb7e05 (patch)
tree27b367d14ad868560646cf0cc273d6d885c46274 /src
parentd26e478eaa7c743b999fbcd995cc8c09ecbcc6c8 (diff)
downloademacs-a611149e46d0a6927e9c276d4cf2089b7cfb7e05.tar.gz
emacs-a611149e46d0a6927e9c276d4cf2089b7cfb7e05.zip
Rename find_next_newline to find_newline_no_quit.
src/search.c (find_newline_no_quit): Rename from find_next_newline. Add commentary. src/lisp.h (find_newline_no_quit): Rename prototype. src/xdisp.c (back_to_previous_line_start) (forward_to_next_line_start, get_visually_first_element) (move_it_vertically_backward): Callers of find_newline_no_quit changed. src/indent.c (vmotion): Callers of find_newline_no_quit changed. src/bidi.c (bidi_find_paragraph_start): Callers of find_newline_no_quit changed.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog12
-rw-r--r--src/bidi.c2
-rw-r--r--src/indent.c8
-rw-r--r--src/lisp.h2
-rw-r--r--src/search.c10
-rw-r--r--src/xdisp.c16
6 files changed, 32 insertions, 18 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 7e5a2b71026..c54d4bee7e9 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,17 @@
12013-03-06 Eli Zaretskii <eliz@gnu.org> 12013-03-06 Eli Zaretskii <eliz@gnu.org>
2 2
3 * search.c (find_newline_no_quit): Rename from find_next_newline.
4 Add commentary.
5
6 * lisp.h (find_newline_no_quit): Rename prototype.
7
8 * xdisp.c (back_to_previous_line_start)
9 (forward_to_next_line_start, get_visually_first_element)
10 (move_it_vertically_backward): Callers of find_newline_no_quit changed.
11 * indent.c (vmotion): Callers of find_newline_no_quit changed.
12 * bidi.c (bidi_find_paragraph_start): Callers of
13 find_newline_no_quit changed.
14
3 * msdos.c: Change encoding to cp850. (Bug#13879) 15 * msdos.c: Change encoding to cp850. (Bug#13879)
4 (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts. 16 (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
5 17
diff --git a/src/bidi.c b/src/bidi.c
index feb422cc5d2..cf5e580cd8f 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -1108,7 +1108,7 @@ bidi_find_paragraph_start (ptrdiff_t pos, ptrdiff_t pos_byte)
1108 display string? And what if a display string covering some 1108 display string? And what if a display string covering some
1109 of the text over which we scan back includes 1109 of the text over which we scan back includes
1110 paragraph_start_re? */ 1110 paragraph_start_re? */
1111 pos = find_next_newline (pos - 1, -1, &pos_byte); 1111 pos = find_newline_no_quit (pos - 1, -1, &pos_byte);
1112 if (n >= MAX_PARAGRAPH_SEARCH) 1112 if (n >= MAX_PARAGRAPH_SEARCH)
1113 pos_byte = BEGV_BYTE; 1113 pos_byte = BEGV_BYTE;
1114 return pos_byte; 1114 return pos_byte;
diff --git a/src/indent.c b/src/indent.c
index 469d774f681..abb4e08ad08 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -1843,7 +1843,7 @@ vmotion (register ptrdiff_t from, register EMACS_INT vtarget, struct window *w)
1843 ptrdiff_t bytepos; 1843 ptrdiff_t bytepos;
1844 Lisp_Object propval; 1844 Lisp_Object propval;
1845 1845
1846 prevline = find_next_newline (from - 1, -1, &bytepos); 1846 prevline = find_newline_no_quit (from - 1, -1, &bytepos);
1847 while (prevline > BEGV 1847 while (prevline > BEGV
1848 && ((selective > 0 1848 && ((selective > 0
1849 && indented_beyond_p (prevline, bytepos, selective)) 1849 && indented_beyond_p (prevline, bytepos, selective))
@@ -1853,7 +1853,7 @@ vmotion (register ptrdiff_t from, register EMACS_INT vtarget, struct window *w)
1853 Qinvisible, 1853 Qinvisible,
1854 text_prop_object), 1854 text_prop_object),
1855 TEXT_PROP_MEANS_INVISIBLE (propval)))) 1855 TEXT_PROP_MEANS_INVISIBLE (propval))))
1856 prevline = find_next_newline (prevline - 1, -1, &bytepos); 1856 prevline = find_newline_no_quit (prevline - 1, -1, &bytepos);
1857 pos = *compute_motion (prevline, 0, 1857 pos = *compute_motion (prevline, 0,
1858 lmargin, 1858 lmargin,
1859 0, 1859 0,
@@ -1894,7 +1894,7 @@ vmotion (register ptrdiff_t from, register EMACS_INT vtarget, struct window *w)
1894 ptrdiff_t bytepos; 1894 ptrdiff_t bytepos;
1895 Lisp_Object propval; 1895 Lisp_Object propval;
1896 1896
1897 prevline = find_next_newline (from, -1, &bytepos); 1897 prevline = find_newline_no_quit (from, -1, &bytepos);
1898 while (prevline > BEGV 1898 while (prevline > BEGV
1899 && ((selective > 0 1899 && ((selective > 0
1900 && indented_beyond_p (prevline, bytepos, selective)) 1900 && indented_beyond_p (prevline, bytepos, selective))
@@ -1904,7 +1904,7 @@ vmotion (register ptrdiff_t from, register EMACS_INT vtarget, struct window *w)
1904 Qinvisible, 1904 Qinvisible,
1905 text_prop_object), 1905 text_prop_object),
1906 TEXT_PROP_MEANS_INVISIBLE (propval)))) 1906 TEXT_PROP_MEANS_INVISIBLE (propval))))
1907 prevline = find_next_newline (prevline - 1, -1, &bytepos); 1907 prevline = find_newline_no_quit (prevline - 1, -1, &bytepos);
1908 pos = *compute_motion (prevline, 0, 1908 pos = *compute_motion (prevline, 0,
1909 lmargin, 1909 lmargin,
1910 0, 1910 0,
diff --git a/src/lisp.h b/src/lisp.h
index 7d443e57d66..fe216b93401 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3346,7 +3346,7 @@ extern ptrdiff_t find_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t,
3346 ptrdiff_t *, ptrdiff_t *, bool); 3346 ptrdiff_t *, ptrdiff_t *, bool);
3347extern EMACS_INT scan_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, 3347extern EMACS_INT scan_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t,
3348 EMACS_INT, bool); 3348 EMACS_INT, bool);
3349extern ptrdiff_t find_next_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t *); 3349extern ptrdiff_t find_newline_no_quit (ptrdiff_t, ptrdiff_t, ptrdiff_t *);
3350extern ptrdiff_t find_before_next_newline (ptrdiff_t, ptrdiff_t, 3350extern ptrdiff_t find_before_next_newline (ptrdiff_t, ptrdiff_t,
3351 ptrdiff_t, ptrdiff_t *); 3351 ptrdiff_t, ptrdiff_t *);
3352extern void syms_of_search (void); 3352extern void syms_of_search (void);
diff --git a/src/search.c b/src/search.c
index 6a79208557b..090965ead3b 100644
--- a/src/search.c
+++ b/src/search.c
@@ -941,15 +941,17 @@ scan_newline (ptrdiff_t start, ptrdiff_t start_byte,
941 return count * direction; 941 return count * direction;
942} 942}
943 943
944/* Like find_newline, but doesn't allow QUITting and doesn't return
945 SHORTAGE. */
944ptrdiff_t 946ptrdiff_t
945find_next_newline (ptrdiff_t from, ptrdiff_t cnt, ptrdiff_t *bytepos) 947find_newline_no_quit (ptrdiff_t from, ptrdiff_t cnt, ptrdiff_t *bytepos)
946{ 948{
947 return find_newline (from, 0, cnt, NULL, bytepos, 0); 949 return find_newline (from, 0, cnt, NULL, bytepos, 0);
948} 950}
949 951
950/* Like find_next_newline, but returns position before the newline, 952/* Like find_newline, but returns position before the newline, not
951 not after, and only search up to TO. This isn't just 953 after, and only search up to TO.
952 find_next_newline (...)-1, because you might hit TO. */ 954 This isn't just find_newline_no_quit (...)-1, because you might hit TO. */
953 955
954ptrdiff_t 956ptrdiff_t
955find_before_next_newline (ptrdiff_t from, ptrdiff_t to, 957find_before_next_newline (ptrdiff_t from, ptrdiff_t to,
diff --git a/src/xdisp.c b/src/xdisp.c
index 6dbc7637ee4..934c617bf8e 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -5905,8 +5905,8 @@ pop_it (struct it *it)
5905static void 5905static void
5906back_to_previous_line_start (struct it *it) 5906back_to_previous_line_start (struct it *it)
5907{ 5907{
5908 IT_CHARPOS (*it) 5908 IT_CHARPOS (*it) = find_newline_no_quit (IT_CHARPOS (*it) - 1, -1,
5909 = find_next_newline (IT_CHARPOS (*it) - 1, -1, &IT_BYTEPOS (*it)); 5909 &IT_BYTEPOS (*it));
5910} 5910}
5911 5911
5912 5912
@@ -5922,7 +5922,7 @@ back_to_previous_line_start (struct it *it)
5922 5922
5923 Newlines may come from buffer text, overlay strings, or strings 5923 Newlines may come from buffer text, overlay strings, or strings
5924 displayed via the `display' property. That's the reason we can't 5924 displayed via the `display' property. That's the reason we can't
5925 simply use find_next_newline_no_quit. 5925 simply use find_newline_no_quit.
5926 5926
5927 Note that this function may not skip over invisible text that is so 5927 Note that this function may not skip over invisible text that is so
5928 because of text properties and immediately follows a newline. If 5928 because of text properties and immediately follows a newline. If
@@ -5978,7 +5978,7 @@ forward_to_next_line_start (struct it *it, int *skipped_p,
5978 if (!newline_found_p) 5978 if (!newline_found_p)
5979 { 5979 {
5980 ptrdiff_t bytepos, start = IT_CHARPOS (*it); 5980 ptrdiff_t bytepos, start = IT_CHARPOS (*it);
5981 ptrdiff_t limit = find_next_newline (start, 1, &bytepos); 5981 ptrdiff_t limit = find_newline_no_quit (start, 1, &bytepos);
5982 Lisp_Object pos; 5982 Lisp_Object pos;
5983 5983
5984 eassert (!STRINGP (it->string)); 5984 eassert (!STRINGP (it->string));
@@ -7432,8 +7432,8 @@ get_visually_first_element (struct it *it)
7432 if (string_p) 7432 if (string_p)
7433 it->bidi_it.charpos = it->bidi_it.bytepos = 0; 7433 it->bidi_it.charpos = it->bidi_it.bytepos = 0;
7434 else 7434 else
7435 it->bidi_it.charpos 7435 it->bidi_it.charpos = find_newline_no_quit (IT_CHARPOS (*it), -1,
7436 = find_next_newline (IT_CHARPOS (*it), -1, &it->bidi_it.bytepos); 7436 &it->bidi_it.bytepos);
7437 bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it, 1); 7437 bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it, 1);
7438 do 7438 do
7439 { 7439 {
@@ -9067,8 +9067,8 @@ move_it_vertically_backward (struct it *it, int dy)
9067 && IT_CHARPOS (*it) > BEGV 9067 && IT_CHARPOS (*it) > BEGV
9068 && FETCH_BYTE (IT_BYTEPOS (*it) - 1) != '\n') 9068 && FETCH_BYTE (IT_BYTEPOS (*it) - 1) != '\n')
9069 { 9069 {
9070 ptrdiff_t nl_pos = 9070 ptrdiff_t nl_pos = find_newline_no_quit (IT_CHARPOS (*it) - 1, -1,
9071 find_next_newline (IT_CHARPOS (*it) - 1, -1, NULL); 9071 NULL);
9072 9072
9073 move_it_to (it, nl_pos, -1, -1, -1, MOVE_TO_POS); 9073 move_it_to (it, nl_pos, -1, -1, -1, MOVE_TO_POS);
9074 } 9074 }