]> git.eshelyaron.com Git - emacs.git/commitdiff
(ucs-mule-to-mule-unicode): Define
authorDave Love <fx@gnu.org>
Tue, 10 Sep 2002 17:39:35 +0000 (17:39 +0000)
committerDave Love <fx@gnu.org>
Tue, 10 Sep 2002 17:39:35 +0000 (17:39 +0000)
unconditionally.
(utf-8-fragmentation-table): New.  Use it in top-level mapc.
(utf-8-fragment-on-decoding): Use it to keep
utf-8-translation-table-for-decode variable and translation table
in sync.

lisp/international/utf-8.el

index a85d980bc028484a5bcfe3fd70d41685c8c72c08..e2f4976b97b07d4f92c71c3b51f189c60ae0a486 100644 (file)
 
 (defvar ucs-mule-to-mule-unicode (make-translation-table)
   "Translation table for encoding to `mule-utf-8'.")
-;; Could have been done by ucs-tables loaded before.
-(unless (get 'ucs-mule-to-mule-unicode 'translation-table)
-  (define-translation-table 'ucs-mule-to-mule-unicode
-    ucs-mule-to-mule-unicode))
+(define-translation-table 'ucs-mule-to-mule-unicode
+  ucs-mule-to-mule-unicode)
 
 (defvar utf-8-subst-table (make-hash-table :test 'eq))
 (defvar utf-8-subst-rev-table (make-hash-table :test 'eq))
@@ -87,9 +85,13 @@ decoded into mule-unicode-0100-24ff.")
 ;; space of mule-unicode.  For Latin scripts this isn't very
 ;; important.  Hebrew and Arabic might go here too when there's proper
 ;; support for them.
+(defvar utf-8-fragmentation-table (make-translation-table)
+  "Char table normally mapping non-Latin mule-unicode-... characters to iso8859.
+Used as the value of `utf-8-translation-table-for-decode' in
+`utf-8-fragment-on-decoding' mode.")
 (mapc
  (lambda (pair)
-   (aset utf-8-translation-table-for-decode (car pair) (cdr pair)))
+   (aset utf-8-fragmentation-table (car pair) (cdr pair)))
  '((?\e$,1&d\e(B . ?\e,F4\e(B) (?\e$,1&e\e(B . ?\e,F5\e(B) (?\e$,1&f\e(B . ?\e,F6\e(B) (?\e$,1&h\e(B . ?\e,F8\e(B) (?\e$,1&i\e(B . ?\e,F9\e(B)
    (?\e$,1&j\e(B . ?\e,F:\e(B) (?\e$,1&l\e(B . ?\e,F<\e(B) (?\e$,1&n\e(B . ?\e,F>\e(B) (?\e$,1&o\e(B . ?\e,F?\e(B) (?\e$,1&p\e(B . ?\e,F@\e(B)
    (?\e$,1&q\e(B . ?\e,FA\e(B) (?\e$,1&r\e(B . ?\e,FB\e(B) (?\e$,1&s\e(B . ?\e,FC\e(B) (?\e$,1&t\e(B . ?\e,FD\e(B) (?\e$,1&u\e(B . ?\e,FE\e(B)
@@ -138,10 +140,12 @@ for mechanisms to make this largely transparent.
 
 Setting this variable outside customize has no effect."
   :set (lambda (s v)
-        (if v
-            (define-translation-table 'utf-8-translation-table-for-decode
-              utf-8-translation-table-for-decode)
-          (define-translation-table 'utf-8-translation-table-for-decode))
+        (setq utf-8-translation-table-for-decode
+              (if v
+                  utf-8-fragmentation-table
+                (make-char-table)))
+        (define-translation-table 'utf-8-translation-table-for-decode
+          utf-8-translation-table-for-decode)
         (set-default s v))
   :version "21.4"
   :type 'boolean