aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2011-06-10 14:43:04 +0300
committerEli Zaretskii2011-06-10 14:43:04 +0300
commit9f4ef5002457676aefa18729cf6931e38e8e9f18 (patch)
tree550e3778879cd51bd1ba8554697c8af37722a157 /src
parent6db161bec8de73baa968732345355b5178e1fd30 (diff)
downloademacs-9f4ef5002457676aefa18729cf6931e38e8e9f18.tar.gz
emacs-9f4ef5002457676aefa18729cf6931e38e8e9f18.zip
Tested and fixed compute_display_string_pos for buffer iteration.
Also fixed an unrelated bug caused by vertical-motion. src/xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize itb.string.lstring. (compute_display_string_pos, compute_display_string_end): Fix calculation of the object to scan. Fixes an error when using arrow keys. (next_element_from_buffer): Don't abort when IT_CHARPOS is before base_level_stop; instead, set base_level_stop to BEGV. Fixes crashes in vertical-motion.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog11
-rw-r--r--src/xdisp.c10
2 files changed, 16 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 2f305d0daf4..5aef6d2f112 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,14 @@
12011-06-10 Eli Zaretskii <eliz@gnu.org>
2
3 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
4 itb.string.lstring.
5 (compute_display_string_pos, compute_display_string_end):
6 Fix calculation of the object to scan. Fixes an error when using
7 arrow keys.
8 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
9 base_level_stop; instead, set base_level_stop to BEGV. Fixes
10 crashes in vertical-motion.
11
12011-06-09 Eli Zaretskii <eliz@gnu.org> 122011-06-09 Eli Zaretskii <eliz@gnu.org>
2 13
3 * xdisp.c (compute_display_string_pos): First arg is now struct 14 * xdisp.c (compute_display_string_pos): First arg is now struct
diff --git a/src/xdisp.c b/src/xdisp.c
index 1194cced38c..8486808bb40 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -3111,7 +3111,7 @@ compute_display_string_pos (struct text_pos *position,
3111 struct bidi_string_data *string, int frame_window_p) 3111 struct bidi_string_data *string, int frame_window_p)
3112{ 3112{
3113 /* OBJECT = nil means current buffer. */ 3113 /* OBJECT = nil means current buffer. */
3114 Lisp_Object object = string ? string->lstring : Qnil; 3114 Lisp_Object object = (string && string->s) ? string->lstring : Qnil;
3115 Lisp_Object pos, spec; 3115 Lisp_Object pos, spec;
3116 EMACS_INT eob = STRINGP (object) ? string->schars : ZV; 3116 EMACS_INT eob = STRINGP (object) ? string->schars : ZV;
3117 EMACS_INT begb = STRINGP (object) ? 0 : BEGV; 3117 EMACS_INT begb = STRINGP (object) ? 0 : BEGV;
@@ -3172,7 +3172,7 @@ EMACS_INT
3172compute_display_string_end (EMACS_INT charpos, struct bidi_string_data *string) 3172compute_display_string_end (EMACS_INT charpos, struct bidi_string_data *string)
3173{ 3173{
3174 /* OBJECT = nil means current buffer. */ 3174 /* OBJECT = nil means current buffer. */
3175 Lisp_Object object = string ? string->lstring : Qnil; 3175 Lisp_Object object = (string && string->s) ? string->lstring : Qnil;
3176 Lisp_Object pos = make_number (charpos); 3176 Lisp_Object pos = make_number (charpos);
3177 EMACS_INT eob = STRINGP (object) ? string->schars : ZV; 3177 EMACS_INT eob = STRINGP (object) ? string->schars : ZV;
3178 3178
@@ -6829,10 +6829,9 @@ next_element_from_buffer (struct it *it)
6829 && !BIDI_AT_BASE_LEVEL (it->bidi_it) 6829 && !BIDI_AT_BASE_LEVEL (it->bidi_it)
6830 && IT_CHARPOS (*it) < it->prev_stop) 6830 && IT_CHARPOS (*it) < it->prev_stop)
6831 { 6831 {
6832 if (it->base_level_stop <= 0) 6832 if (it->base_level_stop <= 0
6833 || IT_CHARPOS (*it) < it->base_level_stop)
6833 it->base_level_stop = BEGV; 6834 it->base_level_stop = BEGV;
6834 if (IT_CHARPOS (*it) < it->base_level_stop)
6835 abort ();
6836 handle_stop_backwards (it, it->base_level_stop); 6835 handle_stop_backwards (it, it->base_level_stop);
6837 return GET_NEXT_DISPLAY_ELEMENT (it); 6836 return GET_NEXT_DISPLAY_ELEMENT (it);
6838 } 6837 }
@@ -18228,6 +18227,7 @@ See also `bidi-paragraph-direction'. */)
18228 itb.bytepos = bytepos; 18227 itb.bytepos = bytepos;
18229 itb.nchars = -1; 18228 itb.nchars = -1;
18230 itb.string.s = NULL; 18229 itb.string.s = NULL;
18230 itb.string.lstring = Qnil;
18231 itb.frame_window_p = FRAME_WINDOW_P (SELECTED_FRAME ()); /* guesswork */ 18231 itb.frame_window_p = FRAME_WINDOW_P (SELECTED_FRAME ()); /* guesswork */
18232 itb.first_elt = 1; 18232 itb.first_elt = 1;
18233 itb.separator_limit = -1; 18233 itb.separator_limit = -1;