Sync with apel-10_3-1.
[elisp/lemi.git] / poe / pccl-20.el
index b95244a..e332020 100644 (file)
@@ -1,9 +1,8 @@
 ;;; pccl-20.el --- Portable CCL utility for Emacs 20 and XEmacs-21-mule
 
-;; Copyright (C) 1998 Free Software Foundation, Inc.
-;; Copyright (C) 1998 Tanaka Akira
+;; Copyright (C) 1998,1999,2000 Free Software Foundation, Inc.
 
-;; Author: Tanaka Akira  <akr@jaist.ac.jp>
+;; Author: Tanaka Akira  <akr@m17n.org>
 ;; Keywords: emulation, compatibility, Mule
 
 ;; This file is part of APEL (A Portable Emacs Library).
 
 (eval-and-compile
 
+  (static-if (featurep 'xemacs)
+      (defadvice make-coding-system (before ccl-compat (name type &rest ad-subr-args) activate)
+       (when (and (integerp type)
+                  (eq type 4)
+                  (characterp (ad-get-arg 2))
+                  (stringp (ad-get-arg 3))
+                  (consp (ad-get-arg 4))
+                  (symbolp (car (ad-get-arg 4)))
+                  (symbolp (cdr (ad-get-arg 4))))
+         (setq type 'ccl)
+         (setq ad-subr-args
+               (list
+                (ad-get-arg 3)
+                (append
+                 (list
+                  'mnemonic (char-to-string (ad-get-arg 2))
+                  'decode (symbol-value (car (ad-get-arg 4)))
+                  'encode (symbol-value (cdr (ad-get-arg 4))))
+                 (ad-get-arg 5)))))))
+
   (if (featurep 'xemacs)
       (defun make-ccl-coding-system (name mnemonic docstring decoder encoder)
        "\