aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c26
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;