diff options
| author | Andreas Schwab | 2004-04-26 21:56:26 +0000 |
|---|---|---|
| committer | Andreas Schwab | 2004-04-26 21:56:26 +0000 |
| commit | 4b5af5e47974a01c030c92aa34003bd70a2bd947 (patch) | |
| tree | 06dd254a44c9d7acafa85f72e890ee9f6e2d9440 /src | |
| parent | db85986c76f0b1c4c34ff86b6305004c3c0f1ec4 (diff) | |
| download | emacs-4b5af5e47974a01c030c92aa34003bd70a2bd947.tar.gz emacs-4b5af5e47974a01c030c92aa34003bd70a2bd947.zip | |
(print_object): Print non-ascii characters in bool vector representation
as octal escapes. Use BOOL_VECTOR_BITS_PER_CHAR instead of BITS_PER_CHAR.
Diffstat (limited to 'src')
| -rw-r--r-- | src/print.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/print.c b/src/print.c index 89690fe5399..7548bc75661 100644 --- a/src/print.c +++ b/src/print.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* Lisp object printing and output streams. | 1 | /* Lisp object printing and output streams. |
| 2 | Copyright (C) 1985, 86, 88, 93, 94, 95, 97, 98, 1999, 2000, 01, 2003 | 2 | Copyright (C) 1985, 86, 88, 93, 94, 95, 97, 98, 1999, 2000, 01, 03, 2004 |
| 3 | Free Software Foundation, Inc. | 3 | Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| @@ -1783,7 +1783,8 @@ print_object (obj, printcharfun, escapeflag) | |||
| 1783 | register unsigned char c; | 1783 | register unsigned char c; |
| 1784 | struct gcpro gcpro1; | 1784 | struct gcpro gcpro1; |
| 1785 | int size_in_chars | 1785 | int size_in_chars |
| 1786 | = (XBOOL_VECTOR (obj)->size + BITS_PER_CHAR - 1) / BITS_PER_CHAR; | 1786 | = ((XBOOL_VECTOR (obj)->size + BOOL_VECTOR_BITS_PER_CHAR - 1) |
| 1787 | / BOOL_VECTOR_BITS_PER_CHAR); | ||
| 1787 | 1788 | ||
| 1788 | GCPRO1 (obj); | 1789 | GCPRO1 (obj); |
| 1789 | 1790 | ||
| @@ -1814,6 +1815,14 @@ print_object (obj, printcharfun, escapeflag) | |||
| 1814 | PRINTCHAR ('\\'); | 1815 | PRINTCHAR ('\\'); |
| 1815 | PRINTCHAR ('f'); | 1816 | PRINTCHAR ('f'); |
| 1816 | } | 1817 | } |
| 1818 | else if (c > '\177') | ||
| 1819 | { | ||
| 1820 | /* Use octal escapes to avoid encoding issues. */ | ||
| 1821 | PRINTCHAR ('\\'); | ||
| 1822 | PRINTCHAR ('0' + ((c >> 6) & 3)); | ||
| 1823 | PRINTCHAR ('0' + ((c >> 3) & 7)); | ||
| 1824 | PRINTCHAR ('0' + (c & 7)); | ||
| 1825 | } | ||
| 1817 | else | 1826 | else |
| 1818 | { | 1827 | { |
| 1819 | if (c == '\"' || c == '\\') | 1828 | if (c == '\"' || c == '\\') |