From: Bruno Haible Date: Tue, 24 Jul 2001 13:09:36 +0000 (+0000) Subject: Make it work in xemacs as well. X-Git-Tag: v0.10.39~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=05c3e8a103d1bdadbeff8874fcac1271c8a4836f;p=thirdparty%2Fgettext.git Make it work in xemacs as well. --- diff --git a/misc/ChangeLog b/misc/ChangeLog index 5ab3df57a..eda7d8482 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,3 +1,9 @@ +2001-06-25 Bruno Haible + + * po-mode.el (po-find-file-coding-system): Make it work in XEmacs 20 + as well. Based on a patch by Enrico Scholz + . + 2001-05-23 Bruno Haible * gettext-0.10.38 released. diff --git a/misc/po-mode.el b/misc/po-mode.el index 9061b0704..62fdf92c0 100644 --- a/misc/po-mode.el +++ b/misc/po-mode.el @@ -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.")