]> code.delx.au - gnu-emacs/blobdiff - src/print.c
* doc/lispref/modes.texi (Defining Minor Modes): Use C-backspace, not C-delete.
[gnu-emacs] / src / print.c
index 24d497ed36592dfbec86982090bdf9ddea8d2bd1..ccbf8d8c0c789ae3451d0954960a9acc9d80dbeb 100644 (file)
@@ -1,7 +1,7 @@
 /* Lisp object printing and output streams.
    Copyright (C) 1985, 1986, 1988, 1993, 1994, 1995, 1997,
                  1998, 1999, 2000, 2001, 2002, 2003, 2004,
-                 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+                 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -401,7 +401,7 @@ strout (ptr, size, size_byte, printcharfun, multibyte)
          int len;
          for (i = 0; i < size_byte; i += len)
            {
-             int ch = STRING_CHAR_AND_LENGTH (ptr + i, size_byte - i, len);
+             int ch = STRING_CHAR_AND_LENGTH (ptr + i, len);
              insert_char (ch);
            }
        }
@@ -427,7 +427,7 @@ strout (ptr, size, size_byte, printcharfun, multibyte)
                 corresponding character code before handing it to
                 PRINTCHAR.  */
              int len;
-             int ch = STRING_CHAR_AND_LENGTH (ptr + i, size_byte - i, len);
+             int ch = STRING_CHAR_AND_LENGTH (ptr + i, len);
              PRINTCHAR (ch);
              i += len;
            }
@@ -519,8 +519,7 @@ print_string (string, printcharfun)
            /* 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);
+           int ch = STRING_CHAR_AND_LENGTH (SDATA (string) + i, len);
            PRINTCHAR (ch);
            i += len;
          }
@@ -1417,6 +1416,13 @@ print_preprocess (obj)
            size &= PSEUDOVECTOR_SIZE_MASK;
          for (i = 0; i < size; i++)
            print_preprocess (XVECTOR (obj)->contents[i]);
+         if (HASH_TABLE_P (obj))
+           { /* For hash tables, the key_and_value slot is past
+               `size' because it needs to be marked specially in case
+               the table is weak.  */
+             struct Lisp_Hash_Table *h = XHASH_TABLE (obj);
+             print_preprocess (h->key_and_value);
+           }
          break;
 
        default:
@@ -1645,8 +1651,7 @@ print_object (obj, printcharfun, escapeflag)
 
              if (multibyte)
                {
-                 c = STRING_CHAR_AND_LENGTH (str + i_byte,
-                                             size_byte - i_byte, len);
+                 c = STRING_CHAR_AND_LENGTH (str + i_byte, len);
                  i_byte += len;
                }
              else
@@ -2034,6 +2039,7 @@ print_object (obj, printcharfun, escapeflag)
       else if (HASH_TABLE_P (obj))
        {
          struct Lisp_Hash_Table *h = XHASH_TABLE (obj);
+         int i, real_size, size;
 #if 0
          strout ("#<hash-table", -1, -1, printcharfun, 0);
          if (SYMBOLP (h->test))
@@ -2086,10 +2092,8 @@ print_object (obj, printcharfun, escapeflag)
          strout (" data ", -1, -1, printcharfun, 0);
 
          /* Print the data here as a plist. */
-         int i;
-
-         int real_size = HASH_TABLE_SIZE (h);
-         int size = real_size;
+         real_size = HASH_TABLE_SIZE (h);
+         size = real_size;
 
          /* Don't print more elements than the specified maximum.  */
          if (NATNUMP (Vprint_length)