Mercurial > emacs
comparison lisp/international/mule.el @ 47417:2971d56bb930
(non-standard-designations-alist)
(ctext-pre-write-conversion): Don't generate invalid extended
segments for iso8859.
author | Dave Love <fx@gnu.org> |
---|---|
date | Wed, 11 Sep 2002 21:16:28 +0000 |
parents | b0b872e61fc5 |
children | b9d7faa08e87 |
comparison
equal
deleted
inserted
replaced
47416:2ff3f5116672 | 47417:2971d56bb930 |
---|---|
1422 ;; If you add charsets here, be sure to modify the regexp used by | 1422 ;; If you add charsets here, be sure to modify the regexp used by |
1423 ;; ctext-pre-write-conversion to look up non-standard charsets. | 1423 ;; ctext-pre-write-conversion to look up non-standard charsets. |
1424 (defvar non-standard-designations-alist | 1424 (defvar non-standard-designations-alist |
1425 '(("$(0" . (big5 "big5-0" 2)) | 1425 '(("$(0" . (big5 "big5-0" 2)) |
1426 ("$(1" . (big5 "big5-0" 2)) | 1426 ("$(1" . (big5 "big5-0" 2)) |
1427 ("-V" . (t "iso8859-10" 1)) | 1427 ;; The following are actually standard; generating extended |
1428 ("-Y" . (t "iso8859-13" 1)) | 1428 ;; segments for them is wrong and screws e.g. Latin-9 users. |
1429 ("-_" . (t "iso8859-14" 1)) | 1429 ;; 8859-{10,13,16} aren't Emacs charsets anyhow. -- fx |
1430 ("-b" . (t "iso8859-15" 1)) | 1430 ;; ("-V" . (t "iso8859-10" 1)) |
1431 ("-f" . (t "iso8859-16" 1))) | 1431 ;; ("-Y" . (t "iso8859-13" 1)) |
1432 ;; ("-_" . (t "iso8859-14" 1)) | |
1433 ;; ("-b" . (t "iso8859-15" 1)) | |
1434 ;; ("-f" . (t "iso8859-16" 1)) | |
1435 ) | |
1432 "Alist of ctext control sequences that introduce character sets which | 1436 "Alist of ctext control sequences that introduce character sets which |
1433 are not in the list of approved ICCCM encodings, and the corresponding | 1437 are not in the list of approved encodings, and the corresponding |
1434 coding system, identifier string, and number of octets per encoded | 1438 coding system, identifier string, and number of octets per encoded |
1435 character. | 1439 character. |
1436 | 1440 |
1437 Each element has the form (CTLSEQ . (ENCODING CHARSET NOCTETS)). CTLSEQ | 1441 Each element has the form (CTLSEQ . (ENCODING CHARSET NOCTETS)). CTLSEQ |
1438 is the control sequence (sans the leading ESC) that introduces the character | 1442 is the control sequence (sans the leading ESC) that introduces the character |
1439 set in the text encoded by compound-text. ENCODING is a coding system | 1443 set in the text encoded by compound-text. ENCODING is a coding system |
1440 symbol; if it is t, it means that the ctext coding system already encodes | 1444 symbol; if it is t, it means that the ctext coding system already encodes |
1441 the text correctly, and only the leading control sequence needs to be altered. | 1445 the text correctly, and only the leading control sequence needs to be altered. |
1442 If ENCODING is a coding system, we need to re-encode the text with that | 1446 If ENCODING is a coding system, we need to re-encode the text with that |
1443 coding system. CHARSET is the ICCCM name of the charset we need to put into | 1447 coding system. CHARSET is the name of the charset we need to put into |
1444 the leading control sequence. NOCTETS is the number of octets (bytes) that | 1448 the leading control sequence. NOCTETS is the number of octets (bytes) that |
1445 encode each character in this charset. NOCTETS can be 0 (meaning the number | 1449 encode each character in this charset. NOCTETS can be 0 (meaning the number |
1446 of octets per character is variable), 1, 2, 3, or 4.") | 1450 of octets per character is variable), 1, 2, 3, or 4.") |
1447 | 1451 |
1448 (defun ctext-pre-write-conversion (from to) | 1452 (defun ctext-pre-write-conversion (from to) |
1471 (goto-char (point-min)) | 1475 (goto-char (point-min)) |
1472 (let ((newpt (make-marker)) | 1476 (let ((newpt (make-marker)) |
1473 (case-fold-search nil) | 1477 (case-fold-search nil) |
1474 pt desig encode-info encoding chset noctets textlen) | 1478 pt desig encode-info encoding chset noctets textlen) |
1475 (set-buffer-multibyte nil) | 1479 (set-buffer-multibyte nil) |
1476 ;; The regexp below finds the leading sequences for big5 and | 1480 ;; The regexp below finds the leading sequences for big5. |
1477 ;; iso8859-1[03-6] charsets. | 1481 (while (re-search-forward "\e\\(\$([01]\\)" nil 'move) |
1478 (while (re-search-forward "\e\\(\$([01]\\|-[VY_bf]\\)" nil 'move) | |
1479 (setq desig (match-string 1) | 1482 (setq desig (match-string 1) |
1480 pt (point-marker) | 1483 pt (point-marker) |
1481 encode-info (cdr (assoc desig non-standard-designations-alist)) | 1484 encode-info (cdr (assoc desig non-standard-designations-alist)) |
1482 encoding (car encode-info) | 1485 encoding (car encode-info) |
1483 chset (cadr encode-info) | 1486 chset (cadr encode-info) |