]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Make it work in xemacs as well.
authorBruno Haible <bruno@clisp.org>
Tue, 24 Jul 2001 13:09:36 +0000 (13:09 +0000)
committerBruno Haible <bruno@clisp.org>
Sun, 28 Jun 2009 14:35:52 +0000 (16:35 +0200)
misc/ChangeLog
misc/po-mode.el

index 5ab3df57a27c2656600b6ea347ae6cbad00d46ba..eda7d84823931616f38aecc3c047bdf389a0d800 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-05-23  Bruno Haible  <haible@clisp.cons.org>
 
        * gettext-0.10.38 released.
index 9061b0704de8c9bd8b991d94314cd0929bc1cb77..62fdf92c07be8af33be809dad5de3f8880b5e5b4 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.")