62 |
'help-echo "mouse-2, RET: show table of characters for this character set") |
'help-echo "mouse-2, RET: show table of characters for this character set") |
63 |
|
|
64 |
;;;###autoload |
;;;###autoload |
65 |
(defvar non-iso-charset-alist |
(defvar non-iso-charset-alist nil |
|
`((mac-roman |
|
|
(ascii latin-iso8859-1 mule-unicode-2500-33ff |
|
|
mule-unicode-0100-24ff mule-unicode-e000-ffff) |
|
|
mac-roman-decoder |
|
|
((0 255))) |
|
|
(viscii |
|
|
(ascii vietnamese-viscii-lower vietnamese-viscii-upper) |
|
|
viet-viscii-nonascii-translation-table |
|
|
((0 255))) |
|
|
(vietnamese-tcvn |
|
|
(ascii vietnamese-viscii-lower vietnamese-viscii-upper) |
|
|
viet-tcvn-nonascii-translation-table |
|
|
((0 255))) |
|
|
(koi8-r |
|
|
(ascii cyrillic-iso8859-5) |
|
|
cyrillic-koi8-r-nonascii-translation-table |
|
|
((32 255))) |
|
|
(alternativnyj |
|
|
(ascii cyrillic-iso8859-5) |
|
|
cyrillic-alternativnyj-nonascii-translation-table |
|
|
((32 255))) |
|
|
(koi8-u |
|
|
(ascii cyrillic-iso8859-5 mule-unicode-0100-24ff) |
|
|
cyrillic-koi8-u-nonascii-translation-table |
|
|
((32 255))) |
|
|
(big5 |
|
|
(ascii chinese-big5-1 chinese-big5-2) |
|
|
decode-big5-char |
|
|
((32 127) |
|
|
((?\xA1 ?\xFE) . (?\x40 ?\x7E ?\xA1 ?\xFE)))) |
|
|
(sjis |
|
|
(ascii katakana-jisx0201 japanese-jisx0208) |
|
|
decode-sjis-char |
|
|
((32 127 ?\xA1 ?\xDF) |
|
|
((?\x81 ?\x9F ?\xE0 ?\xEF) . (?\x40 ?\x7E ?\x80 ?\xFC))))) |
|
66 |
"Alist of charset names vs the corresponding information. |
"Alist of charset names vs the corresponding information. |
67 |
This is mis-named for historical reasons. The charsets are actually |
This is mis-named for historical reasons. The charsets are actually |
68 |
non-built-in ones. They correspond to Emacs coding systems, not Emacs |
non-built-in ones. They correspond to Emacs coding systems, not Emacs |
93 |
The second form is used for 2-byte codes. The car part is the ranges |
The second form is used for 2-byte codes. The car part is the ranges |
94 |
of the first byte, and the cdr part is the ranges of the second byte.") |
of the first byte, and the cdr part is the ranges of the second byte.") |
95 |
|
|
96 |
|
;; Set it like this in case code-pages &c has been loaded previously, |
97 |
|
;; in which case defvar would be useless. |
98 |
|
(setq non-iso-charset-alist |
99 |
|
(append |
100 |
|
non-iso-charset-alist |
101 |
|
`((mac-roman |
102 |
|
(ascii latin-iso8859-1 mule-unicode-2500-33ff |
103 |
|
mule-unicode-0100-24ff mule-unicode-e000-ffff) |
104 |
|
mac-roman-decoder |
105 |
|
((0 255))) |
106 |
|
(viscii |
107 |
|
(ascii vietnamese-viscii-lower vietnamese-viscii-upper) |
108 |
|
viet-viscii-nonascii-translation-table |
109 |
|
((0 255))) |
110 |
|
(vietnamese-tcvn |
111 |
|
(ascii vietnamese-viscii-lower vietnamese-viscii-upper) |
112 |
|
viet-tcvn-nonascii-translation-table |
113 |
|
((0 255))) |
114 |
|
(koi8-r |
115 |
|
(ascii cyrillic-iso8859-5) |
116 |
|
cyrillic-koi8-r-nonascii-translation-table |
117 |
|
((32 255))) |
118 |
|
(alternativnyj |
119 |
|
(ascii cyrillic-iso8859-5) |
120 |
|
cyrillic-alternativnyj-nonascii-translation-table |
121 |
|
((32 255))) |
122 |
|
(koi8-u |
123 |
|
(ascii cyrillic-iso8859-5 mule-unicode-0100-24ff) |
124 |
|
cyrillic-koi8-u-nonascii-translation-table |
125 |
|
((32 255))) |
126 |
|
(big5 |
127 |
|
(ascii chinese-big5-1 chinese-big5-2) |
128 |
|
decode-big5-char |
129 |
|
((32 127) |
130 |
|
((?\xA1 ?\xFE) . (?\x40 ?\x7E ?\xA1 ?\xFE)))) |
131 |
|
(sjis |
132 |
|
(ascii katakana-jisx0201 japanese-jisx0208) |
133 |
|
decode-sjis-char |
134 |
|
((32 127 ?\xA1 ?\xDF) |
135 |
|
((?\x81 ?\x9F ?\xE0 ?\xEF) . (?\x40 ?\x7E ?\x80 ?\xFC))))))) |
136 |
|
|
137 |
;;;###autoload |
;;;###autoload |
138 |
(defun list-character-sets (arg) |
(defun list-character-sets (arg) |
139 |
"Display a list of all character sets. |
"Display a list of all character sets. |
356 |
(string-to-char |
(string-to-char |
357 |
(decode-coding-string (char-to-string code) coding-system)))) |
(decode-coding-string (char-to-string code) coding-system)))) |
358 |
|
|
|
|
|
|
;; Add DOS codepages to `non-iso-charset-alist'. |
|
|
|
|
|
(let ((tail (cp-supported-codepages)) |
|
|
elt) |
|
|
(while tail |
|
|
(setq elt (car tail) tail (cdr tail)) |
|
|
;; Now ELT is (CODEPAGE . CHARSET), where CODEPAGE is a string |
|
|
;; (e.g. "850"), CHARSET is a charset that characters in CODEPAGE |
|
|
;; are mapped to. |
|
|
(unless (assq (intern (concat "cp" (car elt))) non-iso-charset-alist) |
|
|
(setq non-iso-charset-alist |
|
|
(cons (list (intern (concat "cp" (car elt))) |
|
|
(list 'ascii (cdr elt)) |
|
|
`(lambda (code) |
|
|
(decode-codepage-char ,(string-to-int (car elt)) |
|
|
code)) |
|
|
(list (list 0 255))) |
|
|
non-iso-charset-alist))))) |
|
|
|
|
|
|
|
359 |
;; A variable to hold charset input history. |
;; A variable to hold charset input history. |
360 |
(defvar charset-history nil) |
(defvar charset-history nil) |
361 |
|
|
579 |
charset (charset-description charset))) |
charset (charset-description charset))) |
580 |
((listp charset) |
((listp charset) |
581 |
(if (charsetp (car charset)) |
(if (charsetp (car charset)) |
582 |
(format "%s:%s, and also used by the followings:" |
(format "%s:%s, and also used by the following:" |
583 |
(car charset) |
(car charset) |
584 |
(charset-description (car charset))) |
(charset-description (car charset))) |
585 |
"no initial designation, and used by the followings:")) |
"no initial designation, and used by the following:")) |
586 |
(t |
(t |
587 |
"invalid designation information")))) |
"invalid designation information")))) |
588 |
(when (listp charset) |
(when (listp charset) |
989 |
## EOL = 0 (LF), 1 (CRLF), 2 (CR), or 3 (Automatic detection) |
## EOL = 0 (LF), 1 (CRLF), 2 (CR), or 3 (Automatic detection) |
990 |
## FLAGS = |
## FLAGS = |
991 |
## if TYPE = 2 then |
## if TYPE = 2 then |
992 |
## comma (`,') separated data of the followings: |
## comma (`,') separated data of the following: |
993 |
## G0, G1, G2, G3, SHORT-FORM, ASCII-EOL, ASCII-CNTL, SEVEN, |
## G0, G1, G2, G3, SHORT-FORM, ASCII-EOL, ASCII-CNTL, SEVEN, |
994 |
## LOCKING-SHIFT, SINGLE-SHIFT, USE-ROMAN, USE-OLDJIS, NO-ISO6429 |
## LOCKING-SHIFT, SINGLE-SHIFT, USE-ROMAN, USE-OLDJIS, NO-ISO6429 |
995 |
## else if TYPE = 4 then |
## else if TYPE = 4 then |