]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Simplify last change, and make it portable to XEmacs.
authorBruno Haible <bruno@clisp.org>
Wed, 16 Oct 2002 13:09:57 +0000 (13:09 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:08:46 +0000 (12:08 +0200)
misc/ChangeLog
misc/po-compat.el

index 58acf99ee7fef2503f714c124c83fda6101ada11..278e3c1e33d8e3a88a850d0cda116aca4786e8cc 100644 (file)
@@ -1,3 +1,8 @@
+2002-10-16  Bruno Haible  <bruno@clisp.org>
+
+       * po-compat.el: Remove call of codepage-setup of all support codepages.
+       (po-find-file-coding-system-guts): Avoid code duplication.
+
 2002-09-27  Karl Eichwalder  <ke@suse.de>
 
        * po-compat.el (po-content-type-charset-alist): Convert the
index a06cbe4c5b1d89c476042da29ed861f7be5a1e1e..8aee214c382ca29295dd98834e484b8aa8ebe23a 100644 (file)
             (and (buffer-name ,temp-buffer)
                  (kill-buffer ,temp-buffer))))))))
 
-; Make the cpnnn codesets available.
-(if po-EMACS20
-  (mapcar #'codepage-setup (mapcar #'car (cp-supported-codepages))))
-
 (defconst po-content-type-charset-alist
   '(; Note: Emacs 21 doesn't support all encodings, thus the missing entries.
     ("ASCII" . undecided)
@@ -199,22 +195,18 @@ Called through file-coding-system-alist, before the file is visited for real."
                     (charset-lower (downcase charset))
                     (candidate
                      (cdr (assoc charset-upper po-content-type-charset-alist)))
-                    (try (or candidate (intern-soft charset-lower))))
-               (list (cond ((and try (coding-system-p try))
-                            try)
-                           ((and try
+                    (try-symbol (or candidate (intern-soft charset-lower)))
+                    (try-string
+                     (if try-symbol (symbol-name try-symbol) charset-lower)))
+               (list (cond ((and try-symbol (coding-system-p try-symbol))
+                            try-symbol)
+                           ((and po-EMACS20
                                  (string-match "\\`cp[1-9][0-9][0-9]?\\'"
-                                               (symbol-name try))
-                                 (assoc (substring (symbol-name try) 2)
-                                        (cp-supported-codepages)))
-                            (codepage-setup (substring (symbol-name try) 2))
-                            try)
-                           ((and (string-match "\\`cp[1-9][0-9][0-9]?\\'"
-                                               charset-lower)
-                                 (assoc (substring charset-lower 2)
+                                               try-string)
+                                 (assoc (substring try-string 2)
                                         (cp-supported-codepages)))
-                            (codepage-setup (substring charset-lower 2))
-                            (intern charset-lower))
+                            (codepage-setup (substring try-string 2))
+                            (intern try-string))
                            (t
                             'no-conversion))))))))