# HG changeset patch # User Kenichi Handa # Date 979641270 0 # Node ID dcbb79777f94b946e45a4552b4ce37351a40d035 # Parent 8329471c78d4e1755c274dd30377170e70f71286 (transform-make-coding-system-args): New function. (make-coding-system): Accept XEmacs style arguments. diff -r 8329471c78d4 -r dcbb79777f94 lisp/international/mule.el --- 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)