emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/print.c


From: Dave Love
Subject: [Emacs-diffs] Changes to emacs/src/print.c
Date: Tue, 16 Jul 2002 18:30:37 -0400

Index: emacs/src/print.c
diff -c emacs/src/print.c:1.178 emacs/src/print.c:1.179
*** emacs/src/print.c:1.178     Fri Jul 12 07:19:09 2002
--- emacs/src/print.c   Sun Jul 14 20:00:37 2002
***************
*** 290,296 ****
  print_unwind (saved_text)
       Lisp_Object saved_text;
  {
!   bcopy (XSTRING (saved_text)->data, print_buffer, XSTRING 
(saved_text)->size);
    return Qnil;
  }
  
--- 290,296 ----
  print_unwind (saved_text)
       Lisp_Object saved_text;
  {
!   bcopy (SDATA (saved_text), print_buffer, SCHARS (saved_text));
    return Qnil;
  }
  
***************
*** 461,467 ****
        int chars;
  
        if (STRING_MULTIBYTE (string))
!       chars = XSTRING (string)->size;
        else if (EQ (printcharfun, Qt)
               ? ! NILP (buffer_defaults.enable_multibyte_characters)
               : ! NILP (current_buffer->enable_multibyte_characters))
--- 461,467 ----
        int chars;
  
        if (STRING_MULTIBYTE (string))
!       chars = SCHARS (string);
        else if (EQ (printcharfun, Qt)
               ? ! NILP (buffer_defaults.enable_multibyte_characters)
               : ! NILP (current_buffer->enable_multibyte_characters))
***************
*** 472,493 ****
          Lisp_Object newstr;
          int bytes;
  
!         chars = STRING_BYTES (XSTRING (string));
!         bytes = parse_str_to_multibyte (XSTRING (string)->data, chars);
          if (chars < bytes)
            {
              newstr = make_uninit_multibyte_string (chars, bytes);
!             bcopy (XSTRING (string)->data, XSTRING (newstr)->data, chars);
!             str_to_multibyte (XSTRING (newstr)->data, bytes, chars);
              string = newstr;
            }
        }
        else
!       chars = STRING_BYTES (XSTRING (string));
  
        /* strout is safe for output to a frame (echo area) or to print_buffer. 
 */
!       strout (XSTRING (string)->data,
!             chars, STRING_BYTES (XSTRING (string)),
              printcharfun, STRING_MULTIBYTE (string));
      }
    else
--- 472,493 ----
          Lisp_Object newstr;
          int bytes;
  
!         chars = SBYTES (string);
!         bytes = parse_str_to_multibyte (SDATA (string), chars);
          if (chars < bytes)
            {
              newstr = make_uninit_multibyte_string (chars, bytes);
!             bcopy (SDATA (string), SDATA (newstr), chars);
!             str_to_multibyte (SDATA (newstr), bytes, chars);
              string = newstr;
            }
        }
        else
!       chars = SBYTES (string);
  
        /* strout is safe for output to a frame (echo area) or to print_buffer. 
 */
!       strout (SDATA (string),
!             chars, SBYTES (string),
              printcharfun, STRING_MULTIBYTE (string));
      }
    else
***************
*** 495,518 ****
        /* Otherwise, string may be relocated by printing one char.
         So re-fetch the string address for each character.  */
        int i;
!       int size = XSTRING (string)->size;
!       int size_byte = STRING_BYTES (XSTRING (string));
        struct gcpro gcpro1;
        GCPRO1 (string);
        if (size == size_byte)
        for (i = 0; i < size; i++)
