diff options
| author | Gerd Moellmann | 2001-09-11 08:22:05 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-09-11 08:22:05 +0000 |
| commit | 1e1e5dafd7f35cff0f26db086fdbd4097e0a8cb1 (patch) | |
| tree | a0f210fc6612d07492896a04dc33d99107347243 /src | |
| parent | 1f9581b61c03d5a763dcd8cca22363a7dca81bc9 (diff) | |
| download | emacs-1e1e5dafd7f35cff0f26db086fdbd4097e0a8cb1.tar.gz emacs-1e1e5dafd7f35cff0f26db086fdbd4097e0a8cb1.zip | |
(init_from_display_pos): Put some code in #if 0.
(add_to_log): Use bcopy instead of strcpy.
(init_from_display_pos): Use an explicit loop over bytes in
overlay strings instead of calling index.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 01543b8ecbd..85d58dbd7fe 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -1840,11 +1840,19 @@ init_from_display_pos (it, w, pos) | |||
| 1840 | init_iterator (it, w, charpos, bytepos, NULL, DEFAULT_FACE_ID); | 1840 | init_iterator (it, w, charpos, bytepos, NULL, DEFAULT_FACE_ID); |
| 1841 | 1841 | ||
| 1842 | for (i = 0; i < it->n_overlay_strings; ++i) | 1842 | for (i = 0; i < it->n_overlay_strings; ++i) |
| 1843 | if (index (XSTRING (it->overlay_strings[i])->data, '\n')) | 1843 | { |
| 1844 | { | 1844 | char *s = XSTRING (it->overlay_strings[i])->data; |
| 1845 | overlay_strings_with_newlines = 1; | 1845 | char *e = s + STRING_BYTES (XSTRING (it->overlay_strings[i])); |
| 1846 | break; | 1846 | |
| 1847 | } | 1847 | while (s < e && *s != '\n') |
| 1848 | ++s; | ||
| 1849 | |||
| 1850 | if (s < e) | ||
| 1851 | { | ||
| 1852 | overlay_strings_with_newlines = 1; | ||
| 1853 | break; | ||
| 1854 | } | ||
| 1855 | } | ||
| 1848 | 1856 | ||
| 1849 | /* If position is within an overlay string, set up IT to the right | 1857 | /* If position is within an overlay string, set up IT to the right |
| 1850 | overlay string. */ | 1858 | overlay string. */ |
| @@ -1881,6 +1889,11 @@ init_from_display_pos (it, w, pos) | |||
| 1881 | it->current.string_pos = pos->string_pos; | 1889 | it->current.string_pos = pos->string_pos; |
| 1882 | it->method = next_element_from_string; | 1890 | it->method = next_element_from_string; |
| 1883 | } | 1891 | } |
| 1892 | |||
| 1893 | #if 0 /* This is bogus because POS not having an overlay string | ||
| 1894 | position does not mean it's after the string. Example: A | ||
| 1895 | line starting with a before-string and initialization of IT | ||
| 1896 | to the previous row's end position. */ | ||
| 1884 | else if (it->current.overlay_string_index >= 0) | 1897 | else if (it->current.overlay_string_index >= 0) |
| 1885 | { | 1898 | { |
| 1886 | /* If POS says we're already after an overlay string ending at | 1899 | /* If POS says we're already after an overlay string ending at |
| @@ -1894,6 +1907,7 @@ init_from_display_pos (it, w, pos) | |||
| 1894 | if (CHARPOS (pos->pos) == ZV) | 1907 | if (CHARPOS (pos->pos) == ZV) |
| 1895 | it->overlay_strings_at_end_processed_p = 1; | 1908 | it->overlay_strings_at_end_processed_p = 1; |
| 1896 | } | 1909 | } |
| 1910 | #endif /* 0 */ | ||
| 1897 | 1911 | ||
| 1898 | if (CHARPOS (pos->string_pos) >= 0) | 1912 | if (CHARPOS (pos->string_pos) >= 0) |
| 1899 | { | 1913 | { |
| @@ -5558,7 +5572,7 @@ add_to_log (format, arg1, arg2) | |||
| 5558 | 5572 | ||
| 5559 | len = STRING_BYTES (XSTRING (msg)) + 1; | 5573 | len = STRING_BYTES (XSTRING (msg)) + 1; |
| 5560 | buffer = (char *) alloca (len); | 5574 | buffer = (char *) alloca (len); |
| 5561 | strcpy (buffer, XSTRING (msg)->data); | 5575 | bcopy (XSTRING (msg)->data, buffer, len); |
| 5562 | 5576 | ||
| 5563 | message_dolog (buffer, len - 1, 1, 0); | 5577 | message_dolog (buffer, len - 1, 1, 0); |
| 5564 | UNGCPRO; | 5578 | UNGCPRO; |