[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: autoload for define-ccl-program
From: |
Werner LEMBERG |
Subject: |
Re: autoload for define-ccl-program |
Date: |
Wed, 21 Nov 2001 08:02:24 +0100 (CET) |
> > I kindly ask for adding `define-ccl-program' to autoload.el if
> > possible. Otherwise please tell me how to do a workaround.
>
> I saw it but I don't know what to do with that question.
> Do you want it to work similarly to
>
> ;;;###autoload
> (defun balbla ...)
>
> or more like
>
> ;;;###autoload
> (defvar blabla ...)
>
> right now, the behavior is the same as for `defvar', so I assume you
> want it to be more like `defun'. In that case you'll probably need
> to hack more than just autoload.el. Because right now only elisp
> functions, keymaps and macros can be autoloaded that way.
>
> You'll need to find a representation for "this will be CCL after
> loading foo.el" and then whenever a CCL program of that form is
> about to be used, do the `load'.
Maybe I'm on the wrong track, so I will describe how to use it.
For EUC-TW support, I will add a bunch of auxiliary functions to
china-util.el; most of them are used to set up a Big5->CNS mapping
alist. Two others are
(define-ccl-program ccl-decode-euc-tw
... )
and
(define-ccl-program ccl-encode-euc-tw
... )
Later on, I define the following coding system in china.el:
(make-coding-system
'euc-tw 4 ?Z
"ISO 2022 based EUC encoding for Chinese CNS11643"
'(ccl-decode-euc-tw . ccl-encode-euc-tw)
'((safe-charsets ascii
chinese-big5-1
chinese-big5-2
chinese-cns11643-1
chinese-cns11643-2
chinese-cns11643-3
chinese-cns11643-4
chinese-cns11643-5
chinese-cns11643-6
chinese-cns11643-7)
(valid-codes 0 . 255)))
As you can see, the two ccl functions should be automatically loaded
if euc-tw is accessed. While `set-language-info-alist' offers a
`features' key which loads a file with auxiliary routines,
`make-coding-system' lacks this possibility. Maybe it is better to
have this `features' key for `make-coding-system' also?
Werner