aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c531
1 files changed, 267 insertions, 264 deletions
diff --git a/src/coding.c b/src/coding.c
index e94a65006cc..f5122429553 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -6092,10 +6092,10 @@ encode_coding_string (str, coding, nocopy)
6092/*** 8. Emacs Lisp library functions ***/ 6092/*** 8. Emacs Lisp library functions ***/
6093 6093
6094DEFUN ("coding-system-p", Fcoding_system_p, Scoding_system_p, 1, 1, 0, 6094DEFUN ("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.
6096See the documentation of `make-coding-system' for information\n\ 6096See the documentation of `make-coding-system' for information
6097about coding-system objects.") 6097about 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))
@@ -6110,8 +6110,8 @@ about coding-system objects.")
6110 6110
6111DEFUN ("read-non-nil-coding-system", Fread_non_nil_coding_system, 6111DEFUN ("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;
@@ -6125,9 +6125,9 @@ DEFUN ("read-non-nil-coding-system", Fread_non_nil_coding_system,
6125} 6125}
6126 6126
6127DEFUN ("read-coding-system", Fread_coding_system, Sread_coding_system, 1, 2, 0, 6127DEFUN ("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.
6129If the user enters null input, return second argument DEFAULT-CODING-SYSTEM.") 6129If 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;
@@ -6141,11 +6141,11 @@ If the user enters null input, return second argument DEFAULT-CODING-SYSTEM.")
6141 6141
6142DEFUN ("check-coding-system", Fcheck_coding_system, Scheck_coding_system, 6142DEFUN ("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.
6145If valid, return CODING-SYSTEM, else signal a `coding-system-error' error.\n\ 6145If valid, return CODING-SYSTEM, else signal a `coding-system-error' error.
6146It is valid if it is a symbol with a non-nil `coding-system' property.\n\ 6146It is valid if it is a symbol with a non-nil `coding-system' property.
6147The value of property should be a vector of length 5.") 6147The 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);
@@ -6220,16 +6220,16 @@ detect_coding_system (src, src_bytes, highest, multibytep)
6220 6220
6221DEFUN ("detect-coding-region", Fdetect_coding_region, Sdetect_coding_region, 6221DEFUN ("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.
6224Return a list of possible coding systems ordered by priority.\n\ 6224Return a list of possible coding systems ordered by priority.
6225\n\ 6225
6226If only ASCII characters are found, it returns a list of single element\n\ 6226If 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
6228end-of-line format.\n\ 6228end-of-line format.
6229\n\ 6229
6230If optional argument HIGHEST is non-nil, return the coding system of\n\ 6230If optional argument HIGHEST is non-nil, return the coding system of
6231highest priority.") 6231highest 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;
@@ -6264,16 +6264,16 @@ highest priority.")
6264 6264
6265DEFUN ("detect-coding-string", Fdetect_coding_string, Sdetect_coding_string, 6265DEFUN ("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.
6268Return a list of possible coding systems ordered by priority.\n\ 6268Return a list of possible coding systems ordered by priority.
6269\n\ 6269
6270If only ASCII characters are found, it returns a list of single element\n\ 6270If 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
6272end-of-line format.\n\ 6272end-of-line format.
6273\n\ 6273
6274If optional argument HIGHEST is non-nil, return the coding system of\n\ 6274If optional argument HIGHEST is non-nil, return the coding system of
6275highest priority.") 6275highest 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);
@@ -6364,8 +6364,8 @@ find_safe_codings (p, pend, safe_codings, work_table, single_byte_char_found)
6364DEFUN ("find-coding-systems-region-internal", 6364DEFUN ("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;
@@ -6478,14 +6478,14 @@ code_convert_region1 (start, end, coding_system, encodep)
6478 6478
6479DEFUN ("decode-coding-region", Fdecode_coding_region, Sdecode_coding_region, 6479DEFUN ("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.
6482When called from a program, takes three arguments:\n\ 6482When called from a program, takes three arguments:
6483START, END, and CODING-SYSTEM. START and END are buffer positions.\n\ 6483START, END, and CODING-SYSTEM. START and END are buffer positions.
6484This function sets `last-coding-system-used' to the precise coding system\n\ 6484This function sets `last-coding-system-used' to the precise coding system
6485used (which may be different from CODING-SYSTEM if CODING-SYSTEM is\n\ 6485used (which may be different from CODING-SYSTEM if CODING-SYSTEM is
6486not fully specified.)\n\ 6486not fully specified.)
6487It returns the length of the decoded text.") 6487It 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);
@@ -6493,14 +6493,14 @@ It returns the length of the decoded text.")
6493 6493
6494DEFUN ("encode-coding-region", Fencode_coding_region, Sencode_coding_region, 6494DEFUN ("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.
6497When called from a program, takes three arguments:\n\ 6497When called from a program, takes three arguments:
6498START, END, and CODING-SYSTEM. START and END are buffer positions.\n\ 6498START, END, and CODING-SYSTEM. START and END are buffer positions.
6499This function sets `last-coding-system-used' to the precise coding system\n\ 6499This function sets `last-coding-system-used' to the precise coding system
6500used (which may be different from CODING-SYSTEM if CODING-SYSTEM is\n\ 6500used (which may be different from CODING-SYSTEM if CODING-SYSTEM is
6501not fully specified.)\n\ 6501not fully specified.)
6502It returns the length of the encoded text.") 6502It 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);
@@ -6533,13 +6533,13 @@ code_convert_string1 (string, coding_system, nocopy, encodep)
6533 6533
6534DEFUN ("decode-coding-string", Fdecode_coding_string, Sdecode_coding_string, 6534DEFUN ("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.
6537Optional arg NOCOPY non-nil means it is OK to return STRING itself\n\ 6537Optional arg NOCOPY non-nil means it is OK to return STRING itself
6538if the decoding operation is trivial.\n\ 6538if the decoding operation is trivial.
6539This function sets `last-coding-system-used' to the precise coding system\n\ 6539This function sets `last-coding-system-used' to the precise coding system
6540used (which may be different from CODING-SYSTEM if CODING-SYSTEM is\n\ 6540used (which may be different from CODING-SYSTEM if CODING-SYSTEM is
6541not fully specified.)") 6541not 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);
@@ -6547,13 +6547,13 @@ not fully specified.)")
6547 6547
6548DEFUN ("encode-coding-string", Fencode_coding_string, Sencode_coding_string, 6548DEFUN ("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.
6551Optional arg NOCOPY non-nil means it is OK to return STRING itself\n\ 6551Optional arg NOCOPY non-nil means it is OK to return STRING itself
6552if the encoding operation is trivial.\n\ 6552if the encoding operation is trivial.
6553This function sets `last-coding-system-used' to the precise coding system\n\ 6553This function sets `last-coding-system-used' to the precise coding system
6554used (which may be different from CODING-SYSTEM if CODING-SYSTEM is\n\ 6554used (which may be different from CODING-SYSTEM if CODING-SYSTEM is
6555not fully specified.)") 6555not 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);
@@ -6589,9 +6589,9 @@ code_convert_string_norecord (string, coding_system, encodep)
6589} 6589}
6590 6590
6591DEFUN ("decode-sjis-char", Fdecode_sjis_char, Sdecode_sjis_char, 1, 1, 0, 6591DEFUN ("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.
6593Return the corresponding character.") 6593Return 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;
@@ -6620,9 +6620,9 @@ Return the corresponding character.")
6620} 6620}
6621 6621
6622DEFUN ("encode-sjis-char", Fencode_sjis_char, Sencode_sjis_char, 1, 1, 0, 6622DEFUN ("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.
6624Return the corresponding code in SJIS.") 6624Return 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;
@@ -6651,9 +6651,9 @@ Return the corresponding code in SJIS.")
6651} 6651}
6652 6652
6653DEFUN ("decode-big5-char", Fdecode_big5_char, Sdecode_big5_char, 1, 1, 0, 6653DEFUN ("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.
6655Return the corresponding character.") 6655Return the corresponding character. */)
6656 (code) 6656 (code)
6657 Lisp_Object code; 6657 Lisp_Object code;
6658{ 6658{
6659 int charset; 6659 int charset;
@@ -6680,9 +6680,9 @@ Return the corresponding character.")
6680} 6680}
6681 6681
6682DEFUN ("encode-big5-char", Fencode_big5_char, Sencode_big5_char, 1, 1, 0, 6682DEFUN ("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.
6684Return the corresponding character code in Big5.") 6684Return 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;
@@ -6709,8 +6709,9 @@ Return the corresponding character code in Big5.")
6709 6709
6710DEFUN ("set-terminal-coding-system-internal", 6710DEFUN ("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);
@@ -6728,8 +6729,9 @@ DEFUN ("set-terminal-coding-system-internal",
6728 6729
6729DEFUN ("set-safe-terminal-coding-system-internal", 6730DEFUN ("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);
@@ -6746,16 +6748,17 @@ DEFUN ("set-safe-terminal-coding-system-internal",
6746 6748
6747DEFUN ("terminal-coding-system", 6749DEFUN ("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
6755DEFUN ("set-keyboard-coding-system-internal", 6757DEFUN ("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);
@@ -6767,8 +6770,8 @@ DEFUN ("set-keyboard-coding-system-internal",
6767 6770
6768DEFUN ("keyboard-coding-system", 6771DEFUN ("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}
@@ -6776,37 +6779,37 @@ DEFUN ("keyboard-coding-system",
6776 6779
6777DEFUN ("find-operation-coding-system", Ffind_operation_coding_system, 6780DEFUN ("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.
6780The value names a pair of coding systems: (DECODING-SYSTEM . ENCODING-SYSTEM).\n\ 6783The value names a pair of coding systems: (DECODING-SYSTEM . ENCODING-SYSTEM).
6781DECODING-SYSTEM is the coding system to use for decoding\n\ 6784DECODING-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
6783for encoding (in case OPERATION does encoding).\n\ 6786for encoding (in case OPERATION does encoding).
6784\n\ 6787
6785The first argument OPERATION specifies an I/O primitive:\n\ 6788The 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
6790The remaining arguments should be the same arguments that were passed\n\ 6793The remaining arguments should be the same arguments that were passed
6791to the primitive. Depending on which primitive, one of those arguments\n\ 6794to the primitive. Depending on which primitive, one of those arguments
6792is selected as the TARGET. For example, if OPERATION does file I/O,\n\ 6795is selected as the TARGET. For example, if OPERATION does file I/O,
6793whichever argument specifies the file name is TARGET.\n\ 6796whichever argument specifies the file name is TARGET.
6794\n\ 6797
6795TARGET has a meaning which depends on OPERATION:\n\ 6798TARGET 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
6800This function looks up what specified for TARGET in,\n\ 6803This 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',
6802or `network-coding-system-alist' depending on OPERATION.\n\ 6805or `network-coding-system-alist' depending on OPERATION.
6803They may specify a coding system, a cons of coding systems,\n\ 6806They may specify a coding system, a cons of coding systems,
6804or a function symbol to call.\n\ 6807or a function symbol to call.
6805In the last case, we call the function with one argument,\n\ 6808In the last case, we call the function with one argument,
6806which is a list of all the arguments given to this function.\n\ 6809which is a list of all the arguments given to this function.
6807\n\ 6810
6808usage: (find-operation-coding-system OPERATION ARGUMENTS ...)") 6811usage: (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{
@@ -6872,10 +6875,10 @@ usage: (find-operation-coding-system OPERATION ARGUMENTS ...)")
6872 6875
6873DEFUN ("update-coding-systems-internal", Fupdate_coding_systems_internal, 6876DEFUN ("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.
6876When values of any coding categories are changed, you must\n\ 6879When values of any coding categories are changed, you must
6877call this function") 6880call this function. */)
6878 () 6881 ()
6879{ 6882{
6880 int i; 6883 int i;
6881 6884
@@ -6903,9 +6906,9 @@ call this function")
6903 6906
6904DEFUN ("set-coding-priority-internal", Fset_coding_priority_internal, 6907DEFUN ("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'.
6907This function is internal use only.") 6910This 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;
@@ -7144,30 +7147,30 @@ syms_of_coding ()
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
7149Do not alter the value of this variable manually. This variable should be\n\ 7152Do not alter the value of this variable manually. This variable should be
7150updated by the functions `make-coding-system' and\n\ 7153updated 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.
7156Each element is one element list of coding system name.\n\ 7159Each element is one element list of coding system name.
7157This variable is given to `completing-read' as TABLE argument.\n\ 7160This variable is given to `completing-read' as TABLE argument.
7158\n\ 7161
7159Do not alter the value of this variable manually. This variable should be\n\ 7162Do not alter the value of this variable manually. This variable should be
7160updated by the functions `make-coding-system' and\n\ 7163updated 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
7167On detecting a coding system, Emacs tries code detection algorithms\n\ 7170On detecting a coding system, Emacs tries code detection algorithms
7168associated with each coding-category one by one in this order. When\n\ 7171associated with each coding-category one by one in this order. When
7169one algorithm agrees with a byte sequence of source text, the coding\n\ 7172one algorithm agrees with a byte sequence of source text, the coding
7170system bound to the corresponding coding-category is selected."); 7173system bound to the corresponding coding-category is selected. */);
7171 { 7174 {
7172 int i; 7175 int i;
7173 7176
@@ -7179,193 +7182,193 @@ system bound to the corresponding coding-category is selected.");
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.
7183It is useful to bind this variable with `let', but do not set it globally.\n\ 7186It is useful to bind this variable with `let', but do not set it globally.
7184If the value is a coding system, it is used for decoding on read operation.\n\ 7187If the value is a coding system, it is used for decoding on read operation.
7185If not, an appropriate element is used from one of the coding system alists:\n\ 7188If not, an appropriate element is used from one of the coding system alists:
7186There are three such tables, `file-coding-system-alist',\n\ 7189There 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.
7192Programs bind this variable with `let', but you should not set it globally.\n\ 7195Programs bind this variable with `let', but you should not set it globally.
7193If the value is a coding system, it is used for encoding of output,\n\ 7196If the value is a coding system, it is used for encoding of output,
7194when writing it to a file and when sending it to a file or subprocess.\n\ 7197when writing it to a file and when sending it to a file or subprocess.
7195\n\ 7198
7196If this does not specify a coding system, an appropriate element\n\ 7199If this does not specify a coding system, an appropriate element
7197is used from one of the coding system alists:\n\ 7200is used from one of the coding system alists:
7198There are three such tables, `file-coding-system-alist',\n\ 7201There 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'.
7200For output to files, if the above procedure does not specify a coding system,\n\ 7203For output to files, if the above procedure does not specify a coding system,
7201the value of `buffer-file-coding-system' is used."); 7204the 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.
7210See info node `Coding Systems' and info node `Text and Binary' concerning\n\ 7213See info node `Coding Systems' and info node `Text and Binary' concerning
7211such conversion."); 7214such 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.
7216Bind it to t if the process output is to be treated as if it were a file\n\ 7219Bind it to t if the process output is to be treated as if it were a file
7217read from some filesystem."); 7220read 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.
7222The format is ((PATTERN . VAL) ...),\n\ 7225The format is ((PATTERN . VAL) ...),
7223where PATTERN is a regular expression matching a file name,\n\ 7226where PATTERN is a regular expression matching a file name,
7224VAL is a coding system, a cons of coding systems, or a function symbol.\n\ 7227VAL is a coding system, a cons of coding systems, or a function symbol.
7225If VAL is a coding system, it is used for both decoding and encoding\n\ 7228If VAL is a coding system, it is used for both decoding and encoding
7226the file contents.\n\ 7229the file contents.
7227If VAL is a cons of coding systems, the car part is used for decoding,\n\ 7230If VAL is a cons of coding systems, the car part is used for decoding,
7228and the cdr part is used for encoding.\n\ 7231and the cdr part is used for encoding.
7229If VAL is a function symbol, the function must return a coding system\n\ 7232If VAL is a function symbol, the function must return a coding system
7230or a cons of coding systems which are used as above.\n\ 7233or a cons of coding systems which are used as above.
7231\n\ 7234
7232See also the function `find-operation-coding-system'\n\ 7235See also the function `find-operation-coding-system'
7233and the variable `auto-coding-alist'."); 7236and 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.
7238The format is ((PATTERN . VAL) ...),\n\ 7241The format is ((PATTERN . VAL) ...),
7239where PATTERN is a regular expression matching a program name,\n\ 7242where PATTERN is a regular expression matching a program name,
7240VAL is a coding system, a cons of coding systems, or a function symbol.\n\ 7243VAL is a coding system, a cons of coding systems, or a function symbol.
7241If VAL is a coding system, it is used for both decoding what received\n\ 7244If VAL is a coding system, it is used for both decoding what received
7242from the program and encoding what sent to the program.\n\ 7245from the program and encoding what sent to the program.
7243If VAL is a cons of coding systems, the car part is used for decoding,\n\ 7246If VAL is a cons of coding systems, the car part is used for decoding,
7244and the cdr part is used for encoding.\n\ 7247and the cdr part is used for encoding.
7245If VAL is a function symbol, the function must return a coding system\n\ 7248If VAL is a function symbol, the function must return a coding system
7246or a cons of coding systems which are used as above.\n\ 7249or a cons of coding systems which are used as above.
7247\n\ 7250
7248See also the function `find-operation-coding-system'."); 7251See 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.
7253The format is ((PATTERN . VAL) ...),\n\ 7256The format is ((PATTERN . VAL) ...),
7254where PATTERN is a regular expression matching a network service name\n\ 7257where PATTERN is a regular expression matching a network service name
7255or is a port number to connect to,\n\ 7258or is a port number to connect to,
7256VAL is a coding system, a cons of coding systems, or a function symbol.\n\ 7259VAL is a coding system, a cons of coding systems, or a function symbol.
7257If VAL is a coding system, it is used for both decoding what received\n\ 7260If VAL is a coding system, it is used for both decoding what received
7258from the network stream and encoding what sent to the network stream.\n\ 7261from the network stream and encoding what sent to the network stream.
7259If VAL is a cons of coding systems, the car part is used for decoding,\n\ 7262If VAL is a cons of coding systems, the car part is used for decoding,
7260and the cdr part is used for encoding.\n\ 7263and the cdr part is used for encoding.
7261If VAL is a function symbol, the function must return a coding system\n\ 7264If VAL is a function symbol, the function must return a coding system
7262or a cons of coding systems which are used as above.\n\ 7265or a cons of coding systems which are used as above.
7263\n\ 7266
7264See also the function `find-operation-coding-system'."); 7267See 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
7269keyboard input on X Window system."); 7272keyboard 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.
7305While encoding, if a charset (car part of an element) is found,\n\ 7308While encoding, if a charset (car part of an element) is found,
7306designate it with the escape sequence identifying revision (cdr part of the element)."); 7309designate 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.
7312The car part is used for decoding a process output,\n\ 7315The car part is used for decoding a process output,
7313the cdr part is used for encoding a text to be sent to a process."); 7316the 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).
7318This is a vector of length 256.\n\ 7321This is a vector of length 256.
7319If Nth element is non-nil, the existence of code N in a file\n\ 7322If 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
7321a coding system of ISO 2022 variant which has a flag\n\ 7324a 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
7323or reading output of a subprocess.\n\ 7326or reading output of a subprocess.
7324Only 128th through 159th elements has a meaning."); 7327Only 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
7331If set, this function is called to force a user to select a proper\n\ 7334If set, this function is called to force a user to select a proper
7332coding system which can encode the text in the case that a default\n\ 7335coding system which can encode the text in the case that a default
7333coding system used in each operation can't encode the text.\n\ 7336coding system used in each operation can't encode the text.
7334\n\ 7337
7335The default value is `select-safe-coding-system' (which see)."); 7338The 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.
7340Each element doesn't include such generic coding systems that can\n\ 7343Each element doesn't include such generic coding systems that can
7341encode any characters. They are in the first extra slot."); 7344encode 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
7348By default, on reading a file, Emacs tries to detect how the text is\n\ 7351By default, on reading a file, Emacs tries to detect how the text is
7349encoded. This code detection is sensitive to escape sequences. If\n\ 7352encoded. This code detection is sensitive to escape sequences. If
7350the sequence is valid as ISO2022, the code is determined as one of\n\ 7353the sequence is valid as ISO2022, the code is determined as one of
7351the ISO2022 encodings, and the file is decoded by the corresponding\n\ 7354the ISO2022 encodings, and the file is decoded by the corresponding
7352coding system (e.g. `iso-2022-7bit').\n\ 7355coding system (e.g. `iso-2022-7bit').
7353\n\ 7356
7354However, there may be a case that you want to read escape sequences in\n\ 7357However, there may be a case that you want to read escape sequences in
7355a file as is. In such a case, you can set this variable to non-nil.\n\ 7358a file as is. In such a case, you can set this variable to non-nil.
7356Then, as the code detection ignores any escape sequences, no file is\n\ 7359Then, as the code detection ignores any escape sequences, no file is
7357detected as encoded in some ISO2022 encoding. The result is that all\n\ 7360detected as encoded in some ISO2022 encoding. The result is that all
7358escape sequences become visible in a buffer.\n\ 7361escape sequences become visible in a buffer.
7359\n\ 7362
7360The default value is nil, and it is strongly recommended not to change\n\ 7363The default value is nil, and it is strongly recommended not to change
7361it. That is because many Emacs Lisp source files that contain\n\ 7364it. That is because many Emacs Lisp source files that contain
7362non-ASCII characters are encoded by the coding system `iso-2022-7bit'\n\ 7365non-ASCII characters are encoded by the coding system `iso-2022-7bit'
7363in Emacs's distribution, and they won't be decoded correctly on\n\ 7366in Emacs's distribution, and they won't be decoded correctly on
7364reading if you suppress escape sequence detection.\n\ 7367reading if you suppress escape sequence detection.
7365\n\ 7368
7366The other way to read escape sequences in a file without decoding is\n\ 7369The other way to read escape sequences in a file without decoding is
7367to explicitly specify some coding system that doesn't use ISO2022's\n\ 7370to explicitly specify some coding system that doesn't use ISO2022's
7368escape sequence (e.g `latin-1') on reading by \\[universal-coding-system-argument]."); 7371escape 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