;;; pure-cs-nemacs.el --- NEmacs specific code for PURE coding-system module ;; Copyright (C) 2000 by Project Pure. ;; Author: SHIMADA Mitsunobu ;; Keywords: PURE, coding-system, NEmacs ;; $Id: pure-cs-nemacs.el,v 1.4 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-nemacs.el ;; (Caution) We Project Pure don't support NEmacs environment. ;;; Code: (defvar pure-cs-enable-mbchars (boundp 'NEMACS) "Multibyte characters availability flag. If non-nil, multibyte characters are available.") (defvar pure-cs-nemacs-alist '((iso-2022-7bit-ss2 . 2) (iso-2022-jp . 2) (iso-2022-jproxy . 2) (euc-jp . 3) (euc-japan . 3) (sjis . 1) (shift-jis . 1) (shift_jis . 1) (ctext . 2) (x-ctext . 2) (no-conversion . 0)) "Table of coding system. Each car is Emacs20-expression, cdr is NEmacs-expression.") (defsubst pure-cs-set-service (service in out) (define-service-kanji-code service nil in)) (defsubst pure-cs-set-process (process in out) (set-process-kanji-code process in)) (defsubst pure-cs-set-noconv-service (service) (pure-cs-set-service service 0 0)) (defsubst pure-cs-set-noconv-process (process) (pure-cs-set-process process 0 0)) (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.*" (convert-region-kanji-code beg end (cdr (assq code pure-cs-nemacs-alist)) 3)) (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.*" (convert-region-kanji-code beg end 3 (cdr (assq code pure-cs-nemacs-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.*" (convert-string-kanji-code str (cdr (assq code pure-cs-nemacs-alist)) 3)) (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.*" (convert-string-kanji-code str 3 (cdr (assq code pure-cs-nemacs-alist)))) ;;; That's all (provide 'pure-cs-nemacs) ;;; pure-cs-nemacs.el ends here