aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2012-02-29 19:50:24 +0200
committerEli Zaretskii2012-02-29 19:50:24 +0200
commit312508d72ea1d3dd863daad497cecf7f15082f43 (patch)
treeec156330952fb06cc9702152c4b3d27d89e0c392 /src
parent2d44d9cc7040ba6c9548443189ac7d112ee00003 (diff)
downloademacs-312508d72ea1d3dd863daad497cecf7f15082f43.tar.gz
emacs-312508d72ea1d3dd863daad497cecf7f15082f43.zip
Fix bug #10903 with displaying an empty display string.
src/xdisp.c (get_overlay_strings_1): Under bidi redisplay, call push_it before setting up the iterator for the first overlay string, even if we have an empty string loaded. (next_overlay_string): If there's an empty string on the iterator stack, pop the stack.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog8
-rw-r--r--src/xdisp.c17
2 files changed, 23 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 9221041da52..428d25f7cc8 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
12012-02-29 Eli Zaretskii <eliz@gnu.org>
2
3 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
4 push_it before setting up the iterator for the first overlay
5 string, even if we have an empty string loaded.
6 (next_overlay_string): If there's an empty string on the iterator
7 stack, pop the stack. (Bug#10903)
8
12012-02-25 Paul Eggert <eggert@cs.ucla.edu> 92012-02-25 Paul Eggert <eggert@cs.ucla.edu>
2 10
3 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780). 11 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
diff --git a/src/xdisp.c b/src/xdisp.c
index 70c12497e20..644658b3136 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -5156,6 +5156,12 @@ next_overlay_string (struct it *it)
5156 it->current.overlay_string_index = -1; 5156 it->current.overlay_string_index = -1;
5157 it->n_overlay_strings = 0; 5157 it->n_overlay_strings = 0;
5158 it->overlay_strings_charpos = -1; 5158 it->overlay_strings_charpos = -1;
5159 /* If there's an empty display string on the stack, pop the
5160 stack, to resync the bidi iterator with IT's position. Such
5161 empty strings are pushed onto the stack in
5162 get_overlay_strings_1. */
5163 if (it->sp > 0 && STRINGP (it->string) && !SCHARS (it->string))
5164 pop_it (it);
5159 5165
5160 /* If we're at the end of the buffer, record that we have 5166 /* If we're at the end of the buffer, record that we have
5161 processed the overlay strings there already, so that 5167 processed the overlay strings there already, so that
@@ -5453,8 +5459,15 @@ get_overlay_strings_1 (struct it *it, EMACS_INT charpos, int compute_stop_p)
5453 xassert (!compute_stop_p || it->sp == 0); 5459 xassert (!compute_stop_p || it->sp == 0);
5454 5460
5455 /* When called from handle_stop, there might be an empty display 5461 /* When called from handle_stop, there might be an empty display
5456 string loaded. In that case, don't bother saving it. */ 5462 string loaded. In that case, don't bother saving it. But
5457 if (!STRINGP (it->string) || SCHARS (it->string)) 5463 don't use this optimization with the bidi iterator, since we
5464 need the corresponding pop_it call to resync the bidi
5465 iterator's position with IT's position, after we are done
5466 with the overlay strings. (The corresponding call to pop_it
5467 in case of an empty display string is in
5468 next_overlay_string.) */
5469 if (!(!it->bidi_p
5470 && STRINGP (it->string) && !SCHARS (it->string)))
5458 push_it (it, NULL); 5471 push_it (it, NULL);
5459 5472
5460 /* Set up IT to deliver display elements from the first overlay 5473 /* Set up IT to deliver display elements from the first overlay