aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa2014-12-28 22:17:33 +0900
committerK. Handa2014-12-28 22:17:33 +0900
commit5979af512bf5d6a28acea24299b67c7939d9e703 (patch)
tree14dd1ce66eb9052e1a61de7ad9ea7f3c54f6a1b5
parent46d40398fc0bebd8584636eddadb138a62bf32af (diff)
downloademacs-5979af512bf5d6a28acea24299b67c7939d9e703.tar.gz
emacs-5979af512bf5d6a28acea24299b67c7939d9e703.zip
(define-coding-system): Improve docstring.
-rw-r--r--lisp/international/mule.el106
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.")
593The remaining arguments must come in pairs ATTRIBUTE VALUE. ATTRIBUTE 593The remaining arguments must come in pairs ATTRIBUTE VALUE. ATTRIBUTE
594may be any symbol. 594may be any symbol.
595 595
596A coding system specifies a rule to decode (i.e. to convert a
597byte sequence to a character sequence) and a rule to encode (the
598opposite of decoding).
599
600The decoding is done by at most 3 steps; the first is to convert
601a byte sequence to a character sequence by one of Emacs'
602internal routines specified by :coding-type attribute. The
603optional second step is to convert the character sequence (the
604result of the first step) by a translation table specified
605by :decode-translation-table attribute. The optional third step
606is to convert the above reslut by a Lisp function specified
607by :post-read-conversion attribute.
608
609The encoding is done by at most 3 steps which are reverse of the
610decoding steps. The optional first step converts a character
611sequence to another character sequence by a Lisp function
612specified by :pre-write-conversion attribute. The optional
613second step converts the above result by a translation table
614specified by :encode-translation-table attribute.. The third
615step converts the abobe result to a byte sequence by one of
616Emacs' internal routines specified by :coding-type attribute.
617
596The following attributes have special meanings. Those labeled as 618The 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
605VALUE must be one of `charset', `utf-8', `utf-16', `iso-2022', 627VALUE specifies the format of byte sequence the coding system
606`emacs-mule', `shift-jis', `ccl', `raw-text', `undecided'. 628decodes 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
632If VALUE is `charset', the coding system is for handling a byte
633sequence in which each byte or each two to four bytes sequence
634represents a character code of a charset specified
635by :charset-list attribute.
636
637If VALUE is `utf-8', the coding system is for handling Unicode
638UTF-8 byte sequence. See also the documentation of the
639attribute :bom.
640
641If VALUE is `utf-16', the coding system is for handling Unicode
642UTF-16 byte sequence. See also the documentation of the
643attributes :bom and :endian.
644
645If VALUE is `iso-2022', the coding system is for handling a byte
646sequence conforming to ISO/IEC 2022. See also the documentation
647of the attributes :charset-list, :flags, and :designation.
648
649If VALUE is `emacs-mule', the coding system is for handling a
650byte sequence which Emacs 20 and 21 used for internal character
651representations.
652
653If VALUE is `shift-jis', the coding system is for handling a byte
654sequence of Shift_JIS format. See also the
655attribute :charset-list.
656
657If VALUE is `ccl', the coding system uses CCL programs to decodes
658and encodes to a byte sequence. The CCL programs must be
659specified by the attributes :ccl-decoder and :ccl-encoder.
660
661If VALUE is `raw-text', the coding system decodes a byte sequence
662as 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
613and `mac' means Mac-like EOL \(i.e. single CR). If omitted, Emacs 669and `mac' means Mac-like EOL \(i.e. single CR). If omitted, Emacs
614detects the EOL format automatically when decoding. 670detects the EOL format automatically when decoding.
615 671
616`:charset-list' 672`:charset-list' (required if :coding-type is `charset' or `shift-jis')
673
674VALUE must be a list of charsets supported by the coding system.
675
676If `coding-type:' is `charset', on decoding and encoding by the
677coding system, if a character belongs to multiple charsets in the
678list, a charset that comes earlier in the list is selected.
679
680If `:coding-type' is `iso-2022', VALUE may be `iso-2022', which
681indicates that the coding system supports all ISO-2022 based
682charsets.
683
684If `:coding-type' is `shift-jis', VALUE must be a list of three
685to four charsets supported by Shift_JIS encoding scheme. The
686first charset (one dimension) is for code space 0x00..0x7F, the
687second (one dimension) for 0xA1..0xDF, the third (two dimension)
688for 0x8140..0xEFFC, the optional fourth (thw dimension) for
6890xF040..0xFCFC.
617 690
618VALUE must be a list of charsets supported by the coding system. On 691If `:coding-type' is `emacs-mule', VALUE may be `emacs-mule',
619encoding by the coding system, if a character belongs to multiple 692which indicates that the coding system supports all charsets that
620charsets in the list, a charset that comes earlier in the list is 693have the `:emacs-mule-id' property.
621selected. If `:coding-type' is `iso-2022', VALUE may be `iso-2022',
622which indicates that the coding system supports all ISO-2022 based
623charsets. If `:coding-type' is `emacs-mule', VALUE may be
624`emacs-mule', which indicates that the coding system supports all
625charsets 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
731This attribute is meaningful only when `:coding-type' is `utf-16'. 799This 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
735VALUE is a symbol representing the registered CCL program used for 803VALUE is a CCL program name defined by `define-ccl-program'. The
736decoding. This attribute is meaningful only when `:coding-type' is 804the CCL program reads a byte sequence and writes a character
737`ccl'. 805sequence as a decoding result.
738 806
739`:ccl-encoder' 807`:ccl-encoder' (required if :coding-type is `ccl')
740 808
741VALUE is a symbol representing the registered CCL program used for 809VALUE is a CCL program name defined by `define-ccl-program'. The
742encoding. This attribute is meaningful only when `:coding-type' is 810the CCL program reads a character sequence and writes a byte
743`ccl'. 811sequence as a encoding result.
744 812
745`:inhibit-null-byte-detection' 813`:inhibit-null-byte-detection'
746 814