Mercurial > emacs
comparison src/coding.c @ 40713:42351475da08
Change doc-string comments to `new style' [w/`doc:' keyword].
| author | Pavel Jan?k <Pavel@Janik.cz> |
|---|---|
| date | Sun, 04 Nov 2001 17:42:30 +0000 |
| parents | cdfd4d09b79a |
| children | 27fa759cd153 |
comparison
equal
deleted
inserted
replaced
| 40712:31101867e6bf | 40713:42351475da08 |
|---|---|
| 6090 | 6090 |
| 6091 #ifdef emacs | 6091 #ifdef emacs |
| 6092 /*** 8. Emacs Lisp library functions ***/ | 6092 /*** 8. Emacs Lisp library functions ***/ |
| 6093 | 6093 |
| 6094 DEFUN ("coding-system-p", Fcoding_system_p, Scoding_system_p, 1, 1, 0, | 6094 DEFUN ("coding-system-p", Fcoding_system_p, Scoding_system_p, 1, 1, 0, |
| 6095 "Return t if OBJECT is nil or a coding-system.\n\ | 6095 doc: /* Return t if OBJECT is nil or a coding-system. |
| 6096 See the documentation of `make-coding-system' for information\n\ | 6096 See the documentation of `make-coding-system' for information |
| 6097 about coding-system objects.") | 6097 about coding-system objects. */) |
| 6098 (obj) | 6098 (obj) |
| 6099 Lisp_Object obj; | 6099 Lisp_Object obj; |
| 6100 { | 6100 { |
| 6101 if (NILP (obj)) | 6101 if (NILP (obj)) |
| 6102 return Qt; | 6102 return Qt; |
| 6103 if (!SYMBOLP (obj)) | 6103 if (!SYMBOLP (obj)) |
| 6108 ? Qt : Qnil); | 6108 ? Qt : Qnil); |
| 6109 } | 6109 } |
| 6110 | 6110 |
| 6111 DEFUN ("read-non-nil-coding-system", Fread_non_nil_coding_system, | 6111 DEFUN ("read-non-nil-coding-system", Fread_non_nil_coding_system, |
| 6112 Sread_non_nil_coding_system, 1, 1, 0, | 6112 Sread_non_nil_coding_system, 1, 1, 0, |
| 6113 "Read a coding system from the minibuffer, prompting with string PROMPT.") | 6113 doc: /* Read a coding system from the minibuffer, prompting with string PROMPT. */) |
| 6114 (prompt) | 6114 (prompt) |
| 6115 Lisp_Object prompt; | 6115 Lisp_Object prompt; |
| 6116 { | 6116 { |
| 6117 Lisp_Object val; | 6117 Lisp_Object val; |
| 6118 do | 6118 do |
| 6119 { | 6119 { |
| 6123 while (XSTRING (val)->size == 0); | 6123 while (XSTRING (val)->size == 0); |
| 6124 return (Fintern (val, Qnil)); | 6124 return (Fintern (val, Qnil)); |
| 6125 } | 6125 } |
| 6126 | 6126 |
| 6127 DEFUN ("read-coding-system", Fread_coding_system, Sread_coding_system, 1, 2, 0, | 6127 DEFUN ("read-coding-system", Fread_coding_system, Sread_coding_system, 1, 2, 0, |
| 6128 "Read a coding system from the minibuffer, prompting with string PROMPT.\n\ | 6128 doc: /* Read a coding system from the minibuffer, prompting with string PROMPT. |
| 6129 If the user enters null input, return second argument DEFAULT-CODING-SYSTEM.") | 6129 If the user enters null input, return second argument DEFAULT-CODING-SYSTEM. */) |
| 6130 (prompt, default_coding_system) | 6130 (prompt, default_coding_system) |
| 6131 Lisp_Object prompt, default_coding_system; | 6131 Lisp_Object prompt, default_coding_system; |
| 6132 { | 6132 { |
| 6133 Lisp_Object val; | 6133 Lisp_Object val; |
| 6134 if (SYMBOLP (default_coding_system)) | 6134 if (SYMBOLP (default_coding_system)) |
| 6135 XSETSTRING (default_coding_system, XSYMBOL (default_coding_system)->name); | 6135 XSETSTRING (default_coding_system, XSYMBOL (default_coding_system)->name); |
| 6139 return (XSTRING (val)->size == 0 ? Qnil : Fintern (val, Qnil)); | 6139 return (XSTRING (val)->size == 0 ? Qnil : Fintern (val, Qnil)); |
| 6140 } | 6140 } |
| 6141 | 6141 |
| 6142 DEFUN ("check-coding-system", Fcheck_coding_system, Scheck_coding_system, | 6142 DEFUN ("check-coding-system", Fcheck_coding_system, Scheck_coding_system, |
| 6143 1, 1, 0, | 6143 1, 1, 0, |
| 6144 "Check validity of CODING-SYSTEM.\n\ | 6144 doc: /* Check validity of CODING-SYSTEM. |
| 6145 If valid, return CODING-SYSTEM, else signal a `coding-system-error' error.\n\ | 6145 If valid, return CODING-SYSTEM, else signal a `coding-system-error' error. |
| 6146 It is valid if it is a symbol with a non-nil `coding-system' property.\n\ | 6146 It is valid if it is a symbol with a non-nil `coding-system' property. |
| 6147 The value of property should be a vector of length 5.") | 6147 The value of property should be a vector of length 5. */) |
| 6148 (coding_system) | 6148 (coding_system) |
| 6149 Lisp_Object coding_system; | 6149 Lisp_Object coding_system; |
| 6150 { | 6150 { |
| 6151 CHECK_SYMBOL (coding_system); | 6151 CHECK_SYMBOL (coding_system); |
| 6152 if (!NILP (Fcoding_system_p (coding_system))) | 6152 if (!NILP (Fcoding_system_p (coding_system))) |
| 6153 return coding_system; | 6153 return coding_system; |
| 6218 return (highest ? XCAR (val) : val); | 6218 return (highest ? XCAR (val) : val); |
| 6219 } | 6219 } |
| 6220 | 6220 |
| 6221 DEFUN ("detect-coding-region", Fdetect_coding_region, Sdetect_coding_region, | 6221 DEFUN ("detect-coding-region", Fdetect_coding_region, Sdetect_coding_region, |
| 6222 2, 3, 0, | 6222 2, 3, 0, |
| 6223 "Detect coding system of the text in the region between START and END.\n\ | 6223 doc: /* Detect coding system of the text in the region between START and END. |
| 6224 Return a list of possible coding systems ordered by priority.\n\ | 6224 Return a list of possible coding systems ordered by priority. |
| 6225 \n\ | 6225 |
| 6226 If only ASCII characters are found, it returns a list of single element\n\ | 6226 If only ASCII characters are found, it returns a list of single element |
| 6227 `undecided' or its subsidiary coding system according to a detected\n\ | 6227 `undecided' or its subsidiary coding system according to a detected |
| 6228 end-of-line format.\n\ | 6228 end-of-line format. |
| 6229 \n\ | 6229 |
| 6230 If optional argument HIGHEST is non-nil, return the coding system of\n\ | 6230 If optional argument HIGHEST is non-nil, return the coding system of |
| 6231 highest priority.") | 6231 highest priority. */) |
| 6232 (start, end, highest) | 6232 (start, end, highest) |
| 6233 Lisp_Object start, end, highest; | 6233 Lisp_Object start, end, highest; |
| 6234 { | 6234 { |
| 6235 int from, to; | 6235 int from, to; |
| 6236 int from_byte, to_byte; | 6236 int from_byte, to_byte; |
| 6237 int include_anchor_byte = 0; | 6237 int include_anchor_byte = 0; |
| 6262 ->enable_multibyte_characters)); | 6262 ->enable_multibyte_characters)); |
| 6263 } | 6263 } |
| 6264 | 6264 |
| 6265 DEFUN ("detect-coding-string", Fdetect_coding_string, Sdetect_coding_string, | 6265 DEFUN ("detect-coding-string", Fdetect_coding_string, Sdetect_coding_string, |
| 6266 1, 2, 0, | 6266 1, 2, 0, |
| 6267 "Detect coding system of the text in STRING.\n\ | 6267 doc: /* Detect coding system of the text in STRING. |
| 6268 Return a list of possible coding systems ordered by priority.\n\ | 6268 Return a list of possible coding systems ordered by priority. |
| 6269 \n\ | 6269 |
| 6270 If only ASCII characters are found, it returns a list of single element\n\ | 6270 If only ASCII characters are found, it returns a list of single element |
| 6271 `undecided' or its subsidiary coding system according to a detected\n\ | 6271 `undecided' or its subsidiary coding system according to a detected |
| 6272 end-of-line format.\n\ | 6272 end-of-line format. |
| 6273 \n\ | 6273 |
| 6274 If optional argument HIGHEST is non-nil, return the coding system of\n\ | 6274 If optional argument HIGHEST is non-nil, return the coding system of |
| 6275 highest priority.") | 6275 highest priority. */) |
| 6276 (string, highest) | 6276 (string, highest) |
| 6277 Lisp_Object string, highest; | 6277 Lisp_Object string, highest; |
| 6278 { | 6278 { |
| 6279 CHECK_STRING (string); | 6279 CHECK_STRING (string); |
| 6280 | 6280 |
| 6281 return detect_coding_system (XSTRING (string)->data, | 6281 return detect_coding_system (XSTRING (string)->data, |
| 6362 return t. */ | 6362 return t. */ |
| 6363 | 6363 |
| 6364 DEFUN ("find-coding-systems-region-internal", | 6364 DEFUN ("find-coding-systems-region-internal", |
| 6365 Ffind_coding_systems_region_internal, | 6365 Ffind_coding_systems_region_internal, |
| 6366 Sfind_coding_systems_region_internal, 2, 2, 0, | 6366 Sfind_coding_systems_region_internal, 2, 2, 0, |
| 6367 "Internal use only.") | 6367 doc: /* Internal use only. */) |
| 6368 (start, end) | 6368 (start, end) |
| 6369 Lisp_Object start, end; | 6369 Lisp_Object start, end; |
| 6370 { | 6370 { |
| 6371 Lisp_Object work_table, safe_codings; | 6371 Lisp_Object work_table, safe_codings; |
| 6372 int non_ascii_p = 0; | 6372 int non_ascii_p = 0; |
| 6373 int single_byte_char_found = 0; | 6373 int single_byte_char_found = 0; |
| 6476 return make_number (coding.produced_char); | 6476 return make_number (coding.produced_char); |
| 6477 } | 6477 } |
| 6478 | 6478 |
| 6479 DEFUN ("decode-coding-region", Fdecode_coding_region, Sdecode_coding_region, | 6479 DEFUN ("decode-coding-region", Fdecode_coding_region, Sdecode_coding_region, |
| 6480 3, 3, "r\nzCoding system: ", | 6480 3, 3, "r\nzCoding system: ", |
| 6481 "Decode the current region from the specified coding system.\n\ | 6481 doc: /* Decode the current region from the specified coding system. |
| 6482 When called from a program, takes three arguments:\n\ | 6482 When called from a program, takes three arguments: |
| 6483 START, END, and CODING-SYSTEM. START and END are buffer positions.\n\ | 6483 START, END, and CODING-SYSTEM. START and END are buffer positions. |
| 6484 This function sets `last-coding-system-used' to the precise coding system\n\ | 6484 This function sets `last-coding-system-used' to the precise coding system |
| 6485 used (which may be different from CODING-SYSTEM if CODING-SYSTEM is\n\ | 6485 used (which may be different from CODING-SYSTEM if CODING-SYSTEM is |
| 6486 not fully specified.)\n\ | 6486 not fully specified.) |
| 6487 It returns the length of the decoded text.") | 6487 It returns the length of the decoded text. */) |
| 6488 (start, end, coding_system) | 6488 (start, end, coding_system) |
| 6489 Lisp_Object start, end, coding_system; | 6489 Lisp_Object start, end, coding_system; |
| 6490 { | 6490 { |
| 6491 return code_convert_region1 (start, end, coding_system, 0); | 6491 return code_convert_region1 (start, end, coding_system, 0); |
| 6492 } | 6492 } |
| 6493 | 6493 |
| 6494 DEFUN ("encode-coding-region", Fencode_coding_region, Sencode_coding_region, | 6494 DEFUN ("encode-coding-region", Fencode_coding_region, Sencode_coding_region, |
| 6495 3, 3, "r\nzCoding system: ", | 6495 3, 3, "r\nzCoding system: ", |
| 6496 "Encode the current region into the specified coding system.\n\ | 6496 doc: /* Encode the current region into the specified coding system. |
| 6497 When called from a program, takes three arguments:\n\ | 6497 When called from a program, takes three arguments: |
| 6498 START, END, and CODING-SYSTEM. START and END are buffer positions.\n\ | 6498 START, END, and CODING-SYSTEM. START and END are buffer positions. |
| 6499 This function sets `last-coding-system-used' to the precise coding system\n\ | 6499 This function sets `last-coding-system-used' to the precise coding system |
| 6500 used (which may be different from CODING-SYSTEM if CODING-SYSTEM is\n\ | 6500 used (which may be different from CODING-SYSTEM if CODING-SYSTEM is |
| 6501 not fully specified.)\n\ | 6501 not fully specified.) |
| 6502 It returns the length of the encoded text.") | 6502 It returns the length of the encoded text. */) |
| 6503 (start, end, coding_system) | 6503 (start, end, coding_system) |
| 6504 Lisp_Object start, end, coding_system; | 6504 Lisp_Object start, end, coding_system; |
| 6505 { | 6505 { |
| 6506 return code_convert_region1 (start, end, coding_system, 1); | 6506 return code_convert_region1 (start, end, coding_system, 1); |
| 6507 } | 6507 } |
| 6508 | 6508 |
| 6531 return string; | 6531 return string; |
| 6532 } | 6532 } |
| 6533 | 6533 |
| 6534 DEFUN ("decode-coding-string", Fdecode_coding_string, Sdecode_coding_string, | 6534 DEFUN ("decode-coding-string", Fdecode_coding_string, Sdecode_coding_string, |
| 6535 2, 3, 0, | 6535 2, 3, 0, |
| 6536 "Decode STRING which is encoded in CODING-SYSTEM, and return the result.\n\ | 6536 doc: /* Decode STRING which is encoded in CODING-SYSTEM, and return the result. |
| 6537 Optional arg NOCOPY non-nil means it is OK to return STRING itself\n\ | 6537 Optional arg NOCOPY non-nil means it is OK to return STRING itself |
| 6538 if the decoding operation is trivial.\n\ | 6538 if the decoding operation is trivial. |
| 6539 This function sets `last-coding-system-used' to the precise coding system\n\ | 6539 This function sets `last-coding-system-used' to the precise coding system |
| 6540 used (which may be different from CODING-SYSTEM if CODING-SYSTEM is\n\ | 6540 used (which may be different from CODING-SYSTEM if CODING-SYSTEM is |
| 6541 not fully specified.)") | 6541 not fully specified.) */) |
| 6542 (string, coding_system, nocopy) | 6542 (string, coding_system, nocopy) |
| 6543 Lisp_Object string, coding_system, nocopy; | 6543 Lisp_Object string, coding_system, nocopy; |
| 6544 { | 6544 { |
| 6545 return code_convert_string1 (string, coding_system, nocopy, 0); | 6545 return code_convert_string1 (string, coding_system, nocopy, 0); |
| 6546 } | 6546 } |
| 6547 | 6547 |
| 6548 DEFUN ("encode-coding-string", Fencode_coding_string, Sencode_coding_string, | 6548 DEFUN ("encode-coding-string", Fencode_coding_string, Sencode_coding_string, |
| 6549 2, 3, 0, | 6549 2, 3, 0, |
| 6550 "Encode STRING to CODING-SYSTEM, and return the result.\n\ | 6550 doc: /* Encode STRING to CODING-SYSTEM, and return the result. |
| 6551 Optional arg NOCOPY non-nil means it is OK to return STRING itself\n\ | 6551 Optional arg NOCOPY non-nil means it is OK to return STRING itself |
| 6552 if the encoding operation is trivial.\n\ | 6552 if the encoding operation is trivial. |
| 6553 This function sets `last-coding-system-used' to the precise coding system\n\ | 6553 This function sets `last-coding-system-used' to the precise coding system |
| 6554 used (which may be different from CODING-SYSTEM if CODING-SYSTEM is\n\ | 6554 used (which may be different from CODING-SYSTEM if CODING-SYSTEM is |
| 6555 not fully specified.)") | 6555 not fully specified.) */) |
| 6556 (string, coding_system, nocopy) | 6556 (string, coding_system, nocopy) |
| 6557 Lisp_Object string, coding_system, nocopy; | 6557 Lisp_Object string, coding_system, nocopy; |
| 6558 { | 6558 { |
| 6559 return code_convert_string1 (string, coding_system, nocopy, 1); | 6559 return code_convert_string1 (string, coding_system, nocopy, 1); |
| 6560 } | 6560 } |
| 6561 | 6561 |
| 6587 ? encode_coding_string (string, &coding, 1) | 6587 ? encode_coding_string (string, &coding, 1) |
| 6588 : decode_coding_string (string, &coding, 1)); | 6588 : decode_coding_string (string, &coding, 1)); |
| 6589 } | 6589 } |
| 6590 | 6590 |
| 6591 DEFUN ("decode-sjis-char", Fdecode_sjis_char, Sdecode_sjis_char, 1, 1, 0, | 6591 DEFUN ("decode-sjis-char", Fdecode_sjis_char, Sdecode_sjis_char, 1, 1, 0, |
| 6592 "Decode a Japanese character which has CODE in shift_jis encoding.\n\ | 6592 doc: /* Decode a Japanese character which has CODE in shift_jis encoding. |
| 6593 Return the corresponding character.") | 6593 Return the corresponding character. */) |
| 6594 (code) | 6594 (code) |
| 6595 Lisp_Object code; | 6595 Lisp_Object code; |
| 6596 { | 6596 { |
| 6597 unsigned char c1, c2, s1, s2; | 6597 unsigned char c1, c2, s1, s2; |
| 6598 Lisp_Object val; | 6598 Lisp_Object val; |
| 6599 | 6599 |
| 6618 } | 6618 } |
| 6619 return val; | 6619 return val; |
| 6620 } | 6620 } |
| 6621 | 6621 |
| 6622 DEFUN ("encode-sjis-char", Fencode_sjis_char, Sencode_sjis_char, 1, 1, 0, | 6622 DEFUN ("encode-sjis-char", Fencode_sjis_char, Sencode_sjis_char, 1, 1, 0, |
| 6623 "Encode a Japanese character CHAR to shift_jis encoding.\n\ | 6623 doc: /* Encode a Japanese character CHAR to shift_jis encoding. |
| 6624 Return the corresponding code in SJIS.") | 6624 Return the corresponding code in SJIS. */) |
| 6625 (ch) | 6625 (ch) |
| 6626 Lisp_Object ch; | 6626 Lisp_Object ch; |
| 6627 { | 6627 { |
| 6628 int charset, c1, c2, s1, s2; | 6628 int charset, c1, c2, s1, s2; |
| 6629 Lisp_Object val; | 6629 Lisp_Object val; |
| 6630 | 6630 |
| 6649 error ("Can't encode to shift_jis: %d", XFASTINT (ch)); | 6649 error ("Can't encode to shift_jis: %d", XFASTINT (ch)); |
| 6650 return val; | 6650 return val; |
| 6651 } | 6651 } |
| 6652 | 6652 |
| 6653 DEFUN ("decode-big5-char", Fdecode_big5_char, Sdecode_big5_char, 1, 1, 0, | 6653 DEFUN ("decode-big5-char", Fdecode_big5_char, Sdecode_big5_char, 1, 1, 0, |
| 6654 "Decode a Big5 character which has CODE in BIG5 coding system.\n\ | 6654 doc: /* Decode a Big5 character which has CODE in BIG5 coding system. |
| 6655 Return the corresponding character.") | 6655 Return the corresponding character. */) |
| 6656 (code) | 6656 (code) |
| 6657 Lisp_Object code; | 6657 Lisp_Object code; |
| 6658 { | 6658 { |
| 6659 int charset; | 6659 int charset; |
| 6660 unsigned char b1, b2, c1, c2; | 6660 unsigned char b1, b2, c1, c2; |
| 6661 Lisp_Object val; | 6661 Lisp_Object val; |
| 6678 } | 6678 } |
| 6679 return val; | 6679 return val; |
| 6680 } | 6680 } |
| 6681 | 6681 |
| 6682 DEFUN ("encode-big5-char", Fencode_big5_char, Sencode_big5_char, 1, 1, 0, | 6682 DEFUN ("encode-big5-char", Fencode_big5_char, Sencode_big5_char, 1, 1, 0, |
| 6683 "Encode the Big5 character CHAR to BIG5 coding system.\n\ | 6683 doc: /* Encode the Big5 character CHAR to BIG5 coding system. |
| 6684 Return the corresponding character code in Big5.") | 6684 Return the corresponding character code in Big5. */) |
| 6685 (ch) | 6685 (ch) |
| 6686 Lisp_Object ch; | 6686 Lisp_Object ch; |
| 6687 { | 6687 { |
| 6688 int charset, c1, c2, b1, b2; | 6688 int charset, c1, c2, b1, b2; |
| 6689 Lisp_Object val; | 6689 Lisp_Object val; |
| 6690 | 6690 |
| 6707 return val; | 6707 return val; |
| 6708 } | 6708 } |
| 6709 | 6709 |
| 6710 DEFUN ("set-terminal-coding-system-internal", | 6710 DEFUN ("set-terminal-coding-system-internal", |
| 6711 Fset_terminal_coding_system_internal, | 6711 Fset_terminal_coding_system_internal, |
| 6712 Sset_terminal_coding_system_internal, 1, 1, 0, "") | 6712 Sset_terminal_coding_system_internal, 1, 1, 0, |
| 6713 (coding_system) | 6713 doc: /* Internal use only. */) |
| 6714 (coding_system) | |
| 6714 Lisp_Object coding_system; | 6715 Lisp_Object coding_system; |
| 6715 { | 6716 { |
| 6716 CHECK_SYMBOL (coding_system); | 6717 CHECK_SYMBOL (coding_system); |
| 6717 setup_coding_system (Fcheck_coding_system (coding_system), &terminal_coding); | 6718 setup_coding_system (Fcheck_coding_system (coding_system), &terminal_coding); |
| 6718 /* We had better not send unsafe characters to terminal. */ | 6719 /* We had better not send unsafe characters to terminal. */ |
| 6726 return Qnil; | 6727 return Qnil; |
| 6727 } | 6728 } |
| 6728 | 6729 |
| 6729 DEFUN ("set-safe-terminal-coding-system-internal", | 6730 DEFUN ("set-safe-terminal-coding-system-internal", |
| 6730 Fset_safe_terminal_coding_system_internal, | 6731 Fset_safe_terminal_coding_system_internal, |
| 6731 Sset_safe_terminal_coding_system_internal, 1, 1, 0, "") | 6732 Sset_safe_terminal_coding_system_internal, 1, 1, 0, |
| 6732 (coding_system) | 6733 doc: /* Internal use only. */) |
| 6734 (coding_system) | |
| 6733 Lisp_Object coding_system; | 6735 Lisp_Object coding_system; |
| 6734 { | 6736 { |
| 6735 CHECK_SYMBOL (coding_system); | 6737 CHECK_SYMBOL (coding_system); |
| 6736 setup_coding_system (Fcheck_coding_system (coding_system), | 6738 setup_coding_system (Fcheck_coding_system (coding_system), |
| 6737 &safe_terminal_coding); | 6739 &safe_terminal_coding); |
| 6744 return Qnil; | 6746 return Qnil; |
| 6745 } | 6747 } |
| 6746 | 6748 |
| 6747 DEFUN ("terminal-coding-system", | 6749 DEFUN ("terminal-coding-system", |
| 6748 Fterminal_coding_system, Sterminal_coding_system, 0, 0, 0, | 6750 Fterminal_coding_system, Sterminal_coding_system, 0, 0, 0, |
| 6749 "Return coding system specified for terminal output.") | 6751 doc: /* Return coding system specified for terminal output. */) |
| 6750 () | 6752 () |
| 6751 { | 6753 { |
| 6752 return terminal_coding.symbol; | 6754 return terminal_coding.symbol; |
| 6753 } | 6755 } |
| 6754 | 6756 |
| 6755 DEFUN ("set-keyboard-coding-system-internal", | 6757 DEFUN ("set-keyboard-coding-system-internal", |
| 6756 Fset_keyboard_coding_system_internal, | 6758 Fset_keyboard_coding_system_internal, |
| 6757 Sset_keyboard_coding_system_internal, 1, 1, 0, "") | 6759 Sset_keyboard_coding_system_internal, 1, 1, 0, |
| 6758 (coding_system) | 6760 doc: /* Internal use only. */) |
| 6761 (coding_system) | |
| 6759 Lisp_Object coding_system; | 6762 Lisp_Object coding_system; |
| 6760 { | 6763 { |
| 6761 CHECK_SYMBOL (coding_system); | 6764 CHECK_SYMBOL (coding_system); |
| 6762 setup_coding_system (Fcheck_coding_system (coding_system), &keyboard_coding); | 6765 setup_coding_system (Fcheck_coding_system (coding_system), &keyboard_coding); |
| 6763 /* Character composition should be disabled. */ | 6766 /* Character composition should be disabled. */ |
| 6765 return Qnil; | 6768 return Qnil; |
| 6766 } | 6769 } |
| 6767 | 6770 |
| 6768 DEFUN ("keyboard-coding-system", | 6771 DEFUN ("keyboard-coding-system", |
| 6769 Fkeyboard_coding_system, Skeyboard_coding_system, 0, 0, 0, | 6772 Fkeyboard_coding_system, Skeyboard_coding_system, 0, 0, 0, |
| 6770 "Return coding system specified for decoding keyboard input.") | 6773 doc: /* Return coding system specified for decoding keyboard input. */) |
| 6771 () | 6774 () |
| 6772 { | 6775 { |
| 6773 return keyboard_coding.symbol; | 6776 return keyboard_coding.symbol; |
| 6774 } | 6777 } |
| 6775 | 6778 |
| 6776 | 6779 |
| 6777 DEFUN ("find-operation-coding-system", Ffind_operation_coding_system, | 6780 DEFUN ("find-operation-coding-system", Ffind_operation_coding_system, |
| 6778 Sfind_operation_coding_system, 1, MANY, 0, | 6781 Sfind_operation_coding_system, 1, MANY, 0, |
| 6779 "Choose a coding system for an operation based on the target name.\n\ | 6782 doc: /* Choose a coding system for an operation based on the target name. |
| 6780 The value names a pair of coding systems: (DECODING-SYSTEM . ENCODING-SYSTEM).\n\ | 6783 The value names a pair of coding systems: (DECODING-SYSTEM . ENCODING-SYSTEM). |
| 6781 DECODING-SYSTEM is the coding system to use for decoding\n\ | 6784 DECODING-SYSTEM is the coding system to use for decoding |
| 6782 \(in case OPERATION does decoding), and ENCODING-SYSTEM is the coding system\n\ | 6785 \(in case OPERATION does decoding), and ENCODING-SYSTEM is the coding system |
| 6783 for encoding (in case OPERATION does encoding).\n\ | 6786 for encoding (in case OPERATION does encoding). |
| 6784 \n\ | 6787 |
| 6785 The first argument OPERATION specifies an I/O primitive:\n\ | 6788 The first argument OPERATION specifies an I/O primitive: |
| 6786 For file I/O, `insert-file-contents' or `write-region'.\n\ | 6789 For file I/O, `insert-file-contents' or `write-region'. |
| 6787 For process I/O, `call-process', `call-process-region', or `start-process'.\n\ | 6790 For process I/O, `call-process', `call-process-region', or `start-process'. |
| 6788 For network I/O, `open-network-stream'.\n\ | 6791 For network I/O, `open-network-stream'. |
| 6789 \n\ | 6792 |
| 6790 The remaining arguments should be the same arguments that were passed\n\ | 6793 The remaining arguments should be the same arguments that were passed |
| 6791 to the primitive. Depending on which primitive, one of those arguments\n\ | 6794 to the primitive. Depending on which primitive, one of those arguments |
| 6792 is selected as the TARGET. For example, if OPERATION does file I/O,\n\ | 6795 is selected as the TARGET. For example, if OPERATION does file I/O, |
| 6793 whichever argument specifies the file name is TARGET.\n\ | 6796 whichever argument specifies the file name is TARGET. |
| 6794 \n\ | 6797 |
| 6795 TARGET has a meaning which depends on OPERATION:\n\ | 6798 TARGET has a meaning which depends on OPERATION: |
| 6796 For file I/O, TARGET is a file name.\n\ | 6799 For file I/O, TARGET is a file name. |
| 6797 For process I/O, TARGET is a process name.\n\ | 6800 For process I/O, TARGET is a process name. |
| 6798 For network I/O, TARGET is a service name or a port number\n\ | 6801 For network I/O, TARGET is a service name or a port number |
| 6799 \n\ | 6802 |
| 6800 This function looks up what specified for TARGET in,\n\ | 6803 This function looks up what specified for TARGET in, |
| 6801 `file-coding-system-alist', `process-coding-system-alist',\n\ | 6804 `file-coding-system-alist', `process-coding-system-alist', |
| 6802 or `network-coding-system-alist' depending on OPERATION.\n\ | 6805 or `network-coding-system-alist' depending on OPERATION. |
| 6803 They may specify a coding system, a cons of coding systems,\n\ | 6806 They may specify a coding system, a cons of coding systems, |
| 6804 or a function symbol to call.\n\ | 6807 or a function symbol to call. |
| 6805 In the last case, we call the function with one argument,\n\ | 6808 In the last case, we call the function with one argument, |
| 6806 which is a list of all the arguments given to this function.\n\ | 6809 which is a list of all the arguments given to this function. |
| 6807 \n\ | 6810 |
| 6808 usage: (find-operation-coding-system OPERATION ARGUMENTS ...)") | 6811 usage: (find-operation-coding-system OPERATION ARGUMENTS ...) */) |
| 6809 (nargs, args) | 6812 (nargs, args) |
| 6810 int nargs; | 6813 int nargs; |
| 6811 Lisp_Object *args; | 6814 Lisp_Object *args; |
| 6812 { | 6815 { |
| 6813 Lisp_Object operation, target_idx, target, val; | 6816 Lisp_Object operation, target_idx, target, val; |
| 6814 register Lisp_Object chain; | 6817 register Lisp_Object chain; |
| 6870 return Qnil; | 6873 return Qnil; |
| 6871 } | 6874 } |
| 6872 | 6875 |
| 6873 DEFUN ("update-coding-systems-internal", Fupdate_coding_systems_internal, | 6876 DEFUN ("update-coding-systems-internal", Fupdate_coding_systems_internal, |
| 6874 Supdate_coding_systems_internal, 0, 0, 0, | 6877 Supdate_coding_systems_internal, 0, 0, 0, |
| 6875 "Update internal database for ISO2022 and CCL based coding systems.\n\ | 6878 doc: /* Update internal database for ISO2022 and CCL based coding systems. |
| 6876 When values of any coding categories are changed, you must\n\ | 6879 When values of any coding categories are changed, you must |
| 6877 call this function") | 6880 call this function. */) |
| 6878 () | 6881 () |
| 6879 { | 6882 { |
| 6880 int i; | 6883 int i; |
| 6881 | 6884 |
| 6882 for (i = CODING_CATEGORY_IDX_EMACS_MULE; i < CODING_CATEGORY_IDX_MAX; i++) | 6885 for (i = CODING_CATEGORY_IDX_EMACS_MULE; i < CODING_CATEGORY_IDX_MAX; i++) |
| 6883 { | 6886 { |
| 6901 return Qnil; | 6904 return Qnil; |
| 6902 } | 6905 } |
| 6903 | 6906 |
| 6904 DEFUN ("set-coding-priority-internal", Fset_coding_priority_internal, | 6907 DEFUN ("set-coding-priority-internal", Fset_coding_priority_internal, |
| 6905 Sset_coding_priority_internal, 0, 0, 0, | 6908 Sset_coding_priority_internal, 0, 0, 0, |
| 6906 "Update internal database for the current value of `coding-category-list'.\n\ | 6909 doc: /* Update internal database for the current value of `coding-category-list'. |
| 6907 This function is internal use only.") | 6910 This function is internal use only. */) |
| 6908 () | 6911 () |
| 6909 { | 6912 { |
| 6910 int i = 0, idx; | 6913 int i = 0, idx; |
| 6911 Lisp_Object val; | 6914 Lisp_Object val; |
| 6912 | 6915 |
| 6913 val = Vcoding_category_list; | 6916 val = Vcoding_category_list; |
| 7142 defsubr (&Sfind_operation_coding_system); | 7145 defsubr (&Sfind_operation_coding_system); |
| 7143 defsubr (&Supdate_coding_systems_internal); | 7146 defsubr (&Supdate_coding_systems_internal); |
| 7144 defsubr (&Sset_coding_priority_internal); | 7147 defsubr (&Sset_coding_priority_internal); |
| 7145 | 7148 |
| 7146 DEFVAR_LISP ("coding-system-list", &Vcoding_system_list, | 7149 DEFVAR_LISP ("coding-system-list", &Vcoding_system_list, |
| 7147 "List of coding systems.\n\ | 7150 doc: /* List of coding systems. |
| 7148 \n\ | 7151 |
| 7149 Do not alter the value of this variable manually. This variable should be\n\ | 7152 Do not alter the value of this variable manually. This variable should be |
| 7150 updated by the functions `make-coding-system' and\n\ | 7153 updated by the functions `make-coding-system' and |
| 7151 `define-coding-system-alias'."); | 7154 `define-coding-system-alias'. */); |
| 7152 Vcoding_system_list = Qnil; | 7155 Vcoding_system_list = Qnil; |
| 7153 | 7156 |
| 7154 DEFVAR_LISP ("coding-system-alist", &Vcoding_system_alist, | 7157 DEFVAR_LISP ("coding-system-alist", &Vcoding_system_alist, |
| 7155 "Alist of coding system names.\n\ | 7158 doc: /* Alist of coding system names. |
| 7156 Each element is one element list of coding system name.\n\ | 7159 Each element is one element list of coding system name. |
| 7157 This variable is given to `completing-read' as TABLE argument.\n\ | 7160 This variable is given to `completing-read' as TABLE argument. |
| 7158 \n\ | 7161 |
| 7159 Do not alter the value of this variable manually. This variable should be\n\ | 7162 Do not alter the value of this variable manually. This variable should be |
| 7160 updated by the functions `make-coding-system' and\n\ | 7163 updated by the functions `make-coding-system' and |
| 7161 `define-coding-system-alias'."); | 7164 `define-coding-system-alias'. */); |
| 7162 Vcoding_system_alist = Qnil; | 7165 Vcoding_system_alist = Qnil; |
| 7163 | 7166 |
| 7164 DEFVAR_LISP ("coding-category-list", &Vcoding_category_list, | 7167 DEFVAR_LISP ("coding-category-list", &Vcoding_category_list, |
| 7165 "List of coding-categories (symbols) ordered by priority.\n\ | 7168 doc: /* List of coding-categories (symbols) ordered by priority. |
| 7166 \n\ | 7169 |
| 7167 On detecting a coding system, Emacs tries code detection algorithms\n\ | 7170 On detecting a coding system, Emacs tries code detection algorithms |
| 7168 associated with each coding-category one by one in this order. When\n\ | 7171 associated with each coding-category one by one in this order. When |
| 7169 one algorithm agrees with a byte sequence of source text, the coding\n\ | 7172 one algorithm agrees with a byte sequence of source text, the coding |
| 7170 system bound to the corresponding coding-category is selected."); | 7173 system bound to the corresponding coding-category is selected. */); |
| 7171 { | 7174 { |
| 7172 int i; | 7175 int i; |
| 7173 | 7176 |
| 7174 Vcoding_category_list = Qnil; | 7177 Vcoding_category_list = Qnil; |
| 7175 for (i = CODING_CATEGORY_IDX_MAX - 1; i >= 0; i--) | 7178 for (i = CODING_CATEGORY_IDX_MAX - 1; i >= 0; i--) |
| 7177 = Fcons (XVECTOR (Vcoding_category_table)->contents[i], | 7180 = Fcons (XVECTOR (Vcoding_category_table)->contents[i], |
| 7178 Vcoding_category_list); | 7181 Vcoding_category_list); |
| 7179 } | 7182 } |
| 7180 | 7183 |
| 7181 DEFVAR_LISP ("coding-system-for-read", &Vcoding_system_for_read, | 7184 DEFVAR_LISP ("coding-system-for-read", &Vcoding_system_for_read, |
| 7182 "Specify the coding system for read operations.\n\ | 7185 doc: /* Specify the coding system for read operations. |
| 7183 It is useful to bind this variable with `let', but do not set it globally.\n\ | 7186 It is useful to bind this variable with `let', but do not set it globally. |
| 7184 If the value is a coding system, it is used for decoding on read operation.\n\ | 7187 If the value is a coding system, it is used for decoding on read operation. |
| 7185 If not, an appropriate element is used from one of the coding system alists:\n\ | 7188 If not, an appropriate element is used from one of the coding system alists: |
| 7186 There are three such tables, `file-coding-system-alist',\n\ | 7189 There are three such tables, `file-coding-system-alist', |
| 7187 `process-coding-system-alist', and `network-coding-system-alist'."); | 7190 `process-coding-system-alist', and `network-coding-system-alist'. */); |
| 7188 Vcoding_system_for_read = Qnil; | 7191 Vcoding_system_for_read = Qnil; |
| 7189 | 7192 |
| 7190 DEFVAR_LISP ("coding-system-for-write", &Vcoding_system_for_write, | 7193 DEFVAR_LISP ("coding-system-for-write", &Vcoding_system_for_write, |
| 7191 "Specify the coding system for write operations.\n\ | 7194 doc: /* Specify the coding system for write operations. |
| 7192 Programs bind this variable with `let', but you should not set it globally.\n\ | 7195 Programs bind this variable with `let', but you should not set it globally. |
| 7193 If the value is a coding system, it is used for encoding of output,\n\ | 7196 If the value is a coding system, it is used for encoding of output, |
| 7194 when writing it to a file and when sending it to a file or subprocess.\n\ | 7197 when writing it to a file and when sending it to a file or subprocess. |
| 7195 \n\ | 7198 |
| 7196 If this does not specify a coding system, an appropriate element\n\ | 7199 If this does not specify a coding system, an appropriate element |
| 7197 is used from one of the coding system alists:\n\ | 7200 is used from one of the coding system alists: |
| 7198 There are three such tables, `file-coding-system-alist',\n\ | 7201 There are three such tables, `file-coding-system-alist', |
| 7199 `process-coding-system-alist', and `network-coding-system-alist'.\n\ | 7202 `process-coding-system-alist', and `network-coding-system-alist'. |
| 7200 For output to files, if the above procedure does not specify a coding system,\n\ | 7203 For output to files, if the above procedure does not specify a coding system, |
| 7201 the value of `buffer-file-coding-system' is used."); | 7204 the value of `buffer-file-coding-system' is used. */); |
| 7202 Vcoding_system_for_write = Qnil; | 7205 Vcoding_system_for_write = Qnil; |
| 7203 | 7206 |
| 7204 DEFVAR_LISP ("last-coding-system-used", &Vlast_coding_system_used, | 7207 DEFVAR_LISP ("last-coding-system-used", &Vlast_coding_system_used, |
| 7205 "Coding system used in the latest file or process I/O."); | 7208 doc: /* Coding system used in the latest file or process I/O. */); |
| 7206 Vlast_coding_system_used = Qnil; | 7209 Vlast_coding_system_used = Qnil; |
| 7207 | 7210 |
| 7208 DEFVAR_BOOL ("inhibit-eol-conversion", &inhibit_eol_conversion, | 7211 DEFVAR_BOOL ("inhibit-eol-conversion", &inhibit_eol_conversion, |
| 7209 "*Non-nil means always inhibit code conversion of end-of-line format.\n\ | 7212 doc: /* *Non-nil means always inhibit code conversion of end-of-line format. |
| 7210 See info node `Coding Systems' and info node `Text and Binary' concerning\n\ | 7213 See info node `Coding Systems' and info node `Text and Binary' concerning |
| 7211 such conversion."); | 7214 such conversion. */); |
| 7212 inhibit_eol_conversion = 0; | 7215 inhibit_eol_conversion = 0; |
| 7213 | 7216 |
| 7214 DEFVAR_BOOL ("inherit-process-coding-system", &inherit_process_coding_system, | 7217 DEFVAR_BOOL ("inherit-process-coding-system", &inherit_process_coding_system, |
| 7215 "Non-nil means process buffer inherits coding system of process output.\n\ | 7218 doc: /* Non-nil means process buffer inherits coding system of process output. |
| 7216 Bind it to t if the process output is to be treated as if it were a file\n\ | 7219 Bind it to t if the process output is to be treated as if it were a file |
| 7217 read from some filesystem."); | 7220 read from some filesystem. */); |
| 7218 inherit_process_coding_system = 0; | 7221 inherit_process_coding_system = 0; |
| 7219 | 7222 |
| 7220 DEFVAR_LISP ("file-coding-system-alist", &Vfile_coding_system_alist, | 7223 DEFVAR_LISP ("file-coding-system-alist", &Vfile_coding_system_alist, |
| 7221 "Alist to decide a coding system to use for a file I/O operation.\n\ | 7224 doc: /* Alist to decide a coding system to use for a file I/O operation. |
| 7222 The format is ((PATTERN . VAL) ...),\n\ | 7225 The format is ((PATTERN . VAL) ...), |
| 7223 where PATTERN is a regular expression matching a file name,\n\ | 7226 where PATTERN is a regular expression matching a file name, |
| 7224 VAL is a coding system, a cons of coding systems, or a function symbol.\n\ | 7227 VAL is a coding system, a cons of coding systems, or a function symbol. |
| 7225 If VAL is a coding system, it is used for both decoding and encoding\n\ | 7228 If VAL is a coding system, it is used for both decoding and encoding |
| 7226 the file contents.\n\ | 7229 the file contents. |
| 7227 If VAL is a cons of coding systems, the car part is used for decoding,\n\ | 7230 If VAL is a cons of coding systems, the car part is used for decoding, |
| 7228 and the cdr part is used for encoding.\n\ | 7231 and the cdr part is used for encoding. |
| 7229 If VAL is a function symbol, the function must return a coding system\n\ | 7232 If VAL is a function symbol, the function must return a coding system |
| 7230 or a cons of coding systems which are used as above.\n\ | 7233 or a cons of coding systems which are used as above. |
| 7231 \n\ | 7234 |
| 7232 See also the function `find-operation-coding-system'\n\ | 7235 See also the function `find-operation-coding-system' |
| 7233 and the variable `auto-coding-alist'."); | 7236 and the variable `auto-coding-alist'. */); |
| 7234 Vfile_coding_system_alist = Qnil; | 7237 Vfile_coding_system_alist = Qnil; |
| 7235 | 7238 |
| 7236 DEFVAR_LISP ("process-coding-system-alist", &Vprocess_coding_system_alist, | 7239 DEFVAR_LISP ("process-coding-system-alist", &Vprocess_coding_system_alist, |
| 7237 "Alist to decide a coding system to use for a process I/O operation.\n\ | 7240 doc: /* Alist to decide a coding system to use for a process I/O operation. |
| 7238 The format is ((PATTERN . VAL) ...),\n\ | 7241 The format is ((PATTERN . VAL) ...), |
| 7239 where PATTERN is a regular expression matching a program name,\n\ | 7242 where PATTERN is a regular expression matching a program name, |
| 7240 VAL is a coding system, a cons of coding systems, or a function symbol.\n\ | 7243 VAL is a coding system, a cons of coding systems, or a function symbol. |
| 7241 If VAL is a coding system, it is used for both decoding what received\n\ | 7244 If VAL is a coding system, it is used for both decoding what received |
| 7242 from the program and encoding what sent to the program.\n\ | 7245 from the program and encoding what sent to the program. |
| 7243 If VAL is a cons of coding systems, the car part is used for decoding,\n\ | 7246 If VAL is a cons of coding systems, the car part is used for decoding, |
| 7244 and the cdr part is used for encoding.\n\ | 7247 and the cdr part is used for encoding. |
| 7245 If VAL is a function symbol, the function must return a coding system\n\ | 7248 If VAL is a function symbol, the function must return a coding system |
| 7246 or a cons of coding systems which are used as above.\n\ | 7249 or a cons of coding systems which are used as above. |
| 7247 \n\ | 7250 |
| 7248 See also the function `find-operation-coding-system'."); | 7251 See also the function `find-operation-coding-system'. */); |
| 7249 Vprocess_coding_system_alist = Qnil; | 7252 Vprocess_coding_system_alist = Qnil; |
| 7250 | 7253 |
| 7251 DEFVAR_LISP ("network-coding-system-alist", &Vnetwork_coding_system_alist, | 7254 DEFVAR_LISP ("network-coding-system-alist", &Vnetwork_coding_system_alist, |
| 7252 "Alist to decide a coding system to use for a network I/O operation.\n\ | 7255 doc: /* Alist to decide a coding system to use for a network I/O operation. |
| 7253 The format is ((PATTERN . VAL) ...),\n\ | 7256 The format is ((PATTERN . VAL) ...), |
| 7254 where PATTERN is a regular expression matching a network service name\n\ | 7257 where PATTERN is a regular expression matching a network service name |
| 7255 or is a port number to connect to,\n\ | 7258 or is a port number to connect to, |
| 7256 VAL is a coding system, a cons of coding systems, or a function symbol.\n\ | 7259 VAL is a coding system, a cons of coding systems, or a function symbol. |
| 7257 If VAL is a coding system, it is used for both decoding what received\n\ | 7260 If VAL is a coding system, it is used for both decoding what received |
| 7258 from the network stream and encoding what sent to the network stream.\n\ | 7261 from the network stream and encoding what sent to the network stream. |
| 7259 If VAL is a cons of coding systems, the car part is used for decoding,\n\ | 7262 If VAL is a cons of coding systems, the car part is used for decoding, |
| 7260 and the cdr part is used for encoding.\n\ | 7263 and the cdr part is used for encoding. |
| 7261 If VAL is a function symbol, the function must return a coding system\n\ | 7264 If VAL is a function symbol, the function must return a coding system |
| 7262 or a cons of coding systems which are used as above.\n\ | 7265 or a cons of coding systems which are used as above. |
| 7263 \n\ | 7266 |
| 7264 See also the function `find-operation-coding-system'."); | 7267 See also the function `find-operation-coding-system'. */); |
| 7265 Vnetwork_coding_system_alist = Qnil; | 7268 Vnetwork_coding_system_alist = Qnil; |
| 7266 | 7269 |
| 7267 DEFVAR_LISP ("locale-coding-system", &Vlocale_coding_system, | 7270 DEFVAR_LISP ("locale-coding-system", &Vlocale_coding_system, |
| 7268 "Coding system to use with system messages. Also used for decoding\n\ | 7271 doc: /* Coding system to use with system messages. Also used for decoding |
| 7269 keyboard input on X Window system."); | 7272 keyboard input on X Window system. */); |
| 7270 Vlocale_coding_system = Qnil; | 7273 Vlocale_coding_system = Qnil; |
| 7271 | 7274 |
| 7272 /* The eol mnemonics are reset in startup.el system-dependently. */ | 7275 /* The eol mnemonics are reset in startup.el system-dependently. */ |
| 7273 DEFVAR_LISP ("eol-mnemonic-unix", &eol_mnemonic_unix, | 7276 DEFVAR_LISP ("eol-mnemonic-unix", &eol_mnemonic_unix, |
| 7274 "*String displayed in mode line for UNIX-like (LF) end-of-line format."); | 7277 doc: /* *String displayed in mode line for UNIX-like (LF) end-of-line format. */); |
| 7275 eol_mnemonic_unix = build_string (":"); | 7278 eol_mnemonic_unix = build_string (":"); |
| 7276 | 7279 |
| 7277 DEFVAR_LISP ("eol-mnemonic-dos", &eol_mnemonic_dos, | 7280 DEFVAR_LISP ("eol-mnemonic-dos", &eol_mnemonic_dos, |
| 7278 "*String displayed in mode line for DOS-like (CRLF) end-of-line format."); | 7281 doc: /* *String displayed in mode line for DOS-like (CRLF) end-of-line format. */); |
| 7279 eol_mnemonic_dos = build_string ("\\"); | 7282 eol_mnemonic_dos = build_string ("\\"); |
| 7280 | 7283 |
| 7281 DEFVAR_LISP ("eol-mnemonic-mac", &eol_mnemonic_mac, | 7284 DEFVAR_LISP ("eol-mnemonic-mac", &eol_mnemonic_mac, |
| 7282 "*String displayed in mode line for MAC-like (CR) end-of-line format."); | 7285 doc: /* *String displayed in mode line for MAC-like (CR) end-of-line format. */); |
| 7283 eol_mnemonic_mac = build_string ("/"); | 7286 eol_mnemonic_mac = build_string ("/"); |
| 7284 | 7287 |
| 7285 DEFVAR_LISP ("eol-mnemonic-undecided", &eol_mnemonic_undecided, | 7288 DEFVAR_LISP ("eol-mnemonic-undecided", &eol_mnemonic_undecided, |
| 7286 "*String displayed in mode line when end-of-line format is not yet determined."); | 7289 doc: /* *String displayed in mode line when end-of-line format is not yet determined. */); |
| 7287 eol_mnemonic_undecided = build_string (":"); | 7290 eol_mnemonic_undecided = build_string (":"); |
| 7288 | 7291 |
| 7289 DEFVAR_LISP ("enable-character-translation", &Venable_character_translation, | 7292 DEFVAR_LISP ("enable-character-translation", &Venable_character_translation, |
| 7290 "*Non-nil enables character translation while encoding and decoding."); | 7293 doc: /* *Non-nil enables character translation while encoding and decoding. */); |
| 7291 Venable_character_translation = Qt; | 7294 Venable_character_translation = Qt; |
| 7292 | 7295 |
| 7293 DEFVAR_LISP ("standard-translation-table-for-decode", | 7296 DEFVAR_LISP ("standard-translation-table-for-decode", |
| 7294 &Vstandard_translation_table_for_decode, | 7297 &Vstandard_translation_table_for_decode, |
| 7295 "Table for translating characters while decoding."); | 7298 doc: /* Table for translating characters while decoding. */); |
| 7296 Vstandard_translation_table_for_decode = Qnil; | 7299 Vstandard_translation_table_for_decode = Qnil; |
| 7297 | 7300 |
| 7298 DEFVAR_LISP ("standard-translation-table-for-encode", | 7301 DEFVAR_LISP ("standard-translation-table-for-encode", |
| 7299 &Vstandard_translation_table_for_encode, | 7302 &Vstandard_translation_table_for_encode, |
| 7300 "Table for translating characters while encoding."); | 7303 doc: /* Table for translating characters while encoding. */); |
| 7301 Vstandard_translation_table_for_encode = Qnil; | 7304 Vstandard_translation_table_for_encode = Qnil; |
| 7302 | 7305 |
| 7303 DEFVAR_LISP ("charset-revision-table", &Vcharset_revision_alist, | 7306 DEFVAR_LISP ("charset-revision-table", &Vcharset_revision_alist, |
| 7304 "Alist of charsets vs revision numbers.\n\ | 7307 doc: /* Alist of charsets vs revision numbers. |
| 7305 While encoding, if a charset (car part of an element) is found,\n\ | 7308 While encoding, if a charset (car part of an element) is found, |
| 7306 designate it with the escape sequence identifying revision (cdr part of the element)."); | 7309 designate it with the escape sequence identifying revision (cdr part of the element). */); |
| 7307 Vcharset_revision_alist = Qnil; | 7310 Vcharset_revision_alist = Qnil; |
| 7308 | 7311 |
| 7309 DEFVAR_LISP ("default-process-coding-system", | 7312 DEFVAR_LISP ("default-process-coding-system", |
| 7310 &Vdefault_process_coding_system, | 7313 &Vdefault_process_coding_system, |
| 7311 "Cons of coding systems used for process I/O by default.\n\ | 7314 doc: /* Cons of coding systems used for process I/O by default. |
| 7312 The car part is used for decoding a process output,\n\ | 7315 The car part is used for decoding a process output, |
| 7313 the cdr part is used for encoding a text to be sent to a process."); | 7316 the cdr part is used for encoding a text to be sent to a process. */); |
| 7314 Vdefault_process_coding_system = Qnil; | 7317 Vdefault_process_coding_system = Qnil; |
| 7315 | 7318 |
| 7316 DEFVAR_LISP ("latin-extra-code-table", &Vlatin_extra_code_table, | 7319 DEFVAR_LISP ("latin-extra-code-table", &Vlatin_extra_code_table, |
| 7317 "Table of extra Latin codes in the range 128..159 (inclusive).\n\ | 7320 doc: /* Table of extra Latin codes in the range 128..159 (inclusive). |
| 7318 This is a vector of length 256.\n\ | 7321 This is a vector of length 256. |
| 7319 If Nth element is non-nil, the existence of code N in a file\n\ | 7322 If Nth element is non-nil, the existence of code N in a file |
| 7320 \(or output of subprocess) doesn't prevent it to be detected as\n\ | 7323 \(or output of subprocess) doesn't prevent it to be detected as |
| 7321 a coding system of ISO 2022 variant which has a flag\n\ | 7324 a coding system of ISO 2022 variant which has a flag |
| 7322 `accept-latin-extra-code' t (e.g. iso-latin-1) on reading a file\n\ | 7325 `accept-latin-extra-code' t (e.g. iso-latin-1) on reading a file |
| 7323 or reading output of a subprocess.\n\ | 7326 or reading output of a subprocess. |
| 7324 Only 128th through 159th elements has a meaning."); | 7327 Only 128th through 159th elements has a meaning. */); |
| 7325 Vlatin_extra_code_table = Fmake_vector (make_number (256), Qnil); | 7328 Vlatin_extra_code_table = Fmake_vector (make_number (256), Qnil); |
| 7326 | 7329 |
| 7327 DEFVAR_LISP ("select-safe-coding-system-function", | 7330 DEFVAR_LISP ("select-safe-coding-system-function", |
| 7328 &Vselect_safe_coding_system_function, | 7331 &Vselect_safe_coding_system_function, |
| 7329 "Function to call to select safe coding system for encoding a text.\n\ | 7332 doc: /* Function to call to select safe coding system for encoding a text. |
| 7330 \n\ | 7333 |
| 7331 If set, this function is called to force a user to select a proper\n\ | 7334 If set, this function is called to force a user to select a proper |
| 7332 coding system which can encode the text in the case that a default\n\ | 7335 coding system which can encode the text in the case that a default |
| 7333 coding system used in each operation can't encode the text.\n\ | 7336 coding system used in each operation can't encode the text. |
| 7334 \n\ | 7337 |
| 7335 The default value is `select-safe-coding-system' (which see)."); | 7338 The default value is `select-safe-coding-system' (which see). */); |
| 7336 Vselect_safe_coding_system_function = Qnil; | 7339 Vselect_safe_coding_system_function = Qnil; |
| 7337 | 7340 |
| 7338 DEFVAR_LISP ("char-coding-system-table", &Vchar_coding_system_table, | 7341 DEFVAR_LISP ("char-coding-system-table", &Vchar_coding_system_table, |
| 7339 "Char-table containing safe coding systems of each characters.\n\ | 7342 doc: /* Char-table containing safe coding systems of each characters. |
| 7340 Each element doesn't include such generic coding systems that can\n\ | 7343 Each element doesn't include such generic coding systems that can |
| 7341 encode any characters. They are in the first extra slot."); | 7344 encode any characters. They are in the first extra slot. */); |
| 7342 Vchar_coding_system_table = Fmake_char_table (Qchar_coding_system, Qnil); | 7345 Vchar_coding_system_table = Fmake_char_table (Qchar_coding_system, Qnil); |
| 7343 | 7346 |
| 7344 DEFVAR_BOOL ("inhibit-iso-escape-detection", | 7347 DEFVAR_BOOL ("inhibit-iso-escape-detection", |
| 7345 &inhibit_iso_escape_detection, | 7348 &inhibit_iso_escape_detection, |
| 7346 "If non-nil, Emacs ignores ISO2022's escape sequence on code detection.\n\ | 7349 doc: /* If non-nil, Emacs ignores ISO2022's escape sequence on code detection. |
| 7347 \n\ | 7350 |
| 7348 By default, on reading a file, Emacs tries to detect how the text is\n\ | 7351 By default, on reading a file, Emacs tries to detect how the text is |
| 7349 encoded. This code detection is sensitive to escape sequences. If\n\ | 7352 encoded. This code detection is sensitive to escape sequences. If |
| 7350 the sequence is valid as ISO2022, the code is determined as one of\n\ | 7353 the sequence is valid as ISO2022, the code is determined as one of |
| 7351 the ISO2022 encodings, and the file is decoded by the corresponding\n\ | 7354 the ISO2022 encodings, and the file is decoded by the corresponding |
| 7352 coding system (e.g. `iso-2022-7bit').\n\ | 7355 coding system (e.g. `iso-2022-7bit'). |
| 7353 \n\ | 7356 |
| 7354 However, there may be a case that you want to read escape sequences in\n\ | 7357 However, there may be a case that you want to read escape sequences in |
| 7355 a file as is. In such a case, you can set this variable to non-nil.\n\ | 7358 a file as is. In such a case, you can set this variable to non-nil. |
| 7356 Then, as the code detection ignores any escape sequences, no file is\n\ | 7359 Then, as the code detection ignores any escape sequences, no file is |
| 7357 detected as encoded in some ISO2022 encoding. The result is that all\n\ | 7360 detected as encoded in some ISO2022 encoding. The result is that all |
| 7358 escape sequences become visible in a buffer.\n\ | 7361 escape sequences become visible in a buffer. |
| 7359 \n\ | 7362 |
| 7360 The default value is nil, and it is strongly recommended not to change\n\ | 7363 The default value is nil, and it is strongly recommended not to change |
| 7361 it. That is because many Emacs Lisp source files that contain\n\ | 7364 it. That is because many Emacs Lisp source files that contain |
| 7362 non-ASCII characters are encoded by the coding system `iso-2022-7bit'\n\ | 7365 non-ASCII characters are encoded by the coding system `iso-2022-7bit' |
| 7363 in Emacs's distribution, and they won't be decoded correctly on\n\ | 7366 in Emacs's distribution, and they won't be decoded correctly on |
| 7364 reading if you suppress escape sequence detection.\n\ | 7367 reading if you suppress escape sequence detection. |
| 7365 \n\ | 7368 |
| 7366 The other way to read escape sequences in a file without decoding is\n\ | 7369 The other way to read escape sequences in a file without decoding is |
| 7367 to explicitly specify some coding system that doesn't use ISO2022's\n\ | 7370 to explicitly specify some coding system that doesn't use ISO2022's |
| 7368 escape sequence (e.g `latin-1') on reading by \\[universal-coding-system-argument]."); | 7371 escape sequence (e.g `latin-1') on reading by \\[universal-coding-system-argument]. */); |
| 7369 inhibit_iso_escape_detection = 0; | 7372 inhibit_iso_escape_detection = 0; |
| 7370 } | 7373 } |
| 7371 | 7374 |
| 7372 char * | 7375 char * |
| 7373 emacs_strerror (error_number) | 7376 emacs_strerror (error_number) |