!         PRINTCHAR (XSTRING (string)->data[i]);
        else
        for (i = 0; i < size_byte; i++)
          {
            /* Here, we must convert each multi-byte form to the
               corresponding character code before handing it to PRINTCHAR.  */
            int len;
!           int ch = STRING_CHAR_AND_LENGTH (XSTRING (string)->data + i,
                                             size_byte - i, len);
            if (!CHAR_VALID_P (ch, 0))
              {
!               ch = XSTRING (string)->data[i];
                len = 1;
              }
            PRINTCHAR (ch);
--- 495,518 ----
        /* Otherwise, string may be relocated by printing one char.
         So re-fetch the string address for each character.  */
        int i;
!       int size = SCHARS (string);
!       int size_byte = SBYTES (string);
        struct gcpro gcpro1;
        GCPRO1 (string);
        if (size == size_byte)
        for (i = 0; i < size; i++)
!         PRINTCHAR (SREF (string, i));
        else
        for (i = 0; i < size_byte; i++)
          {
            /* Here, we must convert each multi-byte form to the
               corresponding character code before handing it to PRINTCHAR.  */
            int len;
!           int ch = STRING_CHAR_AND_LENGTH (SDATA (string) + i,
                                             size_byte - i, len);
            if (!CHAR_VALID_P (ch, 0))
              {
!               ch = SREF (string, i);
                len = 1;
              }
            PRINTCHAR (ch);
***************
*** 664,670 ****
    GCPRO1(args);
    name = Feval (Fcar (args));
    CHECK_STRING (name);
!   temp_output_buffer_setup (XSTRING (name)->data);
    buf = Vstandard_output;
    UNGCPRO;
  
--- 664,670 ----
    GCPRO1(args);
    name = Feval (Fcar (args));
    CHECK_STRING (name);
!   temp_output_buffer_setup (SDATA (name));
    buf = Vstandard_output;
    UNGCPRO;
  
***************
*** 1074,1080 ****
        /* Check that the spec we have is fully valid.
         This means not only valid for printf,
         but meant for floats, and reasonable.  */
!       cp = XSTRING (Vfloat_output_format)->data;
  
        if (cp[0] != '%')
        goto lose;
--- 1074,1080 ----
        /* Check that the spec we have is fully valid.
         This means not only valid for printf,
         but meant for floats, and reasonable.  */
!       cp = SDATA (Vfloat_output_format);
  
        if (cp[0] != '%')
        goto lose;
***************
*** 1104,1110 ****
        if (cp[1] != 0)
        goto lose;
  
!       sprintf (buf, XSTRING (Vfloat_output_format)->data, data);
      }
  
    /* Make sure there is a decimal point with digit after, or an
--- 1104,1110 ----
        if (cp[1] != 0)
        goto lose;
  
!       sprintf (buf, SDATA (Vfloat_output_format), data);
      }
  
    /* Make sure there is a decimal point with digit after, or an
***************
*** 1243,1249 ****
        {
        case Lisp_String:
          /* A string may have text properties, which can be circular.  */
!         traverse_intervals_noorder (XSTRING (obj)->intervals,
                                      print_preprocess_string, Qnil);
          break;
  
--- 1243,1249 ----
        {
        case Lisp_String:
          /* A string may have text properties, which can be circular.  */
!         traverse_intervals_noorder (STRING_INTERVALS (obj),
                                      print_preprocess_string, Qnil);
          break;
  
***************
*** 1379,1393 ****
  
          GCPRO1 (obj);
  
!         if (!NULL_INTERVAL_P (XSTRING (obj)->intervals))
            {
              PRINTCHAR ('#');
              PRINTCHAR ('(');
            }
  
          PRINTCHAR ('\"');
!         str = XSTRING (obj)->data;
!         size_byte = STRING_BYTES (XSTRING (obj));
  
          for (i = 0, i_byte = 0; i_byte < size_byte;)
            {
--- 1379,1393 ----
  
          GCPRO1 (obj);
  
!         if (!NULL_INTERVAL_P (STRING_INTERVALS (obj)))
            {
              PRINTCHAR ('#');
              PRINTCHAR ('(');
            }
  
          PRINTCHAR ('\"');
!         str = SDATA (obj);
!         size_byte = SBYTES (obj);
  
          for (i = 0, i_byte = 0; i_byte < size_byte;)
            {
***************
*** 1467,1475 ****
            }
          PRINTCHAR ('\"');
  
!         if (!NULL_INTERVAL_P (XSTRING (obj)->intervals))
            {
!             traverse_intervals (XSTRING (obj)->intervals,
                                  0, print_interval, printcharfun);
              PRINTCHAR (')');
            }
--- 1467,1475 ----
            }
          PRINTCHAR ('\"');
  
!         if (!NULL_INTERVAL_P (STRING_INTERVALS (obj)))
            {
!             traverse_intervals (STRING_INTERVALS (obj),
                                  0, print_interval, printcharfun);
              PRINTCHAR (')');
            }
***************
*** 1481,1488 ****
      case Lisp_Symbol:
        {
        register int confusing;
!       register unsigned char *p = XSTRING (SYMBOL_NAME (obj))->data;
!       register unsigned char *end = p + STRING_BYTES (XSTRING (SYMBOL_NAME 
(obj)));
        register int c;
        int i, i_byte, size_byte;
        Lisp_Object name;
--- 1481,1488 ----
      case Lisp_Symbol:
        {
        register int confusing;
!       register unsigned char *p = SDATA (SYMBOL_NAME (obj));
!       register unsigned char *end = p + SBYTES (SYMBOL_NAME (obj));
        register int c;
        int i, i_byte, size_byte;
        Lisp_Object name;
***************
*** 1517,1523 ****
            PRINTCHAR (':');
          }
  
!       size_byte = STRING_BYTES (XSTRING (name));
  
        for (i = 0, i_byte = 0; i_byte < size_byte;)
          {
--- 1517,1523 ----
            PRINTCHAR (':');
          }
  
!       size_byte = SBYTES (name);
  
        for (i = 0, i_byte = 0; i_byte < size_byte;)
          {
***************
*** 1735,1743 ****
            {
              PRINTCHAR (' ');
              PRINTCHAR ('\'');
!             strout (XSTRING (SYMBOL_NAME (h->test))->data, -1, -1, 
printcharfun, 0);
              PRINTCHAR (' ');
!             strout (XSTRING (SYMBOL_NAME (h->weak))->data, -1, -1, 
printcharfun, 0);
              PRINTCHAR (' ');
              sprintf (buf, "%d/%d", XFASTINT (h->count),
                       XVECTOR (h->next)->size);
--- 1735,1743 ----
            {
              PRINTCHAR (' ');
              PRINTCHAR ('\'');
!             strout (SDATA (SYMBOL_NAME (h->test)), -1, -1, printcharfun, 0);
              PRINTCHAR (' ');
!             strout (SDATA (SYMBOL_NAME (h->weak)), -1, -1, printcharfun, 0);
              PRINTCHAR (' ');
              sprintf (buf, "%d/%d", XFASTINT (h->count),
                       XVECTOR (h->next)->size);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]