comparison lisp/mule/iso-with-esc.el @ 4568:1d74a1d115ee

Add #'query-coding-region tests; do the work necessary to get them running. lisp/ChangeLog addition: 2008-12-28 Aidan Kehoe <kehoea@parhasard.net> * coding.el (default-query-coding-region): Declare using defun*, so we can #'return-from to it on encountering a safe-charsets value of t. Comment out a few debug messages. (query-coding-region): Correct the docstring, it deals with a region, not a string. (unencodable-char-position): Correct the implementation for non-nil COUNT, special-case a zero value for count, treat it as one. Don't rely on dynamic scope when calling the main lambda. * unicode.el (unicode-query-coding-region): Comment out some debug messages here. * mule/mule-coding.el (8-bit-fixed-query-coding-region): Comment out some debug messages here. * code-init.el (raw-text): Add a safe-charsets property to this coding system. * mule/korean.el (iso-2022-int-1): * mule/korean.el (euc-kr): * mule/korean.el (iso-2022-kr): Add safe-charsets properties for these coding systems. * mule/japanese.el (iso-2022-jp): * mule/japanese.el (jis7): * mule/japanese.el (jis8): * mule/japanese.el (shift-jis): * mule/japanese.el (iso-2022-jp-1978-irv): * mule/japanese.el (euc-jp): Add safe-charsets properties for all these coding systems. * mule/iso-with-esc.el: Add safe-charsets properties to all the coding systems in here. Comment on the downside of a safe-charsets value of t for iso-latin-1-with-esc. * mule/hebrew.el (ctext-hebrew): Add a safe-charsets property for this coding system. * mule/devanagari.el (in-is13194-devanagari): Add a safe-charsets property for this coding system. * mule/chinese.el (cn-gb-2312): * mule/chinese.el (hz-gb-2312): * mule/chinese.el (big5): Add safe-charsets properties for these coding systems. * mule/latin.el (iso-8859-14): Add an implementation for this, using #'make-8-bit-coding-system. * mule/mule-coding.el (ctext): * mule/mule-coding.el (iso-2022-8bit-ss2): * mule/mule-coding.el (iso-2022-7bit-ss2): * mule/mule-coding.el (iso-2022-jp-2): * mule/mule-coding.el (iso-2022-7bit): * mule/mule-coding.el (iso-2022-8): * mule/mule-coding.el (escape-quoted): * mule/mule-coding.el (iso-2022-lock): Add safe-charsets properties for all these coding systems. src/ChangeLog addition: 2008-12-28 Aidan Kehoe <kehoea@parhasard.net> * file-coding.c (Fmake_coding_system): Document our use of the safe-chars and safe-charsets properties, and the differences compared to GNU. (make_coding_system_1): Don't drop the safe-chars and safe-charsets properties. (Fcoding_system_property): Return the safe-chars and safe-charsets properties when asked for them. * file-coding.h (CODING_SYSTEM_SAFE_CHARSETS): * coding-system-slots.h: Make the safe-chars and safe-charsets slots available in these headers. tests/ChangeLog addition: 2008-12-28 Aidan Kehoe <kehoea@parhasard.net> * automated/query-coding-tests.el: New file, testing the functionality of #'query-coding-region and #'query-coding-string.
author Aidan Kehoe <kehoea@parhasard.net>
date Sun, 28 Dec 2008 14:46:24 +0000
parents d402d7b18bd8
children a67bfb29dd8b
comparison
equal deleted inserted replaced
4567:84d618b355f5 4568:1d74a1d115ee
26 26
27 ;;; Commentary: 27 ;;; Commentary:
28 28
29 ;;; Code: 29 ;;; Code:
30 30
31 ;; It is not particularly reasonable that iso-latin-1-with-esc has a
32 ;; value of t for the safe-charsets property. We discourage its use,
33 ;; though, and this behaviour is compatible with GNU.
34
31 ;;;###autoload 35 ;;;###autoload
32 (define-coding-system-alias 'iso-latin-1-with-esc 'iso-2022-8) 36 (define-coding-system-alias 'iso-latin-1-with-esc 'iso-2022-8)
33 37
34 ;;;###autoload 38 ;;;###autoload
35 (make-coding-system 39 (make-coding-system
36 'iso-latin-2-with-esc 'iso2022 "ISO-8859-2 (Latin-2)" 40 'iso-latin-2-with-esc 'iso2022 "ISO-8859-2 (Latin-2)"
37 '(charset-g0 ascii 41 '(charset-g0 ascii
38 charset-g1 latin-iso8859-2 42 charset-g1 latin-iso8859-2
39 charset-g2 t 43 charset-g2 t
40 charset-g3 t 44 charset-g3 t
45 safe-charsets (ascii latin-iso8859-2)
41 mnemonic "MIME/Ltn-2")) 46 mnemonic "MIME/Ltn-2"))
42 47
43 ;;;###autoload 48 ;;;###autoload
44 (make-coding-system 49 (make-coding-system
45 'iso-latin-3-with-esc 'iso2022 "ISO-8859-3 (Latin-3)" 50 'iso-latin-3-with-esc 'iso2022 "ISO-8859-3 (Latin-3)"
46 '(charset-g0 ascii 51 '(charset-g0 ascii
47 charset-g1 latin-iso8859-3 52 charset-g1 latin-iso8859-3
48 charset-g2 t 53 charset-g2 t
49 charset-g3 t 54 charset-g3 t
55 safe-charsets (ascii latin-iso8859-3)
50 mnemonic "MIME/Ltn-3")) 56 mnemonic "MIME/Ltn-3"))
51 57
52 ;;;###autoload 58 ;;;###autoload
53 (make-coding-system 59 (make-coding-system
54 'iso-latin-4-with-esc 'iso2022 "ISO-8859-4 (Latin-4)" 60 'iso-latin-4-with-esc 'iso2022 "ISO-8859-4 (Latin-4)"
55 '(charset-g0 ascii 61 '(charset-g0 ascii
56 charset-g1 latin-iso8859-4 62 charset-g1 latin-iso8859-4
57 charset-g2 t 63 charset-g2 t
58 charset-g3 t 64 charset-g3 t
65 safe-charsets (ascii latin-iso8859-4)
59 mnemonic "MIME/Ltn-4")) 66 mnemonic "MIME/Ltn-4"))
60 67
61 ;;;###autoload 68 ;;;###autoload
62 (make-coding-system 69 (make-coding-system
63 'iso-latin-9-with-esc 'iso2022 70 'iso-latin-9-with-esc 'iso2022
64 "ISO 4873 conforming 8-bit code (ASCII + Latin 9; aka Latin-1 with Euro)" 71 "ISO 4873 conforming 8-bit code (ASCII + Latin 9; aka Latin-1 with Euro)"
65 '(mnemonic "MIME/Ltn-9" ; bletch 72 '(mnemonic "MIME/Ltn-9" ; bletch
73 safe-charsets (ascii latin-iso8859-15)
66 eol-type nil 74 eol-type nil
67 charset-g0 ascii 75 charset-g0 ascii
68 charset-g1 latin-iso8859-15 76 charset-g1 latin-iso8859-15
69 charset-g2 t 77 charset-g2 t
70 charset-g3 t)) 78 charset-g3 t))
74 'iso-latin-5-with-esc 'iso2022 "ISO-8859-9 (Latin-5)" 82 'iso-latin-5-with-esc 'iso2022 "ISO-8859-9 (Latin-5)"
75 '(charset-g0 ascii 83 '(charset-g0 ascii
76 charset-g1 latin-iso8859-9 84 charset-g1 latin-iso8859-9
77 charset-g2 t 85 charset-g2 t
78 charset-g3 t 86 charset-g3 t
87 safe-charsets (ascii latin-iso8859-9)
79 mnemonic "MIME/Ltn-5")) 88 mnemonic "MIME/Ltn-5"))
80 89
81 ;;;###autoload 90 ;;;###autoload
82 (make-coding-system 91 (make-coding-system
83 'cyrillic-iso-8bit-with-esc 'iso2022 92 'cyrillic-iso-8bit-with-esc 'iso2022
84 "ISO-8859-5 (Cyrillic)" 93 "ISO-8859-5 (Cyrillic)"
85 '(charset-g0 ascii 94 '(charset-g0 ascii
86 charset-g1 cyrillic-iso8859-5 95 charset-g1 cyrillic-iso8859-5
87 charset-g2 t 96 charset-g2 t
88 charset-g3 t 97 charset-g3 t
98 safe-charsets (ascii cyrillic-iso8859-5)
89 mnemonic "ISO8/Cyr")) 99 mnemonic "ISO8/Cyr"))
90 100
91 ;;;###autoload 101 ;;;###autoload
92 (make-coding-system 102 (make-coding-system
93 'hebrew-iso-8bit-with-esc 'iso2022 103 'hebrew-iso-8bit-with-esc 'iso2022
95 '(charset-g0 ascii 105 '(charset-g0 ascii
96 charset-g1 hebrew-iso8859-8 106 charset-g1 hebrew-iso8859-8
97 charset-g2 t 107 charset-g2 t
98 charset-g3 t 108 charset-g3 t
99 no-iso6429 t 109 no-iso6429 t
110 safe-charsets (ascii hebrew-iso8859-8)
100 mnemonic "MIME/Hbrw")) 111 mnemonic "MIME/Hbrw"))
101 112
102 ;;;###autoload 113 ;;;###autoload
103 (make-coding-system 114 (make-coding-system
104 'greek-iso-8bit-with-esc 'iso2022 "MIME ISO-8859-7" 115 'greek-iso-8bit-with-esc 'iso2022 "MIME ISO-8859-7"
105 '(charset-g0 ascii 116 '(charset-g0 ascii
106 charset-g1 greek-iso8859-7 117 charset-g1 greek-iso8859-7
107 charset-g2 t 118 charset-g2 t
108 charset-g3 t 119 charset-g3 t
120 safe-charsets (ascii greek-iso8859-7)
109 mnemonic "Grk")) 121 mnemonic "Grk"))
110 122
111 ;; ISO 8859-6 is such a useless character set that it seems a waste of 123 ;; ISO 8859-6 is such a useless character set that it seems a waste of
112 ;; codespace to dump it. Let me count the ways: 124 ;; codespace to dump it. Let me count the ways:
113 ;; 125 ;;
199 '(charset-g0 ascii 211 '(charset-g0 ascii
200 charset-g1 arabic-iso8859-6 212 charset-g1 arabic-iso8859-6
201 charset-g2 t 213 charset-g2 t
202 charset-g3 t 214 charset-g3 t
203 no-iso6429 t 215 no-iso6429 t
216 safe-charsets (ascii arabic-iso8859-6)
204 mnemonic "MIME/Arbc")) 217 mnemonic "MIME/Arbc"))
205 218