Mercurial > emacs
changeset 35324:dcbb79777f94
(transform-make-coding-system-args): New function.
(make-coding-system): Accept XEmacs style arguments.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Tue, 16 Jan 2001 10:34:30 +0000 |
parents | 8329471c78d4 |
children | ad3280e346cc |
files | lisp/international/mule.el |
diffstat | 1 files changed, 43 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/international/mule.el Tue Jan 16 10:32:59 2001 +0000 +++ b/lisp/international/mule.el Tue Jan 16 10:34:30 2001 +0000 @@ -620,6 +620,33 @@ (setq i (1+ i))) subsidiaries)) +(defun transform-make-coding-system-args (name type &optional doc-string props) + "For internal use only. +Transform XEmacs style args for `make-coding-system' to Emacs style. +Value is a list of transformed arguments." + (let ((mnemonic (string-to-char (or (plist-get props 'mnemonic) "?"))) + (eol-type (plist-get props 'eol-type)) + properties tmp) + (cond + ((eq eol-type 'lf) (setq eol-type 'unix)) + ((eq eol-type 'crlf) (setq eol-type 'dos)) + ((eq eol-type 'cr) (setq eol-type 'mac))) + (if (setq tmp (plist-get props 'post-read-conversion)) + (setq properties (plist-put properties 'post-read-conversion tmp))) + (if (setq tmp (plist-get props 'pre-write-conversion)) + (setq properties (plist-put properties 'pre-write-conversion tmp))) + (cond + ((eq type 'ccl) + `(,name 4 + ,mnemonic + ,doc-string + (,(plist-get props 'decode) . ,(plist-get props 'encode)) + ,properties + ,eol-type)) + (t + (error "Unsupported XEmacs style arguments for make-coding-style: %S" + `(,name ,type ,doc-string ,props)))))) + (defun make-coding-system (coding-system type mnemonic doc-string &optional flags @@ -714,6 +741,22 @@ 2. If PROPERTIES is just a list of character sets, the list is set as a value of `safe-charsets' in PLIST." + + ;; For compatiblity with XEmacs, we check the type of TYPE. If it + ;; is a symbol, perhaps, this fucntion is called with arguments of + ;; XEmacs style. Here, try to transform that kind of arguments to + ;; Emacs style. + (if (symbolp type) + (let ((args (transform-make-coding-system-args coding-system type + mnemonic doc-string))) + (setq coding-system (car args) + type (nth 1 nargs) + mnemonic (nth 2 args) + doc-string (nth 3 args) + flags (nth 4 args) + properties (nth 5 args) + eol-type (nth 6 args)))) + ;; Set a value of `coding-system' property. (let ((coding-spec (make-vector 5 nil)) (no-initial-designation t)