[Ben, Tomonori San, am I making sense?]
Jan Vroonhof <jan.vroonhof(a)ntlworld.com> writes:
Sounds logical, as this was a major rewrite the of the text glyph
code
2000-04-02 IKEYAMA Tomonori <tomonori(a)suiyokai.org>
* redisplay.c (add_glyph_rune): Don't set 0 to bufpos for text
image glyph if allow_cursor.
(add_hscroll_rune): Don't allow cursor to border glyph.
(create_text_block): Ditto.
* redisplay-output.c (redisplay_move_cursor): Do nothing even if
text not in buffer.
(redisplay_output_layout): Call ensure_face_cachel_complete for
text image glyph.
2000-03-16 IKEYAMA Tomonori <tomonori(a)suiyokai.org>
* redisplay.c (add_glyph_rune): Adding text image as text runes.
* redisplay-output.c (redisplay_move_cursor): NO_CURSOR if text
not in buffer
* redisplay-tty.c (tty_output_display_block): Delete the routine
for text image glyph
* redisplay-x.c (x_output_display_block): ditto
* redisplay-msw.c (mswindows_output_display_block): ditto
Here is the relevant part of the patch patch...
@@ -1661,10 +1661,32 @@
face = glyph_face (gb->glyph, data->window);
if (NILP (face))
- rb.findex = data->findex;
+ findex = data->findex;
else
- rb.findex = get_builtin_face_cache_index (w, face);
+ findex = get_builtin_face_cache_index (w, face);
+ instance = glyph_image_instance (gb->glyph, data->window,
+ ERROR_ME_NOT, 1);
+ if (TEXT_IMAGE_INSTANCEP (instance))
+ {
+ Lisp_Object string = XIMAGE_INSTANCE_TEXT_STRING (instance);
+ face_index orig_findex = data->findex;
+ Bytind orig_bufpos = data->bi_bufpos;
+ Bytind orig_start_col_enabled = data->bi_start_col_enabled;
+
+ data->findex = findex;
+ data->bi_start_col_enabled = 0;
+ if (!allow_cursor)
+ data->bi_bufpos = 0;
+ add_bufbyte_string_runes (data, XSTRING_DATA (string),
+ XSTRING_LENGTH (string), 0);
+ data->findex = orig_findex;
+ data->bi_bufpos = orig_bufpos;
+ data->bi_start_col_enabled = orig_start_col_enabled;
+ return NULL;
+ }
+
+ rb.findex = findex;
rb.xpos = data->pixpos;
rb.width = width;
rb.bufpos = 0; /* glyphs are never "at" anywhere */
@@ -1675,13 +1697,6 @@
else
rb.endpos = 0;
rb.type = RUNE_DGLYPH;
- /* #### Ben sez: this is way bogus if the glyph is a string.
- You should not make the output routines have to cope with
- this. The string could contain Mule characters, or non-
- printable characters, or characters to be passed through
- the display table, or non-character objects (when this gets
- implemented), etc. Instead, this routine here should parse
- the string into a series of runes. */
rb.object.dglyph.glyph = gb->glyph;
rb.object.dglyph.extent = gb->extent;
rb.object.dglyph.xoffset = xoffset;
Note that for text glpyhs we no longer add the glpyh to the display
structure. What if that is that was only reference to the glyph?
Does this patch (untested) fix the problem?
Index: src/redisplay.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/redisplay.c,v
retrieving revision 1.55.2.66
diff -u -r1.55.2.66 redisplay.c
--- redisplay.c 2000/12/05 05:34:35 1.55.2.66
+++ redisplay.c 2001/02/11 23:57:31
@@ -1676,7 +1676,11 @@
data->findex = orig_findex;
data->bi_bufpos = orig_bufpos;
data->bi_start_col_enabled = orig_start_col_enabled;
- return NULL;
+ /* We have added the text from the glyph here because
+ that is clean. However we still add the glyph to
+ the display structure so it is marked. */
+ width = 0;
+ xoffset = 0;
}
rb.findex = findex;
Index: src/redisplay-x.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/redisplay-x.c,v
retrieving revision 1.23.2.31
diff -u -r1.23.2.31 redisplay-x.c
--- redisplay-x.c 2001/01/06 08:21:12 1.23.2.31
+++ redisplay-x.c 2001/02/11 23:57:32
@@ -479,6 +479,10 @@
break;
case IMAGE_TEXT:
+ /* We kept the text glyph for marking
+ but already added the runes */
+ break;
+
case IMAGE_POINTER:
default:
abort ();
Index: src/redisplay-tty.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/redisplay-tty.c,v
retrieving revision 1.15.2.18
diff -u -r1.15.2.18 redisplay-tty.c
--- redisplay-tty.c 2000/10/31 05:06:25 1.15.2.18
+++ redisplay-tty.c 2001/02/11 23:57:33
@@ -343,6 +343,10 @@
break;
case IMAGE_TEXT:
+ /* We kept the text glyph for marking
+ but already added the runes */
+ break;
+
case IMAGE_POINTER:
default:
abort ();