]> code.delx.au - gnu-emacs/commitdiff
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-114
authorMiles Bader <miles@gnu.org>
Wed, 25 Feb 2004 12:54:16 +0000 (12:54 +0000)
committerMiles Bader <miles@gnu.org>
Wed, 25 Feb 2004 12:54:16 +0000 (12:54 +0000)
Merge some minor redisplay bug-fixes from emacs--tiling--0

Patches applied:

 * miles@gnu.org--gnu-2004/emacs--tiling--0--patch-9
   Remove bogus xassert

 * miles@gnu.org--gnu-2004/emacs--tiling--0--patch-10
   Avoid negative descents for images with ascent > height

 * miles@gnu.org--gnu-2004/emacs--tiling--0--patch-13
   Fix iterator-inconsistency bug in redisplay

src/ChangeLog
src/xdisp.c
src/xfns.c

index de4e053a82aace3034467f1249fe5bd0fa700442..ae838e34693e3d748cab549ad43d9dc214f4ef67 100644 (file)
@@ -1,3 +1,17 @@
+2004-02-25  Miles Bader  <miles@gnu.org>
+
+       * xdisp.c (check_it): Check string/string_pos consistency.
+       (init_iterator): Initialize string-related fields properly.
+
+2004-02-11  Miles Bader  <miles@gnu.org>
+
+       * xdisp.c (produce_image_glyph): Force negative descents to zero.
+
+2004-02-10  Miles Bader  <miles@gnu.org>
+
+       * xfns.c (lookup_image): Remove xassert(!interrupt_input_blocked);
+       BLOCK_INPUT can be nested, so it doesn't make much sense.
+
 2004-02-24  Michael Mauger <mmaug@yahoo.com>
 
        * w32fns.c (slurp_file, xbm_scan, xbm_load_image)
index f068290078f37a3ee3fa699db48c850baaaec139..e7b3ec20268e8e0b0f484495acedc1fc4f3c748d 100644 (file)
@@ -1904,10 +1904,14 @@ check_it (it)
       xassert (STRINGP (it->string));
       xassert (IT_STRING_CHARPOS (*it) >= 0);
     }
-  else if (it->method == next_element_from_buffer)
+  else
     {
-      /* Check that character and byte positions agree.  */
-      xassert (IT_CHARPOS (*it) == BYTE_TO_CHAR (IT_BYTEPOS (*it)));
+      xassert (IT_STRING_CHARPOS (*it) < 0);
+      if (it->method == next_element_from_buffer)
+       {
+         /* Check that character and byte positions agree.  */
+         xassert (IT_CHARPOS (*it) == BYTE_TO_CHAR (IT_BYTEPOS (*it)));
+       }
     }
 
   if (it->dpvec)
@@ -2020,6 +2024,8 @@ init_iterator (it, w, charpos, bytepos, row, base_face_id)
   it->current.overlay_string_index = -1;
   it->current.dpvec_index = -1;
   it->base_face_id = base_face_id;
+  it->string = Qnil;
+  IT_STRING_CHARPOS (*it) = IT_STRING_BYTEPOS (*it) = -1;
 
   /* The window in which we iterate over current_buffer:  */
   XSETWINDOW (it->window, w);
@@ -17685,6 +17691,11 @@ produce_image_glyph (it)
   it->descent = it->phys_descent = img->height + 2 * img->vmargin - it->ascent;
   it->pixel_width = img->width + 2 * img->hmargin;
 
+  /* It's quite possible for images to have an ascent greater than
+     their height, so don't get confused in that case.  */
+  if (it->descent < 0)
+    it->descent = 0;
+
   /* If this glyph is alone on the last line, adjust it.ascent to minimum row ascent.  */
   face_ascent = face->font ? FONT_BASE (face->font) : FRAME_BASELINE_OFFSET (it->f);
   if (face_ascent > it->ascent)
index cecffb1c222741816a58796a7eb66d449f8b3b31..f5e3c0c62e5fd1f40fea691d963ca0265c831e2d 100644 (file)
@@ -1,5 +1,5 @@
 /* Functions for the X window system.
-   Copyright (C) 1989, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 01, 02, 03
+   Copyright (C) 1989, 92, 93, 94, 95, 96, 97, 98, 99, 2000,01,02,03,04
      Free Software Foundation.
 
 This file is part of GNU Emacs.
@@ -5315,7 +5315,6 @@ lookup_image (f, spec)
        }
 
       UNBLOCK_INPUT;
-      xassert (!interrupt_input_blocked);
     }
 
   /* We're using IMG, so set its timestamp to `now'.  */