diff options
| author | Kenichi Handa | 2014-12-28 22:17:33 +0900 |
|---|---|---|
| committer | K. Handa | 2014-12-28 22:17:33 +0900 |
| commit | 5979af512bf5d6a28acea24299b67c7939d9e703 (patch) | |
| tree | 14dd1ce66eb9052e1a61de7ad9ea7f3c54f6a1b5 | |
| parent | 46d40398fc0bebd8584636eddadb138a62bf32af (diff) | |
| download | emacs-5979af512bf5d6a28acea24299b67c7939d9e703.tar.gz emacs-5979af512bf5d6a28acea24299b67c7939d9e703.zip | |
(define-coding-system): Improve docstring.
| -rw-r--r-- | lisp/international/mule.el | 106 |
1 files changed, 87 insertions, 19 deletions
diff --git a/lisp/international/mule.el b/lisp/international/mule.el index bb8111e416f..4f8d50c8c84 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el | |||
| @@ -593,6 +593,28 @@ as the single-shift area.") | |||
| 593 | The remaining arguments must come in pairs ATTRIBUTE VALUE. ATTRIBUTE | 593 | The remaining arguments must come in pairs ATTRIBUTE VALUE. ATTRIBUTE |
| 594 | may be any symbol. | 594 | may be any symbol. |
| 595 | 595 | ||
| 596 | A coding system specifies a rule to decode (i.e. to convert a | ||
| 597 | byte sequence to a character sequence) and a rule to encode (the | ||
| 598 | opposite of decoding). | ||
| 599 | |||
| 600 | The decoding is done by at most 3 steps; the first is to convert | ||
| 601 | a byte sequence to a character sequence by one of Emacs' | ||
| 602 | internal routines specified by :coding-type attribute. The | ||
| 603 | optional second step is to convert the character sequence (the | ||
| 604 | result of the first step) by a translation table specified | ||
| 605 | by :decode-translation-table attribute. The optional third step | ||
| 606 | is to convert the above reslut by a Lisp function specified | ||
| 607 | by :post-read-conversion attribute. | ||
| 608 | |||
| 609 | The encoding is done by at most 3 steps which are reverse of the | ||
| 610 | decoding steps. The optional first step converts a character | ||
| 611 | sequence to another character sequence by a Lisp function | ||
| 612 | specified by :pre-write-conversion attribute. The optional | ||
| 613 | second step converts the above result by a translation table | ||
| 614 | specified by :encode-translation-table attribute.. The third | ||
| 615 | step converts the abobe result to a byte sequence by one of | ||
| 616 | Emacs' internal routines specified by :coding-type attribute. | ||
| 617 | |||
| 596 | The following attributes have special meanings. Those labeled as | 618 | The following attributes have special meanings. Those labeled as |
| 597 | \"(required)\" should not be omitted. | 619 | \"(required)\" should not be omitted. |
| 598 | 620 | ||
| @@ -602,8 +624,42 @@ VALUE is a character to display on mode line for the coding system. | |||
| 602 | 624 | ||
| 603 | `:coding-type' (required) | 625 | `:coding-type' (required) |
| 604 | 626 | ||
| 605 | VALUE must be one of `charset', `utf-8', `utf-16', `iso-2022', | 627 | VALUE specifies the format of byte sequence the coding system |
| 606 | `emacs-mule', `shift-jis', `ccl', `raw-text', `undecided'. | 628 | decodes and encodes to. It must be one of `charset', `utf-8', |
| 629 | `utf-16', `iso-2022', `emacs-mule', `shift-jis', `ccl', | ||
| 630 | `raw-text', `undecided'. | ||
| 631 | |||
| 632 | If VALUE is `charset', the coding system is for handling a byte | ||
| 633 | sequence in which each byte or each two to four bytes sequence | ||
| 634 | represents a character code of a charset specified | ||
| 635 | by :charset-list attribute. | ||
| 636 | |||
| 637 | If VALUE is `utf-8', the coding system is for handling Unicode | ||
| 638 | UTF-8 byte sequence. See also the documentation of the | ||
| 639 | attribute :bom. | ||
| 640 | |||
| 641 | If VALUE is `utf-16', the coding system is for handling Unicode | ||
| 642 | UTF-16 byte sequence. See also the documentation of the | ||
| 643 | attributes :bom and :endian. | ||
| 644 | |||
| 645 | If VALUE is `iso-2022', the coding system is for handling a byte | ||
| 646 | sequence conforming to ISO/IEC 2022. See also the documentation | ||
| 647 | of the attributes :charset-list, :flags, and :designation. | ||
| 648 | |||
| 649 | If VALUE is `emacs-mule', the coding system is for handling a | ||
| 650 | byte sequence which Emacs 20 and 21 used for internal character | ||
| 651 | representations. | ||
| 652 | |||
| 653 | If VALUE is `shift-jis', the coding system is for handling a byte | ||
| 654 | sequence of Shift_JIS format. See also the | ||
| 655 | attribute :charset-list. | ||
| 656 | |||
| 657 | If VALUE is `ccl', the coding system uses CCL programs to decodes | ||
| 658 | and encodes to a byte sequence. The CCL programs must be | ||
| 659 | specified by the attributes :ccl-decoder and :ccl-encoder. | ||
| 660 | |||
| 661 | If VALUE is `raw-text', the coding system decodes a byte sequence | ||
| 662 | as is. | ||
| 607 | 663 | ||
| 608 | `:eol-type' | 664 | `:eol-type' |
| 609 | 665 | ||
| @@ -613,16 +669,28 @@ one of `unix', `dos', `mac'. The symbol `unix' means Unix-like EOL | |||
| 613 | and `mac' means Mac-like EOL \(i.e. single CR). If omitted, Emacs | 669 | and `mac' means Mac-like EOL \(i.e. single CR). If omitted, Emacs |
| 614 | detects the EOL format automatically when decoding. | 670 | detects the EOL format automatically when decoding. |
| 615 | 671 | ||
| 616 | `:charset-list' | 672 | `:charset-list' (required if :coding-type is `charset' or `shift-jis') |
| 673 | |||
| 674 | VALUE must be a list of charsets supported by the coding system. | ||
| 675 | |||
| 676 | If `coding-type:' is `charset', on decoding and encoding by the | ||
| 677 | coding system, if a character belongs to multiple charsets in the | ||
| 678 | list, a charset that comes earlier in the list is selected. | ||
| 679 | |||
| 680 | If `:coding-type' is `iso-2022', VALUE may be `iso-2022', which | ||
| 681 | indicates that the coding system supports all ISO-2022 based | ||
| 682 | charsets. | ||
| 683 | |||
| 684 | If `:coding-type' is `shift-jis', VALUE must be a list of three | ||
| 685 | to four charsets supported by Shift_JIS encoding scheme. The | ||
| 686 | first charset (one dimension) is for code space 0x00..0x7F, the | ||
| 687 | second (one dimension) for 0xA1..0xDF, the third (two dimension) | ||
| 688 | for 0x8140..0xEFFC, the optional fourth (thw dimension) for | ||
| 689 | 0xF040..0xFCFC. | ||
| 617 | 690 | ||
| 618 | VALUE must be a list of charsets supported by the coding system. On | 691 | If `:coding-type' is `emacs-mule', VALUE may be `emacs-mule', |
| 619 | encoding by the coding system, if a character belongs to multiple | 692 | which indicates that the coding system supports all charsets that |
| 620 | charsets in the list, a charset that comes earlier in the list is | 693 | have the `:emacs-mule-id' property. |
| 621 | selected. If `:coding-type' is `iso-2022', VALUE may be `iso-2022', | ||
| 622 | which indicates that the coding system supports all ISO-2022 based | ||
| 623 | charsets. If `:coding-type' is `emacs-mule', VALUE may be | ||
| 624 | `emacs-mule', which indicates that the coding system supports all | ||
| 625 | charsets that have the `:emacs-mule-id' property. | ||
| 626 | 694 | ||
| 627 | `:ascii-compatible-p' | 695 | `:ascii-compatible-p' |
| 628 | 696 | ||
| @@ -730,17 +798,17 @@ little-endian respectively. The default value is `big'. | |||
| 730 | 798 | ||
| 731 | This attribute is meaningful only when `:coding-type' is `utf-16'. | 799 | This attribute is meaningful only when `:coding-type' is `utf-16'. |
| 732 | 800 | ||
| 733 | `:ccl-decoder' | 801 | `:ccl-decoder' (required if :coding-type is `ccl') |
| 734 | 802 | ||
| 735 | VALUE is a symbol representing the registered CCL program used for | 803 | VALUE is a CCL program name defined by `define-ccl-program'. The |
| 736 | decoding. This attribute is meaningful only when `:coding-type' is | 804 | the CCL program reads a byte sequence and writes a character |
| 737 | `ccl'. | 805 | sequence as a decoding result. |
| 738 | 806 | ||
| 739 | `:ccl-encoder' | 807 | `:ccl-encoder' (required if :coding-type is `ccl') |
| 740 | 808 | ||
| 741 | VALUE is a symbol representing the registered CCL program used for | 809 | VALUE is a CCL program name defined by `define-ccl-program'. The |
| 742 | encoding. This attribute is meaningful only when `:coding-type' is | 810 | the CCL program reads a character sequence and writes a byte |
| 743 | `ccl'. | 811 | sequence as a encoding result. |
| 744 | 812 | ||
| 745 | `:inhibit-null-byte-detection' | 813 | `:inhibit-null-byte-detection' |
| 746 | 814 | ||