[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r112896: Fix bug #14575 with window-specific overlay
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] trunk r112896: Fix bug #14575 with window-specific overlays with display props. |
Date: |
Sat, 08 Jun 2013 18:29:55 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 112896
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/14575
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Sat 2013-06-08 21:28:36 +0300
message:
Fix bug #14575 with window-specific overlays with display props.
src/bidi.c (bidi_fetch_char): Accept additional argument, the window
being displayed, and pass it to compute_display_string_pos.
(bidi_level_of_next_char, bidi_resolve_explicit_1)
(bidi_paragraph_init): All callers changed.
src/xdisp.c (init_from_display_pos, init_iterator)
(handle_single_display_spec, next_overlay_string)
(get_overlay_strings_1, reseat_1, reseat_to_string)
(push_prefix_prop, Fcurrent_bidi_paragraph_direction): Set
bidi_it.w member from it->w.
(compute_display_string_pos): Accept additional argument, the
window being displayed, and pass it to Fget_char_property.
src/dispextern.h (struct bidi_it): New member w, the window being
displayed.
(compute_display_string_pos): Adjust prototype.
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2013-06-08 18:13:24 +0000
+++ b/src/ChangeLog 2013-06-08 18:28:36 +0000
@@ -1,3 +1,23 @@
+2013-06-08 Eli Zaretskii <address@hidden>
+
+ * bidi.c (bidi_fetch_char): Accept additional argument, the window
+ being displayed, and pass it to compute_display_string_pos.
+ (bidi_level_of_next_char, bidi_resolve_explicit_1)
+ (bidi_paragraph_init): All callers changed.
+
+ * xdisp.c (init_from_display_pos, init_iterator)
+ (handle_single_display_spec, next_overlay_string)
+ (get_overlay_strings_1, reseat_1, reseat_to_string)
+ (push_prefix_prop, Fcurrent_bidi_paragraph_direction): Set
+ bidi_it.w member from it->w.
+ (compute_display_string_pos): Accept additional argument, the
+ window being displayed, and pass it to Fget_char_property.
+ (Bug#14575)
+
+ * dispextern.h (struct bidi_it): New member w, the window being
+ displayed.
+ (compute_display_string_pos): Adjust prototype.
+
2013-06-08 Jan Djärv <address@hidden>
* xgselect.c: Remove unneeded include xterm.h
=== modified file 'src/bidi.c'
--- a/src/bidi.c 2013-03-08 09:34:35 +0000
+++ b/src/bidi.c 2013-06-08 18:28:36 +0000
@@ -927,6 +927,7 @@
static int
bidi_fetch_char (ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t *disp_pos,
int *disp_prop, struct bidi_string_data *string,
+ struct window *w,
bool frame_window_p, ptrdiff_t *ch_len, ptrdiff_t *nchars)
{
int ch;
@@ -940,7 +941,7 @@
if (charpos < endpos && charpos > *disp_pos)
{
SET_TEXT_POS (pos, charpos, bytepos);
- *disp_pos = compute_display_string_pos (&pos, string, frame_window_p,
+ *disp_pos = compute_display_string_pos (&pos, string, w, frame_window_p,
disp_prop);
}
@@ -1045,7 +1046,7 @@
&& *disp_prop)
{
SET_TEXT_POS (pos, charpos + *nchars, bytepos + *ch_len);
- *disp_pos = compute_display_string_pos (&pos, string, frame_window_p,
+ *disp_pos = compute_display_string_pos (&pos, string, w, frame_window_p,
disp_prop);
}
@@ -1224,7 +1225,7 @@
if (!string_p)
pos = BYTE_TO_CHAR (bytepos);
ch = bidi_fetch_char (pos, bytepos, &disp_pos, &disp_prop,
- &bidi_it->string,
+ &bidi_it->string, bidi_it->w,
bidi_it->frame_window_p, &ch_len, &nchars);
type = bidi_get_type (ch, NEUTRAL_DIR);
@@ -1252,7 +1253,7 @@
break;
/* Fetch next character and advance to get past it. */
ch = bidi_fetch_char (pos, bytepos, &disp_pos,
- &disp_prop, &bidi_it->string,
+ &disp_prop, &bidi_it->string, bidi_it->w,
bidi_it->frame_window_p, &ch_len, &nchars);
pos += nchars;
bytepos += ch_len;
@@ -1402,7 +1403,8 @@
a single character u+FFFC. */
curchar = bidi_fetch_char (bidi_it->charpos, bidi_it->bytepos,
&bidi_it->disp_pos, &bidi_it->disp_prop,
- &bidi_it->string, bidi_it->frame_window_p,
+ &bidi_it->string, bidi_it->w,
+ bidi_it->frame_window_p,
&bidi_it->ch_len, &bidi_it->nchars);
}
bidi_it->ch = curchar;
@@ -2194,7 +2196,7 @@
emacs_abort ();
do {
ch = bidi_fetch_char (cpos += nc, bpos += clen, &disp_pos, &dpp, &bs,
- fwp, &clen, &nc);
+ bidi_it->w, fwp, &clen, &nc);
if (ch == '\n' || ch == BIDI_EOB)
chtype = NEUTRAL_B;
else
=== modified file 'src/dispextern.h'
--- a/src/dispextern.h 2013-05-04 10:19:13 +0000
+++ b/src/dispextern.h 2013-06-08 18:28:36 +0000
@@ -1881,6 +1881,7 @@
stuff that is not part of the bidi iterator's state! */
struct bidi_stack level_stack[BIDI_MAXLEVEL]; /* stack of embedding levels */
struct bidi_string_data string; /* string to reorder */
+ struct window *w; /* the window being displayed */
bidi_dir_t paragraph_dir; /* current paragraph direction */
ptrdiff_t separator_limit; /* where paragraph separator should end */
unsigned prev_was_pdf : 1; /* if non-zero, previous char was PDF */
@@ -3077,7 +3078,7 @@
extern Lisp_Object lookup_glyphless_char_display (int, struct it *);
extern ptrdiff_t compute_display_string_pos (struct text_pos *,
struct bidi_string_data *,
- int, int *);
+ struct window *, int, int *);
extern ptrdiff_t compute_display_string_end (ptrdiff_t,
struct bidi_string_data *);
extern void produce_stretch_glyph (struct it *);
=== modified file 'src/xdisp.c'
--- a/src/xdisp.c 2013-06-06 16:35:31 +0000
+++ b/src/xdisp.c 2013-06-08 18:28:36 +0000
@@ -2650,6 +2650,7 @@
it->bidi_it.string.lstring = Qnil;
it->bidi_it.string.s = NULL;
it->bidi_it.string.bufpos = 0;
+ it->bidi_it.w = w;
/* The window in which we iterate over current_buffer: */
XSETWINDOW (it->window, w);
@@ -3124,6 +3125,7 @@
it->bidi_it.string.bufpos = it->overlay_strings_charpos;
it->bidi_it.string.from_disp_str = it->string_from_display_prop_p;
it->bidi_it.string.unibyte = !it->multibyte_p;
+ it->bidi_it.w = it->w;
bidi_init_it (IT_STRING_CHARPOS (*it), IT_STRING_BYTEPOS (*it),
FRAME_WINDOW_P (it->f), &it->bidi_it);
@@ -3490,11 +3492,11 @@
ptrdiff_t
compute_display_string_pos (struct text_pos *position,
struct bidi_string_data *string,
+ struct window *w,
int frame_window_p, int *disp_prop)
{
/* OBJECT = nil means current buffer. */
- Lisp_Object object =
- (string && STRINGP (string->lstring)) ? string->lstring : Qnil;
+ Lisp_Object object, object1;
Lisp_Object pos, spec, limpos;
int string_p = (string && (STRINGP (string->lstring) || string->s));
ptrdiff_t eob = string_p ? string->schars : ZV;
@@ -3505,6 +3507,17 @@
struct text_pos tpos;
int rv = 0;
+ if (string && STRINGP (string->lstring))
+ object1 = object = string->lstring;
+ else if (!string_p)
+ {
+ eassert (w != NULL);
+ XSETWINDOW (object, w);
+ object1 = Qnil;
+ }
+ else
+ object1 = object = Qnil;
+
*disp_prop = 1;
if (charpos >= eob
@@ -3543,7 +3556,7 @@
that will replace the underlying text when displayed. */
limpos = make_number (lim);
do {
- pos = Fnext_single_char_property_change (pos, Qdisplay, object, limpos);
+ pos = Fnext_single_char_property_change (pos, Qdisplay, object1, limpos);
CHARPOS (tpos) = XFASTINT (pos);
if (CHARPOS (tpos) >= lim)
{
@@ -5031,6 +5044,7 @@
it->bidi_it.string.bufpos = bufpos;
it->bidi_it.string.from_disp_str = 1;
it->bidi_it.string.unibyte = !it->multibyte_p;
+ it->bidi_it.w = it->w;
bidi_init_it (0, 0, FRAME_WINDOW_P (it->f), &it->bidi_it);
}
}
@@ -5409,6 +5423,7 @@
it->bidi_it.string.bufpos = it->overlay_strings_charpos;
it->bidi_it.string.from_disp_str = it->string_from_display_prop_p;
it->bidi_it.string.unibyte = !it->multibyte_p;
+ it->bidi_it.w = it->w;
bidi_init_it (0, 0, FRAME_WINDOW_P (it->f), &it->bidi_it);
}
}
@@ -5712,6 +5727,7 @@
it->bidi_it.string.bufpos = pos;
it->bidi_it.string.from_disp_str = it->string_from_display_prop_p;
it->bidi_it.string.unibyte = !it->multibyte_p;
+ it->bidi_it.w = it->w;
bidi_init_it (0, 0, FRAME_WINDOW_P (it->f), &it->bidi_it);
}
return 1;
@@ -6344,6 +6360,7 @@
it->bidi_it.string.lstring = Qnil;
it->bidi_it.string.bufpos = 0;
it->bidi_it.string.unibyte = 0;
+ it->bidi_it.w = it->w;
}
if (set_stop_p)
@@ -6421,6 +6438,7 @@
it->bidi_it.string.bufpos = 0;
it->bidi_it.string.from_disp_str = 0;
it->bidi_it.string.unibyte = !it->multibyte_p;
+ it->bidi_it.w = it->w;
bidi_init_it (charpos, IT_STRING_BYTEPOS (*it),
FRAME_WINDOW_P (it->f), &it->bidi_it);
}
@@ -6452,6 +6470,7 @@
it->bidi_it.string.bufpos = 0;
it->bidi_it.string.from_disp_str = 0;
it->bidi_it.string.unibyte = !it->multibyte_p;
+ it->bidi_it.w = it->w;
bidi_init_it (charpos, IT_BYTEPOS (*it), FRAME_WINDOW_P (it->f),
&it->bidi_it);
}
@@ -18921,6 +18940,7 @@
it->bidi_it.string.bufpos = IT_CHARPOS (*it);
it->bidi_it.string.from_disp_str = it->string_from_display_prop_p;
it->bidi_it.string.unibyte = !it->multibyte_p;
+ it->bidi_it.w = it->w;
bidi_init_it (0, 0, FRAME_WINDOW_P (it->f), &it->bidi_it);
}
}
@@ -19990,6 +20010,7 @@
itb.string.lstring = Qnil;
itb.string.bufpos = 0;
itb.string.unibyte = 0;
+ itb.w = XWINDOW (selected_window);
bidi_paragraph_init (NEUTRAL_DIR, &itb, 1);
bidi_unshelve_cache (itb_data, 0);
set_buffer_temp (old);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r112896: Fix bug #14575 with window-specific overlays with display props.,
Eli Zaretskii <=