diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 11 | ||||
| -rw-r--r-- | src/charset.h | 12 |
2 files changed, 23 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 0174ffd8d80..06e678f4350 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,14 @@ | |||
| 1 | 2001-07-13 Gerd Moellmann <gerd@gnu.org> | ||
| 2 | |||
| 3 | * xdisp.c (get_next_display_element): Use CHAR_STRING_NO_SIGNAL | ||
| 4 | instead of CHAR_STRING which can signal an error. | ||
| 5 | |||
| 6 | * charset.c (char_to_string_1): Extracted from char_to_string. | ||
| 7 | Return -1 instead of signaling an error. | ||
| 8 | (char_to_string): Use it. | ||
| 9 | |||
| 10 | * charset.h (CHAR_STRING_NO_SIGNAL): New macro. | ||
| 11 | |||
| 1 | 2001-07-12 Stefan Monnier <monnier@cs.yale.edu> | 12 | 2001-07-12 Stefan Monnier <monnier@cs.yale.edu> |
| 2 | 13 | ||
| 3 | * coding.c (Ffind_coding_systems_region_internal): If safe_codings | 14 | * coding.c (Ffind_coding_systems_region_internal): If safe_codings |
diff --git a/src/charset.h b/src/charset.h index e086c056282..961bb60afcb 100644 --- a/src/charset.h +++ b/src/charset.h | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | /* Header for multibyte character handler. | 1 | /* Header for multibyte character handler. |
| 2 | Copyright (C) 1995, 1997, 1998 Electrotechnical Laboratory, JAPAN. | 2 | Copyright (C) 1995, 1997, 1998 Electrotechnical Laboratory, JAPAN. |
| 3 | Licensed to the Free Software Foundation. | 3 | Licensed to the Free Software Foundation. |
| 4 | Copyright (C) 2001 Free Software Foundation, Inc. | ||
| 4 | 5 | ||
| 5 | This file is part of GNU Emacs. | 6 | This file is part of GNU Emacs. |
| 6 | 7 | ||
| @@ -531,6 +532,16 @@ extern int iso_charset_table[2][2][128]; | |||
| 531 | : (*(str) = LEADING_CODE_8_BIT_CONTROL, *((str)+ 1) = c + 0x20, 2)) \ | 532 | : (*(str) = LEADING_CODE_8_BIT_CONTROL, *((str)+ 1) = c + 0x20, 2)) \ |
| 532 | : char_to_string (c, (unsigned char *) str)) | 533 | : char_to_string (c, (unsigned char *) str)) |
| 533 | 534 | ||
| 535 | /* Like CHAR_STRING but don't signal an error if C is invalid. | ||
| 536 | Value is -1 in this case. */ | ||
| 537 | |||
| 538 | #define CHAR_STRING_NO_SIGNAL(c, str) \ | ||
| 539 | (SINGLE_BYTE_CHAR_P (c) \ | ||
| 540 | ? ((ASCII_BYTE_P (c) || c >= 0xA0) \ | ||
| 541 | ? (*(str) = (unsigned char)(c), 1) \ | ||
| 542 | : (*(str) = LEADING_CODE_8_BIT_CONTROL, *((str)+ 1) = c + 0x20, 2)) \ | ||
| 543 | : char_to_string_1 (c, (unsigned char *) str)) | ||
| 544 | |||
| 534 | /* Return a character code of the character of which multi-byte form | 545 | /* Return a character code of the character of which multi-byte form |
| 535 | is at STR and the length is LEN. If STR doesn't contain valid | 546 | is at STR and the length is LEN. If STR doesn't contain valid |
| 536 | multi-byte form, only the first byte in STR is returned. */ | 547 | multi-byte form, only the first byte in STR is returned. */ |
| @@ -775,6 +786,7 @@ extern int translate_char P_ ((Lisp_Object, int, int, int, int)); | |||
| 775 | extern int split_string P_ ((const unsigned char *, int, int *, | 786 | extern int split_string P_ ((const unsigned char *, int, int *, |
| 776 | unsigned char *, unsigned char *)); | 787 | unsigned char *, unsigned char *)); |
| 777 | extern int char_to_string P_ ((int, unsigned char *)); | 788 | extern int char_to_string P_ ((int, unsigned char *)); |
| 789 | extern int char_to_string_1 P_ ((int, unsigned char *)); | ||
| 778 | extern int string_to_char P_ ((const unsigned char *, int, int *)); | 790 | extern int string_to_char P_ ((const unsigned char *, int, int *)); |
| 779 | extern int char_printable_p P_ ((int c)); | 791 | extern int char_printable_p P_ ((int c)); |
| 780 | extern int multibyte_form_length P_ ((const unsigned char *, int)); | 792 | extern int multibyte_form_length P_ ((const unsigned char *, int)); |