X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=pccl.el;h=c696f75797d234f28338687f61a67f7b7e2c3e74;hb=86c8b956d6f9792c9a5d5bb9c07edd4b67010468;hp=eca83235dee3f10e6518d9b0cb954410757ce05d;hpb=0df64d3b6ef5ae5212fd59ee13dd5f044b378ba6;p=elisp%2Fapel.git diff --git a/pccl.el b/pccl.el index eca8323..c696f75 100644 --- a/pccl.el +++ b/pccl.el @@ -1,4 +1,4 @@ -;;; pccl.el --- Portable CCL utility for Mule 1.* and Mule 2.* +;;; pccl.el --- Portable CCL utility for Mule 2.* ;; Copyright (C) 1998 Free Software Foundation, Inc. @@ -24,18 +24,54 @@ ;;; Code: -(if (featurep 'mule) - (if (>= emacs-major-version 20) - ;; for Emacs 20 and XEmacs-mule - (require 'pccl-20) - ;; for MULE 1.* and 2.* - (require 'pccl-om) - )) +(require 'broken) + +(broken-facility ccl-usable + "Emacs has not CCL." + (and (featurep 'mule) + (if (featurep 'xemacs) + (>= emacs-major-version 21) + (>= emacs-major-version 19)))) + +(unless-broken ccl-usable + (require 'ccl) + (require 'advice) + + (if (featurep 'mule) + (if (featurep 'xemacs) + (if (>= emacs-major-version 21) + ;; for XEmacs 21 with mule + (require 'pccl-20)) + (if (>= emacs-major-version 20) + ;; for Emacs 20 + (require 'pccl-20) + ;; for Mule 2.* + (require 'pccl-om)))) + + (defadvice define-ccl-program + (before accept-long-ccl-program activate) + "When CCL-PROGRAM is too long, internal buffer is extended automaticaly." + (let ((try-ccl-compile t) + (prog (eval (ad-get-arg 1)))) + (ad-set-arg 1 (` '(, prog))) + (while try-ccl-compile + (setq try-ccl-compile nil) + (condition-case sig + (ccl-compile prog) + (args-out-of-range + (if (and (eq (car (cdr sig)) ccl-program-vector) + (= (car (cdr (cdr sig))) (length ccl-program-vector))) + (setq ccl-program-vector + (make-vector (* 2 (length ccl-program-vector)) 0) + try-ccl-compile t) + (signal (car sig) (cdr sig)))))))) + ) ;;; @ end ;;; -(provide 'pccl) +(require 'product) +(product-provide (provide 'pccl) (require 'apel-ver)) ;;; pccl.el ends here