[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/international/ucs-tables.el
From: |
Dave Love |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/international/ucs-tables.el |
Date: |
Tue, 10 Sep 2002 13:39:53 -0400 |
Index: emacs/lisp/international/ucs-tables.el
diff -c emacs/lisp/international/ucs-tables.el:1.14
emacs/lisp/international/ucs-tables.el:1.15
*** emacs/lisp/international/ucs-tables.el:1.14 Sun Jul 21 16:24:38 2002
--- emacs/lisp/international/ucs-tables.el Tue Sep 10 13:39:53 2002
***************
*** 157,166 ****
"Used as `translation-table-for-encode' for iso-8859-15.
Translates from the iso8859 charsets and `mule-unicode-0100-24ff'.")
- ;; Probably defined by utf-8.el.
- (defvar ucs-mule-to-mule-unicode (make-translation-table))
- (unless (get 'ucs-mule-to-mule-unicode 'translation-table)
- (define-translation-table 'ucs-mule-to-mule-unicode
ucs-mule-to-mule-unicode))
;;; Set up the tables.
;; Most of these tables were derived from ones in Mule-UCS.
--- 157,162 ----
***************
*** 1102,1143 ****
(nreverse l))))
;; Convert the lists to the basic char tables.
! (dolist (n (list 15 14 9 8 7 5 4 3 2 1))
! (let ((alist (symbol-value (intern (format "ucs-8859-%d-alist" n)))))
! (dolist (pair alist)
! (let ((mule (car pair))
! (uc (cdr pair))
! (mu (decode-char 'ucs (cdr pair))))
! (aset ucs-mule-8859-to-ucs-table mule uc)
! ;; (aset ucs-ucs-to-mule-8859-table uc mule)
! ;; (aset ucs-mule-unicode-to-mule-8859 mu mule)
! (aset ucs-mule-8859-to-mule-unicode mule mu)
! (aset ucs-mule-to-mule-unicode mule mu)))))
! ;; The table optimizing here and elsewhere probably isn't very
! ;; useful, but seems good practice.
! (optimize-char-table ucs-mule-to-mule-unicode)
! (optimize-char-table ucs-mule-8859-to-mule-unicode)
! ;; Derive tables that can be used as per-coding-system
! ;; `translation-table-for-encode's.
! (dolist (n (list 15 14 9 8 7 5 4 3 2 1))
! (let* ((alist (symbol-value (intern (format "ucs-8859-%d-alist" n))))
! (encode-translator (set (intern (format "ucs-8859-%d-encode-table"
! n))
! (make-translation-table)))
! elt)
! ;; Start with the mule-unicode component.
! (dolist (pair alist)
! (let ((mule (car pair))
! (mu (decode-char 'ucs (cdr pair))))
! (aset encode-translator mu mule)))
! ;; Find characters from other 8859 sets which map to the same
! ;; unicode as some character in this set.
! (map-char-table (lambda (k v)
! (if (and (setq elt (rassq v alist))
! (not (assq k alist)))
! (aset encode-translator k (car elt))))
! ucs-mule-8859-to-ucs-table)
! (optimize-char-table encode-translator))))
;; Register for use in CCL.
(define-translation-table 'ucs-mule-8859-to-mule-unicode
--- 1098,1138 ----
(nreverse l))))
;; Convert the lists to the basic char tables.
! ;; Ensure `decode-char' doesn't use the fragmentation table.
! ;; Fixme: handa suggests using the RESTRICTION arg.
! (let (utf-8-translation-table-for-decode)
! (dolist (n (list 15 14 9 8 7 5 4 3 2 1))
! (let ((alist (symbol-value (intern (format "ucs-8859-%d-alist" n)))))
! (dolist (pair alist)
! (let ((mule (car pair))
! (uc (cdr pair))
! (mu (decode-char 'ucs (cdr pair))))
! (aset ucs-mule-8859-to-ucs-table mule uc)
! ;; (aset ucs-ucs-to-mule-8859-table uc mule)
! ;; (aset ucs-mule-unicode-to-mule-8859 mu mule)
! (aset ucs-mule-8859-to-mule-unicode mule mu)
! (aset ucs-mule-to-mule-unicode mule mu)))))
! ;; Derive tables that can be used as per-coding-system
! ;; `translation-table-for-encode's.
! (dolist (n (list 15 14 9 8 7 5 4 3 2 1))
! (let* ((alist (symbol-value (intern (format "ucs-8859-%d-alist" n))))
! (encode-translator (set (intern (format "ucs-8859-%d-encode-table"
! n))
! (make-translation-table)))
! elt)
! ;; Start with the mule-unicode component.
! (dolist (pair alist)
! (let ((mule (car pair))
! (mu (decode-char 'ucs (cdr pair))))
! (aset encode-translator mu mule)))
! ;; Find characters from other 8859 sets which map to the same
! ;; unicode as some character in this set.
! (map-char-table (lambda (k v)
! (if (and (setq elt (rassq v alist))
! (not (assq k alist)))
! (aset encode-translator k (car elt))))
! ucs-mule-8859-to-ucs-table)
! (optimize-char-table encode-translator)))))
;; Register for use in CCL.
(define-translation-table 'ucs-mule-8859-to-mule-unicode
***************
*** 1158,1167 ****
(unless encode-only
;; Unify 8859 on decoding. (Non-CCL coding systems only.)
(if utf-8-fragment-on-decoding
! (map-char-table
! (lambda (k v)
! (if v (aset ucs-mule-to-mule-unicode v nil)))
! utf-8-translation-table-for-decode)
;; Reset in case it was changed.
(map-char-table
(lambda (k v)
--- 1153,1163 ----
(unless encode-only
;; Unify 8859 on decoding. (Non-CCL coding systems only.)
(if utf-8-fragment-on-decoding
! (progn (map-char-table
! (lambda (k v)
! (if v (aset ucs-mule-to-mule-unicode v nil)))
! utf-8-translation-table-for-decode)
! (optimize-char-table ucs-mule-to-mule-unicode))
;; Reset in case it was changed.
(map-char-table
(lambda (k v)
***************
*** 2459,2465 ****
encode-translator))
((memq cs '(lao thai-tis620 tibetan-iso-8bit))
(coding-system-put cs 'translation-table-for-input cs)))))
- (optimize-char-table ucs-mule-to-mule-unicode)
(dolist (c safe-charsets)
(aset table (make-char c) t))
(coding-system-put 'mule-utf-8 'safe-charsets
--- 2455,2460 ----