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