]> code.delx.au - gnu-emacs/blobdiff - src/term.c
*** empty log message ***
[gnu-emacs] / src / term.c
index 829f2d88e6b2a141e8a2bb8bc77454f1e236fcff..4bc460d0f785dbc802e54adeeba11aae596e2796 100644 (file)
@@ -29,6 +29,8 @@ Boston, MA 02111-1307, USA.  */
 #include "termchar.h"
 #include "termopts.h"
 #include "lisp.h"
+#include "buffer.h"
+#include "character.h"
 #include "charset.h"
 #include "coding.h"
 #include "keyboard.h"
@@ -810,7 +812,6 @@ encode_terminal_code (src, dst, src_len, dst_len, consumed)
   int len;
   register int tlen = GLYPH_TABLE_LENGTH;
   register Lisp_Object *tbase = GLYPH_TABLE_BASE;
-  int result;
   struct coding_system *coding;
 
   /* If terminal_coding does any conversion, use it, otherwise use
@@ -829,7 +830,7 @@ encode_terminal_code (src, dst, src_len, dst_len, consumed)
 
          if (g < 0 || g >= tlen)
            {
-             /* This glyph doesn't has an entry in Vglyph_table.  */
+             /* This glyph doesn't have an entry in Vglyph_table.  */
              if (! CHAR_VALID_P (src->u.ch, 0))
                {
                  len = 1;
@@ -868,12 +869,13 @@ encode_terminal_code (src, dst, src_len, dst_len, consumed)
                }
            }
 
-         result = encode_coding (coding, buf, dst, len, dst_end - dst);
+         coding->source = buf;
+         coding->destination = dst;
+         coding->dst_bytes = dst_end - dst;
+         encode_coding_object (coding, Qnil, 0, 0, 1, len, Qnil);
          len -= coding->consumed;
          dst += coding->produced;
-         if (result == CODING_FINISH_INSUFFICIENT_DST
-             || (result == CODING_FINISH_INSUFFICIENT_SRC
-                 && len > dst_end - dst))
+         if (coding->result == CODING_RESULT_INSUFFICIENT_DST)
            /* The remaining output buffer is too short.  We must
               break the loop here without increasing SRC so that the
               next call of this function starts from the same glyph.  */
@@ -977,8 +979,10 @@ write_glyphs (string, len)
   if (CODING_REQUIRE_FLUSHING (&terminal_coding))
     {
       terminal_coding.mode |= CODING_MODE_LAST_BLOCK;
-      encode_coding (&terminal_coding, "", conversion_buffer,
-                    0, conversion_buffer_size);
+      terminal_coding.source = (unsigned char *) "";
+      terminal_coding.destination = conversion_buffer;
+      terminal_coding.dst_bytes = conversion_buffer_size;
+      encode_coding_object (&terminal_coding, Qnil, 0, 0, 0, 0, Qnil);
       if (terminal_coding.produced > 0)
        {
          fwrite (conversion_buffer, 1, terminal_coding.produced, stdout);
@@ -1721,13 +1725,7 @@ produce_glyphs (it)
     }
   else
     {
-      /* A multi-byte character.  The display width is fixed for all
-        characters of the set.  Some of the glyphs may have to be
-        ignored because they are already displayed in a continued
-        line.  */
-      int charset = CHAR_CHARSET (it->c);
-
-      it->pixel_width = CHARSET_WIDTH (charset);
+      it->pixel_width = CHAR_WIDTH (it->c);
       it->nglyphs = it->pixel_width;
 
       if (it->glyph_row)