;;; pure-cs-mule2.el --- Mule2.* specific code for PURE coding-system module ;; Copyright (C) 2000 by Project Pure. ;; Author: SHIMADA Mitsunobu ;; Keywords: PURE, coding-system, Mule2.* ;; $Id: pure-cs-mule2.el,v 1.5 2001/06/05 16:34:17 simm Exp $ ;; This file is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2, or (at your option) ;; any later version. ;; This file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. ;;; Commentary: ;; PURE means "Primitive Universal Relay-chat Environment" ;; CS means coding-system ;; This module is derived from irchat-pj-specific-mule2.el ;;; Code: (defvar pure-cs-enable-mbchars (featurep 'mule) "Multibyte characters availability flag. If non-nil, multibyte characters are available.") (defvar pure-cs-mule2-alist '((iso-2022-7bit-ss2 . *iso-2022-ss2-7*) (iso-2022-jp . *iso-2022-jp*) (iso-2022-jproxy . *iso-2022-jproxy*) (euc-jp . *euc-japan*) (euc-japan . *euc-japan*) (sjis . *sjis*) (shift-jis . *sjis*) (shift_jis . *sjis*) (ctext . *ctext*) (x-ctext . *x-ctext*) (no-conversion . *noconv*)) "Table of coding system. Each car is Emacs20-expression, cdr is Mule2.*-expression.") (defsubst pure-cs-set-service (service in out) (define-service-coding-system service nil (cons in out))) (defsubst pure-cs-set-process (process in out) (set-process-coding-system process in out)) (defsubst pure-cs-set-noconv-service (service) (pure-cs-set-service service *noconv* *noconv*)) (defsubst pure-cs-set-noconv-process (process) (pure-cs-set-process process *noconv* *noconv*)) (defun pure-cs-decode-region (beg end code) "Decode the current region by specified coding system. This function emulates `decode-coding-region' on GNU Emacs 20.*" (code-convert-region beg end (cdr (assq code pure-cs-mule2-alist)) *internal*)) (defun pure-cs-encode-region (beg end code) "Encode the current region by specified coding system. This function emulates `encode-coding-region' on GNU Emacs 20.*" (code-convert-region beg end *internal* (cdr (assq code pure-cs-mule2-alist)))) (defun pure-cs-decode-string (str code) "Decode the current string by specified coding system. This function emulates `decode-coding-string' on GNU Emacs 20.*" (code-convert-string str (cdr (assq code pure-cs-mule2-alist)) *internal*)) (defun pure-cs-encode-string (str code) "Encode the current string by specified coding system. This function emulates `encode-coding-string' on GNU Emacs 20.*" (code-convert-string str *internal* (cdr (assq code pure-cs-mule2-alist)))) ;;; That's all (provide 'pure-cs-mule2) ;;; pure-cs-mule2.el ends here