diff src/redisplay-tty.c @ 404:2f8bb876ab1d r21-2-32

Import from CVS: tag r21-2-32
author cvs
date Mon, 13 Aug 2007 11:16:07 +0200
parents 74fd4e045ea6
children b8cc9ab3f761
line wrap: on
line diff
--- a/src/redisplay-tty.c	Mon Aug 13 11:15:00 2007 +0200
+++ b/src/redisplay-tty.c	Mon Aug 13 11:16:07 2007 +0200
@@ -333,79 +333,83 @@
 					       window, ERROR_ME_NOT, 1);
 
 	      if (IMAGE_INSTANCEP (instance))
-		switch (XIMAGE_INSTANCE_TYPE (instance))
-		  {
-		  case IMAGE_TEXT:
+		{
+		  switch (XIMAGE_INSTANCE_TYPE (instance))
 		    {
-		      Bufbyte *temptemp;
-		      Lisp_Object string =
-			XIMAGE_INSTANCE_TEXT_STRING (instance);
-		      Bytecount len = XSTRING_LENGTH (string);
-
-		      /* In the unlikely instance that a garbage-collect
-			 occurs during encoding, we at least need to
-			 copy the string.
-			 */
-		      temptemp = (Bufbyte *) alloca (len);
-		      memcpy (temptemp, XSTRING_DATA (string), len);
+		    case IMAGE_TEXT:
 		      {
-			int i;
-
-			/* Now truncate the first rb->object.dglyph.xoffset
-			   columns. */
-			for (i = 0; i < rb->object.dglyph.xoffset;)
-			  {
+			Bufbyte *temptemp;
+			Lisp_Object string =
+			  XIMAGE_INSTANCE_TEXT_STRING (instance);
+			Bytecount len = XSTRING_LENGTH (string);
+			
+			/* In the unlikely instance that a garbage-collect
+			   occurs during encoding, we at least need to
+			   copy the string.
+			*/
+			temptemp = (Bufbyte *) alloca (len);
+			memcpy (temptemp, XSTRING_DATA (string), len);
+			{
+			  int i;
+			  
+			  /* Now truncate the first rb->object.dglyph.xoffset
+			     columns. */
+			  for (i = 0; i < rb->object.dglyph.xoffset;)
+			    {
 #ifdef MULE
-			    Emchar ch = charptr_emchar (temptemp);
-			    i += XCHARSET_COLUMNS (CHAR_CHARSET (ch));
+			      Emchar ch = charptr_emchar (temptemp);
+			      i += XCHARSET_COLUMNS (CHAR_CHARSET (ch));
 #else
-			    i++; /* telescope this */
+			      i++; /* telescope this */
 #endif
-			    INC_CHARPTR (temptemp);
-			  }
-
-			/* If we truncated one column too many, then
-			   add a space at the beginning. */
-			if (i > rb->object.dglyph.xoffset)
+			      INC_CHARPTR (temptemp);
+			    }
+			  
+			  /* If we truncated one column too many, then
+			     add a space at the beginning. */
+			  if (i > rb->object.dglyph.xoffset)
+			    {
+			      assert (i > 0);
+			      *--temptemp = ' ';
+			      i--;
+			    }
+			  len -= i;
+			}
+			
+			tty_output_bufbyte_string (w, dl, temptemp, len,
+						   xpos, findex, 0);
+			
+			if (xpos >= cursor_start
+			    && (cursor_start <
+				xpos + (bufbyte_string_displayed_columns
+					(temptemp, len))))
 			  {
-			    assert (i > 0);
-			    *--temptemp = ' ';
-			    i--;
+			    cmgoto (f, dl->ypos - 1, cursor_start);
 			  }
-			len -= i;
 		      }
-
-		      tty_output_bufbyte_string (w, dl, temptemp, len,
-						 xpos, findex, 0);
-
-		      if (xpos >= cursor_start
-			  && (cursor_start <
-			      xpos + (bufbyte_string_displayed_columns
-				      (temptemp, len))))
-			{
-			  cmgoto (f, dl->ypos - 1, cursor_start);
-			}
+		      break;
+		      
+		    case IMAGE_MONO_PIXMAP:
+		    case IMAGE_COLOR_PIXMAP:
+		    case IMAGE_SUBWINDOW:
+		    case IMAGE_WIDGET:
+		    case IMAGE_LAYOUT:
+		      /* just do nothing here */
+		      break;
+		      
+		    case IMAGE_POINTER:
+		      abort ();
+		      
+		    case IMAGE_NOTHING:
+		      /* nothing is as nothing does */
+		      break;
+		      
+		    default:
+		      abort ();
 		    }
-		    break;
-
-		  case IMAGE_MONO_PIXMAP:
-		  case IMAGE_COLOR_PIXMAP:
-		  case IMAGE_SUBWINDOW:
-		  case IMAGE_WIDGET:
-		  case IMAGE_LAYOUT:
-		    /* just do nothing here */
-		    break;
-
-		  case IMAGE_POINTER:
-		    abort ();
-
-		  case IMAGE_NOTHING:
-		    /* nothing is as nothing does */
-		    break;
-
-		  default:
-		    abort ();
-		  }
+		  IMAGE_INSTANCE_OPTIMIZE_OUTPUT 
+		    (XIMAGE_INSTANCE (instance)) = 0;
+		}
 
 	      xpos += rb->width;
 	      elt++;
@@ -566,7 +570,7 @@
       clear_to_end (f);
 #else
       /* #### Not implemented. */
-      fprintf (stderr, "Not yet.\n");
+      stderr_out ("Not yet.\n");
 #endif
     }
   tty_turn_off_frame_face (f, Vdefault_face);