Mercurial > emacs
comparison src/coding.c @ 83150:cf8f0a3b5cb4
Merged in changes from CVS trunk.
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-376
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-377
(Fdisplay_supports_face_attributes_p): Work around bootstrapping problem
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-378
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-379
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-380
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-381
Face merging cleanups
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-190
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Mon, 07 Jun 2004 08:00:27 +0000 |
parents | 5182815e0ee1 49894995b543 |
children | 38500c0c86ab |
comparison
equal
deleted
inserted
replaced
83149:f004099bad61 | 83150:cf8f0a3b5cb4 |
---|---|
6564 Return a list of coding systems that safely encode the multibyte | 6564 Return a list of coding systems that safely encode the multibyte |
6565 text between P and PEND. SAFE_CODINGS, if non-nil, is an alist of | 6565 text between P and PEND. SAFE_CODINGS, if non-nil, is an alist of |
6566 possible coding systems. If it is nil, it means that we have not | 6566 possible coding systems. If it is nil, it means that we have not |
6567 yet found any coding systems. | 6567 yet found any coding systems. |
6568 | 6568 |
6569 WORK_TABLE is a copy of the char-table Vchar_coding_system_table. An | 6569 WORK_TABLE a char-table of which element is set to t once the |
6570 element of WORK_TABLE is set to t once the element is looked up. | 6570 element is looked up. |
6571 | 6571 |
6572 If a non-ASCII single byte char is found, set | 6572 If a non-ASCII single byte char is found, set |
6573 *single_byte_char_found to 1. */ | 6573 *single_byte_char_found to 1. */ |
6574 | 6574 |
6575 static Lisp_Object | 6575 static Lisp_Object |
6580 { | 6580 { |
6581 int c, len; | 6581 int c, len; |
6582 Lisp_Object val, ch; | 6582 Lisp_Object val, ch; |
6583 Lisp_Object prev, tail; | 6583 Lisp_Object prev, tail; |
6584 | 6584 |
6585 if (NILP (safe_codings)) | |
6586 goto done_safe_codings; | |
6585 while (p < pend) | 6587 while (p < pend) |
6586 { | 6588 { |
6587 c = STRING_CHAR_AND_LENGTH (p, pend - p, len); | 6589 c = STRING_CHAR_AND_LENGTH (p, pend - p, len); |
6588 p += len; | 6590 p += len; |
6589 if (ASCII_BYTE_P (c)) | 6591 if (ASCII_BYTE_P (c)) |
6590 /* We can ignore ASCII characters here. */ | 6592 /* We can ignore ASCII characters here. */ |
6591 continue; | 6593 continue; |
6592 if (SINGLE_BYTE_CHAR_P (c)) | 6594 if (SINGLE_BYTE_CHAR_P (c)) |
6593 *single_byte_char_found = 1; | 6595 *single_byte_char_found = 1; |
6594 if (NILP (safe_codings)) | |
6595 /* Already all coding systems are excluded. But, we can't | |
6596 terminate the loop here because non-ASCII single-byte char | |
6597 must be found. */ | |
6598 continue; | |
6599 /* Check the safe coding systems for C. */ | 6596 /* Check the safe coding systems for C. */ |
6600 ch = make_number (c); | 6597 ch = make_number (c); |
6601 val = Faref (work_table, ch); | 6598 val = Faref (work_table, ch); |
6602 if (EQ (val, Qt)) | 6599 if (EQ (val, Qt)) |
6603 /* This element was already checked. Ignore it. */ | 6600 /* This element was already checked. Ignore it. */ |
6671 prev = tail; | 6668 prev = tail; |
6672 else | 6669 else |
6673 { | 6670 { |
6674 /* Exclude this coding system from SAFE_CODINGS. */ | 6671 /* Exclude this coding system from SAFE_CODINGS. */ |
6675 if (EQ (tail, safe_codings)) | 6672 if (EQ (tail, safe_codings)) |
6676 safe_codings = XCDR (safe_codings); | 6673 { |
6674 safe_codings = XCDR (safe_codings); | |
6675 if (NILP (safe_codings)) | |
6676 goto done_safe_codings; | |
6677 } | |
6677 else | 6678 else |
6678 XSETCDR (prev, XCDR (tail)); | 6679 XSETCDR (prev, XCDR (tail)); |
6679 } | 6680 } |
6680 } | 6681 } |
6681 } | 6682 } |
6683 | |
6684 done_safe_codings: | |
6685 /* If the above loop was terminated before P reaches PEND, it means | |
6686 SAFE_CODINGS was set to nil. If we have not yet found an | |
6687 non-ASCII single-byte char, check it now. */ | |
6688 if (! *single_byte_char_found) | |
6689 while (p < pend) | |
6690 { | |
6691 c = STRING_CHAR_AND_LENGTH (p, pend - p, len); | |
6692 p += len; | |
6693 if (! ASCII_BYTE_P (c) | |
6694 && SINGLE_BYTE_CHAR_P (c)) | |
6695 { | |
6696 *single_byte_char_found = 1; | |
6697 break; | |
6698 } | |
6699 } | |
6682 return safe_codings; | 6700 return safe_codings; |
6683 } | 6701 } |
6684 | 6702 |
6685 DEFUN ("find-coding-systems-region-internal", | 6703 DEFUN ("find-coding-systems-region-internal", |
6686 Ffind_coding_systems_region_internal, | 6704 Ffind_coding_systems_region_internal, |