]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Make po-find-file-coding-system work in XEmacs as well.
authorBruno Haible <bruno@clisp.org>
Mon, 25 Jun 2001 18:25:34 +0000 (18:25 +0000)
committerBruno Haible <bruno@clisp.org>
Mon, 25 Jun 2001 18:25:34 +0000 (18:25 +0000)
misc/ChangeLog
misc/po-mode.el

index eb98ac334f20823c49edf15573869fad52965329..9486588c0a8a275becb938f094b06182736fe6cd 100644 (file)
@@ -1,3 +1,9 @@
+2001-06-25  Bruno Haible  <haible@clisp.cons.org>
+
+       * po-mode.el (po-find-file-coding-system): Make it work in XEmacs 20
+       as well. Based on a patch by Enrico Scholz
+       <enrico.scholz@informatik.tu-chemnitz.de>.
+
 2001-06-04  Karl Eichwalder  <ke@suse.de>
 
        * po-mode.el (po-edit-string): Set 'buffer-file-coding-system'
index 47fc49389c546a21b0e83b8b2788a536d0740e1d..dec24aeb2766dccc9b785a39219dfb40c90f1ea6 100644 (file)
@@ -697,16 +697,15 @@ Content-Type into a Mule coding system.")
 ;;; Mode activation.
 
 (eval-and-compile
-  (if po-EMACS20
-
-      (defun po-find-file-coding-system (arg-list)
+  (if (or po-EMACS20 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 (car arg-list) 'insert-file-contents)
+       (and (eq operation 'insert-file-contents)
             (with-temp-buffer
               (let ((coding-system-for-read 'no-conversion))
                 ;; Is 4096 enough?  FIXME: Retry as needed!
-                (insert-file-contents (nth 1 arg-list) nil 0 4096)
+                (insert-file-contents filename nil 0 4096)
                 (if (re-search-forward
                      "^\"Content-Type: text/plain;[ \t]*charset=\\([^\\]+\\)"
                      nil t)
@@ -719,9 +718,21 @@ Called through file-coding-system-alist, before the file is visited for real."
                                 (if (memq charset-lower (coding-system-list))
                                     charset-lower
                                   'no-conversion))))
-                  '(no-conversion))))))
+                  '(no-conversion)))))))
+
+  (if po-EMACS20
+      (defun po-find-file-coding-system (arg-list)
+       "Return a Mule (DECODING . ENCODING) pair, according to PO file charset.
+Called through file-coding-system-alist, before the file is visited for real."
+       (po-find-file-coding-system-guts (car arg-list) (car (cdr arg-list)))))
+
+  (if po-XEMACS
+      (defun po-find-file-coding-system (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."
+       (po-find-file-coding-system-guts operation filename)))
 
   ))
+ )
 
 (defvar po-mode-map nil
   "Keymap for PO mode.")