/[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.183 by rms, Mon Oct 14 01:30:26 2002 UTC revision 1.184 by lektu, Tue Feb 4 14:03:13 2003 UTC
# Line 189  void print_interval (); Line 189  void print_interval ();
189     and must start with PRINTPREPARE, end with PRINTFINISH,     and must start with PRINTPREPARE, end with PRINTFINISH,
190     and use PRINTDECLARE to declare common variables.     and use PRINTDECLARE to declare common variables.
191     Use PRINTCHAR to output one character,     Use PRINTCHAR to output one character,
192     or call strout to output a block of characters. */     or call strout to output a block of characters. */
193    
194  #define PRINTDECLARE                                                    \  #define PRINTDECLARE                                                    \
195     struct buffer *old = current_buffer;                                 \     struct buffer *old = current_buffer;                                 \
# Line 321  printchar (ch, fun) Line 321  printchar (ch, fun)
321        int len = CHAR_STRING (ch, str);        int len = CHAR_STRING (ch, str);
322    
323        QUIT;        QUIT;
324          
325        if (NILP (fun))        if (NILP (fun))
326          {          {
327            if (print_buffer_pos_byte + len >= print_buffer_size)            if (print_buffer_pos_byte + len >= print_buffer_size)
# Line 340  printchar (ch, fun) Line 340  printchar (ch, fun)
340          {          {
341            int multibyte_p            int multibyte_p
342              = !NILP (current_buffer->enable_multibyte_characters);              = !NILP (current_buffer->enable_multibyte_characters);
343              
344            setup_echo_area_for_printing (multibyte_p);            setup_echo_area_for_printing (multibyte_p);
345            insert_char (ch);            insert_char (ch);
346            message_dolog (str, len, 0, multibyte_p);            message_dolog (str, len, 0, multibyte_p);
# Line 397  strout (ptr, size, size_byte, printcharf Line 397  strout (ptr, size, size_byte, printcharf
397        int i;        int i;
398        int multibyte_p        int multibyte_p
399          = !NILP (current_buffer->enable_multibyte_characters);          = !NILP (current_buffer->enable_multibyte_characters);
400          
401        setup_echo_area_for_printing (multibyte_p);        setup_echo_area_for_printing (multibyte_p);
402        message_dolog (ptr, size_byte, 0, multibyte_p);        message_dolog (ptr, size_byte, 0, multibyte_p);
403          
404        if (size == size_byte)        if (size == size_byte)
405          {          {
406            for (i = 0; i < size; ++i)            for (i = 0; i < size; ++i)
# Line 415  strout (ptr, size, size_byte, printcharf Line 415  strout (ptr, size, size_byte, printcharf
415                insert_char (ch);                insert_char (ch);
416              }              }
417          }          }
418          
419  #ifdef MAX_PRINT_CHARS  #ifdef MAX_PRINT_CHARS
420        if (max_print)        if (max_print)
421          print_chars += size;          print_chars += size;
# Line 653  to display it temporarily selected. Line 653  to display it temporarily selected.
653    
654  If variable `temp-buffer-show-function' is non-nil, call it at the end  If variable `temp-buffer-show-function' is non-nil, call it at the end
655  to get the buffer displayed instead of just displaying the non-selected  to get the buffer displayed instead of just displaying the non-selected
656  buffer and calling the hook.  It gets one argument, the buffer to display.    buffer and calling the hook.  It gets one argument, the buffer to display.
657    
658  usage: (with-output-to-temp-buffer BUFFNAME BODY ...)  */)  usage: (with-output-to-temp-buffer BUFFNAME BODY ...)  */)
659       (args)       (args)
# Line 1005  print_error_message (data, stream, conte Line 1005  print_error_message (data, stream, conte
1005        else        else
1006          Fprin1 (obj, stream);          Fprin1 (obj, stream);
1007      }      }
1008      
1009    UNGCPRO;    UNGCPRO;
1010  }  }
1011    
# Line 1016  print_error_message (data, stream, conte Line 1016  print_error_message (data, stream, conte
1016   * largest float, printed in the biggest notation.  This is undoubtedly   * largest float, printed in the biggest notation.  This is undoubtedly
1017   * 20d float_output_format, with the negative of the C-constant "HUGE"   * 20d float_output_format, with the negative of the C-constant "HUGE"
1018   * from <math.h>.   * from <math.h>.
1019   *   *
1020   * On the vax the worst case is -1e38 in 20d format which takes 61 bytes.   * On the vax the worst case is -1e38 in 20d format which takes 61 bytes.
1021   *   *
1022   * I assume that IEEE-754 format numbers can take 329 bytes for the worst   * I assume that IEEE-754 format numbers can take 329 bytes for the worst
1023   * case of -1e307 in 20d float_output_format. What is one to do (short of   * case of -1e307 in 20d float_output_format. What is one to do (short of
1024   * re-writing _doprnt to be more sane)?   * re-writing _doprnt to be more sane)?
# Line 1032  float_to_string (buf, data) Line 1032  float_to_string (buf, data)
1032  {  {
1033    unsigned char *cp;    unsigned char *cp;
1034    int width;    int width;
1035          
1036    /* Check for plus infinity in a way that won't lose    /* Check for plus infinity in a way that won't lose
1037       if there is no plus infinity.  */       if there is no plus infinity.  */
1038    if (data == data / 2 && data > 1.0)    if (data == data / 2 && data > 1.0)
# Line 1061  float_to_string (buf, data) Line 1061  float_to_string (buf, data)
1061              *buf++ = '-';              *buf++ = '-';
1062              break;              break;
1063            }            }
1064          
1065        strcpy (buf, "0.0e+NaN");        strcpy (buf, "0.0e+NaN");
1066        return;        return;
1067      }      }
# Line 1598  print_object (obj, printcharfun, escapef Line 1598  print_object (obj, printcharfun, escapef
1598        else        else
1599          {          {
1600            PRINTCHAR ('(');            PRINTCHAR ('(');
1601              
1602            /* If the first element is a backquote form,            /* If the first element is a backquote form,
1603               print it old-style so it won't be misunderstood.  */               print it old-style so it won't be misunderstood.  */
1604            if (print_quoted && CONSP (XCAR (obj))            if (print_quoted && CONSP (XCAR (obj))
# Line 1670  print_object (obj, printcharfun, escapef Line 1670  print_object (obj, printcharfun, escapef
1670                              }                              }
1671                        }                        }
1672                    }                    }
1673                    
1674                  if (i++)                  if (i++)
1675                    PRINTCHAR (' ');                    PRINTCHAR (' ');
1676                    
1677                  if (print_length && i > print_length)                  if (print_length && i > print_length)
1678                    {                    {
1679                      strout ("...", 3, 3, printcharfun, 0);                      strout ("...", 3, 3, printcharfun, 0);
1680                      goto end_of_list;                      goto end_of_list;
1681                    }                    }
1682                    
1683                  print_object (XCAR (obj), printcharfun, escapeflag);                  print_object (XCAR (obj), printcharfun, escapeflag);
1684                    
1685                  obj = XCDR (obj);                  obj = XCDR (obj);
1686                  if (!(i & 1))                  if (!(i & 1))
1687                    halftail = XCDR (halftail);                    halftail = XCDR (halftail);
# Line 1694  print_object (obj, printcharfun, escapef Line 1694  print_object (obj, printcharfun, escapef
1694                strout (" . ", 3, 3, printcharfun, 0);                strout (" . ", 3, 3, printcharfun, 0);
1695                print_object (obj, printcharfun, escapeflag);                print_object (obj, printcharfun, escapeflag);
1696              }              }
1697              
1698          end_of_list:          end_of_list:
1699            PRINTCHAR (')');            PRINTCHAR (')');
1700          }          }

Legend:
Removed from v.1.183  
changed lines
  Added in v.1.184

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