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

Diff of /emacs/src/print.c

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

revision 1.172 by pj, Wed Jan 2 13:27:22 2002 UTC revision 1.172.2.1 by handa, Fri Mar 1 01:45:03 2002 UTC
# Line 24  Boston, MA 02111-1307, USA.  */ Line 24  Boston, MA 02111-1307, USA.  */
24  #include <stdio.h>  #include <stdio.h>
25  #include "lisp.h"  #include "lisp.h"
26  #include "buffer.h"  #include "buffer.h"
27  #include "charset.h"  #include "character.h"
28  #include "keyboard.h"  #include "keyboard.h"
29  #include "frame.h"  #include "frame.h"
30  #include "window.h"  #include "window.h"
# Line 460  print_string (string, printcharfun) Line 460  print_string (string, printcharfun)
460      {      {
461        int chars;        int chars;
462    
463          if (print_escape_nonascii)
464            string = string_escape_byte8 (string);
465    
466        if (STRING_MULTIBYTE (string))        if (STRING_MULTIBYTE (string))
467          chars = XSTRING (string)->size;          chars = XSTRING (string)->size;
468        else if (EQ (printcharfun, Qt)        else if (! print_escape_nonascii
469                 ? ! NILP (buffer_defaults.enable_multibyte_characters)                 && (EQ (printcharfun, Qt)
470                 : ! NILP (current_buffer->enable_multibyte_characters))                     ? ! NILP (buffer_defaults.enable_multibyte_characters)
471                       : ! NILP (current_buffer->enable_multibyte_characters)))
472          {          {
473            /* If unibyte string STRING contains 8-bit codes, we must            /* If unibyte string STRING contains 8-bit codes, we must
474               convert STRING to a multibyte string containing the same               convert STRING to a multibyte string containing the same
# Line 1409  print_object (obj, printcharfun, escapef Line 1413  print_object (obj, printcharfun, escapef
1413                  {                  {
1414                    c = STRING_CHAR_AND_LENGTH (str + i_byte,                    c = STRING_CHAR_AND_LENGTH (str + i_byte,
1415                                                size_byte - i_byte, len);                                                size_byte - i_byte, len);
1416                    if (CHAR_VALID_P (c, 0))                    i_byte += len;
                     i_byte += len;  
                   else  
                     c = str[i_byte++];  
1417                  }                  }
1418                else                else
1419                  c = str[i_byte++];                  c = str[i_byte++];
# Line 1430  print_object (obj, printcharfun, escapef Line 1431  print_object (obj, printcharfun, escapef
1431                    PRINTCHAR ('f');                    PRINTCHAR ('f');
1432                  }                  }
1433                else if (multibyte && ! ASCII_BYTE_P (c)                else if (multibyte && ! ASCII_BYTE_P (c)
1434                         && print_escape_multibyte)                         && (print_escape_multibyte || CHAR_BYTE8_P (c)))
1435                  {                  {
1436                    /* When multibyte is disabled,                    /* When multibyte is disabled,
1437                       print multibyte string chars using hex escapes.  */                       print multibyte string chars using hex escapes.  */
1438                    unsigned char outbuf[50];                    unsigned char outbuf[50];
1439                    sprintf (outbuf, "\\x%x", c);  
1440                      if (CHAR_BYTE8_P (c))
1441                        sprintf (outbuf, "\\%03o", CHAR_TO_BYTE8 (c));
1442                      else
1443                        sprintf (outbuf, "\\x%04x", c);
1444                    strout (outbuf, -1, -1, printcharfun, 0);                    strout (outbuf, -1, -1, printcharfun, 0);
1445                    need_nonhex = 1;                    need_nonhex = 1;
1446                  }                  }
# Line 1787  print_object (obj, printcharfun, escapef Line 1792  print_object (obj, printcharfun, escapef
1792                PRINTCHAR ('#');                PRINTCHAR ('#');
1793                size &= PSEUDOVECTOR_SIZE_MASK;                size &= PSEUDOVECTOR_SIZE_MASK;
1794              }              }
1795            if (CHAR_TABLE_P (obj))            if (CHAR_TABLE_P (obj) || SUB_CHAR_TABLE_P (obj))
1796              {              {
1797                /* We print a char-table as if it were a vector,                /* We print a char-table as if it were a vector,
1798                   lumping the parent and default slots in with the                   lumping the parent and default slots in with the

Legend:
Removed from v.1.172  
changed lines
  Added in v.1.172.2.1

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