/[emacs]/emacs/src/term.c
ViewVC logotype

Diff of /emacs/src/term.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.146 by kfstorm, Sat May 24 22:04:48 2003 UTC revision 1.146.4.1 by handa, Mon Sep 8 12:48:12 2003 UTC
# Line 29  Boston, MA 02111-1307, USA.  */ Line 29  Boston, MA 02111-1307, USA.  */
29  #include "termchar.h"  #include "termchar.h"
30  #include "termopts.h"  #include "termopts.h"
31  #include "lisp.h"  #include "lisp.h"
32    #include "buffer.h"
33    #include "character.h"
34  #include "charset.h"  #include "charset.h"
35  #include "coding.h"  #include "coding.h"
36  #include "keyboard.h"  #include "keyboard.h"
# Line 810  encode_terminal_code (src, dst, src_len, Line 812  encode_terminal_code (src, dst, src_len,
812    int len;    int len;
813    register int tlen = GLYPH_TABLE_LENGTH;    register int tlen = GLYPH_TABLE_LENGTH;
814    register Lisp_Object *tbase = GLYPH_TABLE_BASE;    register Lisp_Object *tbase = GLYPH_TABLE_BASE;
   int result;  
815    struct coding_system *coding;    struct coding_system *coding;
816    
817    /* If terminal_coding does any conversion, use it, otherwise use    /* If terminal_coding does any conversion, use it, otherwise use
# Line 829  encode_terminal_code (src, dst, src_len, Line 830  encode_terminal_code (src, dst, src_len,
830    
831            if (g < 0 || g >= tlen)            if (g < 0 || g >= tlen)
832              {              {
833                /* This glyph doesn't has an entry in Vglyph_table.  */                /* This glyph doesn't have an entry in Vglyph_table.  */
834                if (! CHAR_VALID_P (src->u.ch, 0))                if (! CHAR_VALID_P (src->u.ch, 0))
835                  {                  {
836                    len = 1;                    len = 1;
# Line 868  encode_terminal_code (src, dst, src_len, Line 869  encode_terminal_code (src, dst, src_len,
869                  }                  }
870              }              }
871    
872            result = encode_coding (coding, buf, dst, len, dst_end - dst);            coding->source = buf;
873              coding->destination = dst;
874              coding->dst_bytes = dst_end - dst;
875              encode_coding_object (coding, Qnil, 0, 0, 1, len, Qnil);
876            len -= coding->consumed;            len -= coding->consumed;
877            dst += coding->produced;            dst += coding->produced;
878            if (result == CODING_FINISH_INSUFFICIENT_DST            if (coding->result == CODING_RESULT_INSUFFICIENT_DST)
               || (result == CODING_FINISH_INSUFFICIENT_SRC  
                   && len > dst_end - dst))  
879              /* The remaining output buffer is too short.  We must              /* The remaining output buffer is too short.  We must
880                 break the loop here without increasing SRC so that the                 break the loop here without increasing SRC so that the
881                 next call of this function starts from the same glyph.  */                 next call of this function starts from the same glyph.  */
# Line 977  write_glyphs (string, len) Line 979  write_glyphs (string, len)
979    if (CODING_REQUIRE_FLUSHING (&terminal_coding))    if (CODING_REQUIRE_FLUSHING (&terminal_coding))
980      {      {
981        terminal_coding.mode |= CODING_MODE_LAST_BLOCK;        terminal_coding.mode |= CODING_MODE_LAST_BLOCK;
982        encode_coding (&terminal_coding, "", conversion_buffer,        terminal_coding.source = (unsigned char *) "";
983                       0, conversion_buffer_size);        terminal_coding.destination = conversion_buffer;
984          terminal_coding.dst_bytes = conversion_buffer_size;
985          encode_coding_object (&terminal_coding, Qnil, 0, 0, 0, 0, Qnil);
986        if (terminal_coding.produced > 0)        if (terminal_coding.produced > 0)
987          {          {
988            fwrite (conversion_buffer, 1, terminal_coding.produced, stdout);            fwrite (conversion_buffer, 1, terminal_coding.produced, stdout);
# Line 1721  produce_glyphs (it) Line 1725  produce_glyphs (it)
1725      }      }
1726    else    else
1727      {      {
1728        /* A multi-byte character.  The display width is fixed for all        it->pixel_width = CHAR_WIDTH (it->c);
          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);  
1729        it->nglyphs = it->pixel_width;        it->nglyphs = it->pixel_width;
1730    
1731        if (it->glyph_row)        if (it->glyph_row)

Legend:
Removed from v.1.146  
changed lines
  Added in v.1.146.4.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26