aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2011-12-23 16:51:51 +0200
committerEli Zaretskii2011-12-23 16:51:51 +0200
commitd048e1e6bd3f634ca8308003e67967f134098c6c (patch)
tree6ebe88324d04e4a5b6447dad2c55002d1f159fde /src
parentbffcee0ae34feab9b8b6f7d769f1107418eab724 (diff)
downloademacs-d048e1e6bd3f634ca8308003e67967f134098c6c.tar.gz
emacs-d048e1e6bd3f634ca8308003e67967f134098c6c.zip
Fix assertion violation in pop_it when org-indent-mode is used.
src/xdisp.c (handle_invisible_prop): Handle correctly an invisible property that ends at ZV, so that the bidi iteration could be resumed from there (after widening).
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/xdisp.c11
2 files changed, 12 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 87750228f43..a3521bcd031 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12011-12-23 Eli Zaretskii <eliz@gnu.org>
2
3 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
4 property that ends at ZV, so that the bidi iteration could be
5 resumed from there (after widening).
6
12011-12-22 Jan Djärv <jan.h.d@swipnet.se> 72011-12-22 Jan Djärv <jan.h.d@swipnet.se>
2 8
3 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc. 9 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
diff --git a/src/xdisp.c b/src/xdisp.c
index 41d393a65a7..90375ba1a33 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -4090,10 +4090,11 @@ handle_invisible_prop (struct it *it)
4090 while (invis_p); 4090 while (invis_p);
4091 4091
4092 /* The position newpos is now either ZV or on visible text. */ 4092 /* The position newpos is now either ZV or on visible text. */
4093 if (it->bidi_p && newpos < ZV) 4093 if (it->bidi_p)
4094 { 4094 {
4095 EMACS_INT bpos = CHAR_TO_BYTE (newpos); 4095 EMACS_INT bpos = CHAR_TO_BYTE (newpos);
4096 int on_newline = FETCH_BYTE (bpos) == '\n'; 4096 int on_newline =
4097 bpos == ZV_BYTE || FETCH_BYTE (bpos) == '\n';
4097 int after_newline = 4098 int after_newline =
4098 newpos <= BEGV || FETCH_BYTE (bpos - 1) == '\n'; 4099 newpos <= BEGV || FETCH_BYTE (bpos - 1) == '\n';
4099 4100
@@ -4111,16 +4112,16 @@ handle_invisible_prop (struct it *it)
4111 4112
4112 SET_TEXT_POS (tpos, newpos, bpos); 4113 SET_TEXT_POS (tpos, newpos, bpos);
4113 reseat_1 (it, tpos, 0); 4114 reseat_1 (it, tpos, 0);
4114 /* If we reseat on a newline, we need to prep the 4115 /* If we reseat on a newline/ZV, we need to prep the
4115 bidi iterator for advancing to the next character 4116 bidi iterator for advancing to the next character
4116 after the newline, keeping the current paragraph 4117 after the newline/EOB, keeping the current paragraph
4117 direction (so that PRODUCE_GLYPHS does TRT wrt 4118 direction (so that PRODUCE_GLYPHS does TRT wrt
4118 prepending/appending glyphs to a glyph row). */ 4119 prepending/appending glyphs to a glyph row). */
4119 if (on_newline) 4120 if (on_newline)
4120 { 4121 {
4121 it->bidi_it.first_elt = 0; 4122 it->bidi_it.first_elt = 0;
4122 it->bidi_it.paragraph_dir = pdir; 4123 it->bidi_it.paragraph_dir = pdir;
4123 it->bidi_it.ch = '\n'; 4124 it->bidi_it.ch = (bpos == ZV_BYTE) ? -1 : '\n';
4124 it->bidi_it.nchars = 1; 4125 it->bidi_it.nchars = 1;
4125 it->bidi_it.ch_len = 1; 4126 it->bidi_it.ch_len = 1;
4126 } 4127 }