]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Restore old code for XEmacs.
authorBruno Haible <bruno@clisp.org>
Mon, 28 Oct 2002 14:26:42 +0000 (14:26 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:08:47 +0000 (12:08 +0200)
misc/ChangeLog
misc/po-compat.el

index 278e3c1e33d8e3a88a850d0cda116aca4786e8cc..b072020424577a6b7c23e51f36f9be49e614afba 100644 (file)
@@ -1,3 +1,8 @@
+2002-10-25  Karl Eichwalder  <ke@suse.de>
+
+        * po-compat.el (po-find-file-coding-system-guts): Provide the old
+        version (pre 2002-09-27) for XEmacs.
+
 2002-10-16  Bruno Haible  <bruno@clisp.org>
 
        * po-compat.el: Remove call of codepage-setup of all support codepages.
index 8aee214c382ca29295dd98834e484b8aa8ebe23a..67fc6ac2746cab35e1c949cf83b8b743e5b87d4c 100644 (file)
@@ -181,7 +181,7 @@ Content-Type into a Mule coding system.")
                 (match-string 1))))))
 
 (eval-and-compile
-  (if (or po-EMACS20 po-XEMACS)
+  (if po-EMACS20
       (defun po-find-file-coding-system-guts (operation filename)
        "\
 Return a Mule (DECODING . ENCODING) pair, according to PO file charset.
@@ -210,6 +210,25 @@ Called through file-coding-system-alist, before the file is visited for real."
                            (t
                             'no-conversion))))))))
 
+  (if po-XEMACS
+      (defun po-find-file-coding-system-guts (operation filename)
+       "\
+Return a Mule (DECODING . ENCODING) pair, according to PO file charset.
+Called through file-coding-system-alist, before the file is visited for real."
+       (and (eq operation 'insert-file-contents)
+            (file-exists-p filename)
+            (po-with-temp-buffer
+              (let ((coding-system-for-read 'no-conversion))
+                 (let* ((charset (or (po-find-charset filename)
+                                    "ascii"))
+                        (charset-upper (intern (upcase charset)))
+                        (charset-lower (intern (downcase charset))))
+                   (list (or (cdr (assq charset-upper
+                                        po-content-type-charset-alist))
+                             (if (memq charset-lower (coding-system-list))
+                                 charset-lower
+                               'no-conversion)))))))))
+
   (if po-EMACS20
       (defun po-find-file-coding-system (arg-list)
        "\